Darc Library
2012.11
|
Event handler for function pointer management. More...
#include <dc_function.h>
Classes | |
class | TargetList |
Public Member Functions | |
EventHandler () | |
virtual | ~EventHandler () |
DCR | connect (UInt _eID, IFunction *_pSlot) |
Connects this handler to a function with regard to a given event ID. | |
DCR | ClearEvent (UInt _eID) |
void | disconnect (UInt _eID, IFunction *_pSlot) |
DCR | invoke (UInt _eID, void *_pValue) |
Event handler for function pointer management.
The class can be used to store external functions (via the IFunction interface) with regard to a specified event ID. When invoked, all functions that were assigned to a particular event ID are called. This mechanism is conceptually similar to signals and slots.
darc::EventHandler::EventHandler | ( | ) | [inline] |
virtual darc::EventHandler::~EventHandler | ( | ) | [inline, virtual] |
DCR darc::EventHandler::ClearEvent | ( | UInt | _eID | ) | [inline] |
DCR darc::EventHandler::connect | ( | UInt | _eID, |
IFunction * | _pSlot | ||
) | [inline] |
Connects this handler to a function with regard to a given event ID.
The ownership of the function pointer is passed to the handler. The object will be deleted if the connection cannot be applied, is disconnected or the handler is destroyed.
void darc::EventHandler::disconnect | ( | UInt | _eID, |
IFunction * | _pSlot | ||
) | [inline] |
DCR darc::EventHandler::invoke | ( | UInt | _eID, |
void * | _pValue | ||
) | [inline] |
Calls all functions for the specified event and passes the parameters.