![]() |
NDEVR
API Documentation
|
Simple version of ResourceListener which allows for a simple function callback that will be executed when a Resource changes instead of a class override. More...
Public Member Functions | |
| BasicResourceListener (const std::function< void()> &callback) | |
| Constructs a BasicResourceListener with the given callback function. | |
| virtual | ~BasicResourceListener () |
| Destructor. | |
| void | onValueChanged () override final |
| Called when the listened Resource value changes. | |
| Public Member Functions inherited from ResourceListener | |
| ResourceListener () | |
| Constructs a default ResourceListener. | |
| virtual | ~ResourceListener () |
| Virtual destructor. | |
| virtual void | addInfoParent (const ResourceBase *info) |
| Registers a ResourceBase as a parent that this listener is observing. | |
| void | changeValue () |
| Triggers the value changed callback for this listener. | |
| void | disable (bool disable) |
| Enables or disables this listener. | |
| void | disconnectListener () |
| Disconnects this listener from all parent resources it is subscribed to. | |
| uint04 | getInfoParentSize () const |
| Returns the number of parent resources this listener is subscribed to. | |
| virtual void | removeInfoParent (const ResourceBase *info) |
| Removes a ResourceBase from the list of parents this listener is observing. | |
Public Attributes | |
| const std::function< void()> | m_callback |
| The callback function invoked when the Resource value changes. | |
Simple version of ResourceListener which allows for a simple function callback that will be executed when a Resource changes instead of a class override.
Definition at line 41 of file BasicResourceListener.h.
|
inlineexplicit |
Constructs a BasicResourceListener with the given callback function.
| [in] | callback | The function to invoke when the listened Resource changes. Must not be null. |
Definition at line 48 of file BasicResourceListener.h.
References ResourceListener::ResourceListener(), and m_callback.
|
inlinefinaloverridevirtual |
Called when the listened Resource value changes.
Invokes the stored callback.
Implements ResourceListener.
Definition at line 62 of file BasicResourceListener.h.
References m_callback.