$darkmode
#include <data_broker.hpp>
Public Types | |
| using | SignalContainer = std::map< std::string, SignalPtr, std::less<> > |
Public Member Functions | |
| DataBroker (const sol::state_view &lua) | |
| DataBroker (const DataBroker &)=delete | |
| DataBroker (DataBroker &&)=delete | |
| DataBroker & | operator= (const DataBroker &)=delete |
| DataBroker & | operator= (DataBroker &&)=delete |
| template<typename T > | |
| void | declare_type (lua_signal_declarator_t type_declarator) |
| Declares a DataType to Lua (if not yet done) More... | |
| void | bind_signal (std::string_view signal_name, std::string_view lua_name) |
| Binds a signal to the Lua-VM. More... | |
| void | bind_signal (std::string_view signal_name) |
| Binds a signal to the Lua-VM. More... | |
| void | bind (std::string_view signals_name, sol::table parent) |
| Binds the signals-object to Lua. More... | |
| void | bind (std::string_view signals_name) |
| const SignalContainer::const_iterator | operator[] (std::string_view name) const |
| SignalContainer::iterator | operator[] (std::string_view name) |
| SignalPtr | alias (SignalPtr signal, std::string_view new_name) |
| SignalPtr | alias (std::string_view old_name, std::string_view new_name, std::regex::flag_type f=std::regex_constants::ECMAScript) |
| template<typename T > | |
| SignalPtr | declare (std::string_view name) |
| template<typename T > | |
| SignalPtr | declare (std::string_view name, T *value_ptr) |
| template<typename T > | |
| SignalPtr | declare (std::string_view name, std::function< T()> getter, std::function< void(T)> setter) |
| template<typename T > | |
| Container< databroker::compatible_base_t< T > > | implement (std::string_view new_name) |
| SignalPtr | signal (std::string_view name) const |
| SignalPtr | signal (std::string_view name) |
| const SignalContainer & | signals () const |
| SignalContainer & | signals () |
| template<typename T > | |
| void | subscribe (std::string_view name, databroker::on_value_changed_callback_t< T > callback) |
| template<typename T > | |
| void | set_value (std::string_view name, databroker::signal_type_cref_t< T > value) |
| template<typename T > | |
| databroker::signal_type_cref_t< T > | value (std::string_view name) const |
| template<typename T > | |
| const Signal::typed_get_value_function_t< T > & | getter (std::string_view name) const |
| template<typename T > | |
| void | set_getter (std::string_view name, const Signal::typed_get_value_function_t< T > &getter_fn) |
| template<typename T > | |
| const Signal::typed_set_value_function_t< T > & | setter (std::string_view name) const |
| template<typename T > | |
| void | set_setter (std::string_view name, const Signal::typed_set_value_function_t< T > &setter_fn) |
Registry for type-erased signals.
|
inline |
Give an existing signal an alias.
| signal | Signal to be named |
| new_name | New name of the signal |
|
inline |
Give an existing signal a (new) name.
| old_name | Name of the existing signal |
| new_name | New name of the signal |
| f | flag_type flags used to guide the interpretation of the character sequence as a regular expression |
|
inline |
Binds the signals-object to Lua.
| signals_name | Name which shall be used for the table |
| parent_table | Parent-table to use |
|
inline |
Binds a signal to the Lua-VM.
| signal_name | Name of the signal |
|
inline |
Binds a signal to the Lua-VM.
| signal_name | Name of the signal |
| lua_name | Name of the table/variable used in Lua |
|
inline |
Declare a new signal.
| T | Type of the signal |
| name | Name of the signal |
|
inline |
Declare a new signal and auto-implement getter and setter.
| T | type of the signal value |
| name | name of the signal |
| value_ptr | pointer to signal value |
|
inline |
Declares a DataType to Lua (if not yet done)
|
inline |
Return the getter-function of a signal.
| T | Type of the signal |
| name | Name of the signal |
|
inline |
Declare a new signal.
| T | Type of the signal |
| name | Name of the signal |
|
inline |
Return the signal with the given name.
| name | Name of the signal |
|
inline |
Return the signal with the given name.
| name | Name of the signal |
|
inline |
Sets the getter-function of a signal.
| T | Type of the signal |
| name | Name of the signal |
| getter_fn | getter-function of the signal |
|
inline |
Sets the setter-function of a signal.
| T | Type of the signal |
| name | Name of the signal |
| getter_fn | setter-function of the signal |
|
inline |
Set the value of a signal.
| T | Type of the signal |
| name | Name of the signal |
| value | Value to be assigned to the signal |
|
inline |
Return the setter-function of a signal.
| T | Type of the signal |
| name | Name of the signal |
|
inline |
Return the signal with the given name.
| name | Name of the signal |
|
inline |
Return the signal with the given name.
| name | Name of the signal |
|
inline |
Return all signals.
|
inline |
Return all signals.
|
inline |
Subscribe to value-changed events.
| T | Type of the signal |
| name | Name of the signal |
| callback | event-function which will be called when the value changed |
|
inline |
Return the value of a signal.
| T | Type of the signal |
| name | Name of the signal |