#include <DVarProperty.hpp>
Public Member Functions | |
DVarProperty (Instance *inst, DVarIdT< T > id) | |
~DVarProperty () | |
Instance * | instance () |
void | value (std::optional< T > const &val) |
T | value () |
void | on_changed (std::function< void(T const &newval) > const &, bool call_immediately=false) |
Public Attributes | |
ClientMarker | cm |
Detailed Description
template<class T>
class iv::DVarProperty< T >
Definition at line 12 of file DVarProperty.hpp.
Constructor & Destructor Documentation
◆ DVarProperty()
iv::DVarProperty< T >::DVarProperty | ( | Instance * | inst, |
DVarIdT< T > | id | ||
) |
Definition at line 5 of file DVarProperty.inl.
◆ ~DVarProperty()
iv::DVarProperty< T >::~DVarProperty |
Definition at line 25 of file DVarProperty.inl.
Member Function Documentation
◆ instance()
Instance * iv::DVarProperty< T >::instance |
Definition at line 32 of file DVarProperty.inl.
◆ value() [1/2]
void iv::DVarProperty< T >::value | ( | std::optional< T > const & | val | ) |
If empty value is set, then the value of this is determined by the DVar system. If non-empty value is set, then this non-empty value is used.
Definition at line 38 of file DVarProperty.inl.
◆ value() [2/2]
T iv::DVarProperty< T >::value |
Returns the value - either the value set by the setter (DVarProperty<T>::value) or value determined by DVar system. If DVarProperty<T>::value setter was not called before, then this will return value from DVar system.
Definition at line 46 of file DVarProperty.inl.
◆ on_changed()
void iv::DVarProperty< T >::on_changed | ( | std::function< void(T const &newval) > const & | fun, |
bool | call_immediately = false |
||
) |
Called whenever the result of DVarPropert::value getter changes, this is called. This will be called when it is changed either from dvar system or from value setter. If parameter 'call_immediately' is called, then the callback function is called from inside of this call to DVarProperty<T>::on_changed with current value.
Definition at line 70 of file DVarProperty.inl.
Member Data Documentation
◆ cm
ClientMarker iv::DVarProperty< T >::cm |
Definition at line 15 of file DVarProperty.hpp.
The documentation for this class was generated from the following files:
- ivorium_systems/DVarSystem/DVarProperty.hpp
- ivorium_systems/DVarSystem/DVarProperty.inl