#include <CscCoreEvents.h>
|
| void | publish (const CscCoreEvent *event) |
| |
| template<class TObject , class TEvent > |
| void | registerHandler (const string &handlerId, TObject *handlerObject, void(TObject::*handlerMethod)(const TEvent *event, bool &unregisterAfter), bool deleteObjectOnDestruct=false) |
| |
| template<class TEvent > |
| void | registerHandler (const string &handlerId, HandleEventFunction< TEvent > call) |
| |
| template<class TEvent > |
| void | unregister (const string &handlerId) |
| |
Central class for Conscience Core events management (publish / listen)
◆ getInstance()
| CscCoreEvents * conscience_core::core_objects::events::CscCoreEvents::getInstance |
( |
| ) |
|
|
static |
◆ publish()
| void conscience_core::core_objects::events::CscCoreEvents::publish |
( |
const CscCoreEvent * |
event | ) |
|
Publish a Conscience Core event - Handlers will be notified if any matches this event Note : event pointer will be deleted after handlers call
◆ registerHandler() [1/2]
template<class TEvent >
| void conscience_core::core_objects::events::CscCoreEvents::registerHandler |
( |
const string & |
handlerId, |
|
|
HandleEventFunction< TEvent > |
call |
|
) |
| |
|
inline |
Adds a listener for given event of type TEvent in the form of a member's method.
- Parameters
-
| handlerId | given a unique ID for this handle |
| call | lambda function to be called when event of type TEvent has been published |
◆ registerHandler() [2/2]
template<class TObject , class TEvent >
| void conscience_core::core_objects::events::CscCoreEvents::registerHandler |
( |
const string & |
handlerId, |
|
|
TObject * |
handlerObject, |
|
|
void(TObject::*)(const TEvent *event, bool &unregisterAfter) |
handlerMethod, |
|
|
bool |
deleteObjectOnDestruct = false |
|
) |
| |
|
inline |
Adds a listener for given event of type TEvent in the form of a member's method.
- Parameters
-
| handlerId | given a unique ID for this handle |
| handlerObject | method will be called on this instance |
| handlerMethod | method to be called on handlerObject when event of type TEvent has been published |
| deleteObjectOnDestruct | delete given handlerObject when unregister is called |
◆ unregister()
template<class TEvent >
| void conscience_core::core_objects::events::CscCoreEvents::unregister |
( |
const string & |
handlerId | ) |
|
|
inline |
Unregisters event handler of ID handlerId for event type TEvent
The documentation for this class was generated from the following files: