![]() |
SCENE C++ API
2.0.31
|
General signal interface which provides functionality to connect arbitrary function handlers to a specific signal. More...
#include <lssignal.h>
Public Member Functions | |
void | connect (void(*handler)(Event)) |
Adds a free function as a function handler for this signal. More... | |
template<class Trackable > | |
void | connect (Trackable *trackable, void(Trackable::*handler)(Event)) |
Adds a member function as a function handler for this signal. More... | |
void | operator() (Event event, bool synchronize=false) |
Triggers the signals and calls the connected function handlers. More... | |
General signal interface which provides functionality to connect arbitrary function handlers to a specific signal.
The function handler has to match the function signature of the signal and can either be a free function or a member function of a LSTrackable derived class.
|
inline |
Adds a free function as a function handler for this signal.
The function needs to have a matching signature with a void return value and an event of the specified type as a single argument.
handler | A function pointer to the free function which should be added as a function handler. |
|
inline |
Adds a member function as a function handler for this signal.
The function needs to be a member of an LSTrackable derived class and needs to have a matching signature with a void return value and an event of the specified type as a single argument.
trackable | The trackable instance whose member function should be called when the signal is triggered. |
handler | A function pointer to the free function which should be added as a function handler. |
void operator() | ( | Event | event, |
bool | synchronize = false |
||
) |
Triggers the signals and calls the connected function handlers.
event | The event which is passed to the connected function handlers. |
synchronize | Whether the call should wait until all function handler have been called. |