-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Lua and Databroker support #190
Conversation
a8e4de2
to
4e84feb
Compare
abcf824
to
1e02a5c
Compare
523cffa
to
25c8196
Compare
e7e0ea4
to
d672d71
Compare
* Detects the presence of the to_lua function (based on ADL) | ||
*/ | ||
template <typename T> | ||
constexpr bool has_to_lua_v = has_to_lua<T>::value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SEVERITY_LOW If I am not wrong, this does not care about the return type of the to_lua function.
template <typename T> | ||
void to_lua(sol::state_view lua) { | ||
if constexpr (has_to_lua_v<T>) { | ||
to_lua(lua, static_cast<T*>(nullptr)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SEVERITY_LOW What? :D I know you need that parameter T* functionwise but I from a users perspective this does not make sense. People implementing the to_lua function will ask what they are supposed to do with that parameter.
(As per my understanding, the to_lua function is supposed to be implemented as a member function of T)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And having a look at the implementation of the to_lua function in the Wheel class: According to my own trials, the data type of usertype_table["rotation"] is double Wheel::* - I dont understand what exactly is happening tbh. Could you explain this to me once?
if constexpr (has_to_lua_v<T>) { | ||
to_lua(lua, static_cast<T*>(nullptr)); | ||
} else { | ||
// nop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about throwing a proper exception here?
BREAKING CHANGE: If you have implemented any Actions yourself, you will need to make sure the `operator()(const Sync& ...)` returns `cloe::CallbackResult`. You can use `CallbackResult::Ok` to achieve the same behavior.
Linenoise-Source: https://github.com/antirez/linenoise Linenoise-Commit: 93b2db9bd4968f76148dd62cdadf050ed50b84b3 Linenoise-Date: 2023-03-27
- Add slimmed down LRDB library to the engine/vendor/lrdb directory. - It can be compiled in or out via option (in by default) - The command-line flags are --debug-lua and --debug-lua-port
TODO: - Add documentation on how to use it. - Add tests using them. Author: Martin Henselmeyer <[email protected]>
BREAKING CHANGES: - xdg_ functions take and return std::filesystem::path instead of boost::filesystem::path. - Command takes a std::filesystem::path instead of boost::filesystem::path. For the most part, all you need to do is change the namespace to migrate.
All Lua stuff in the data broker I would leave as is, since in the next version substantial changes will be introduced from Moritz. |
This provides an easy mechanism to check a simulation configuration for available trigers, signals, etc.
Test this with the following: