Lomse library. API documentation
0.30.0
|
#include <lomse_events.h>
Auxiliary object responsible for keeping information about an Observable object being observed, the events to listen to and the methods that must invoke to dispatch each event. It is also responsible for doing this dispatch when requested.
Public Member Functions | |
virtual | ~Observer () |
Observable * | target () |
void | notify (SpEventInfo pEvent) |
void | remove_handler (int evtType) |
int | get_observable_type () |
void | add_handler (int eventType, void(*pt2Func)(SpEventInfo event)) |
void | add_handler (int eventType, void *pThis, void(*pt2Func)(void *pObj, SpEventInfo event)) |
void | add_handler (int eventType, EventHandler *pHandler) |
void | add_handler (int eventType, int childType, ImoId childId, EventHandler *pHandler) |
Friends | |
class | EventNotifier |
|
virtual |
Destructor.
void Observer::add_handler | ( | int | eventType, |
void(*)(SpEventInfo event) | pt2Func | ||
) |
Register to receive notifications from this Observer.
void Observer::add_handler | ( | int | eventType, |
void * | pThis, | ||
void(*)(void *pObj, SpEventInfo event) | pt2Func | ||
) |
Register to receive notifications from this Observer.
void Observer::add_handler | ( | int | eventType, |
EventHandler * | pHandler | ||
) |
Register to receive notifications from this Observer.
void Observer::add_handler | ( | int | eventType, |
int | childType, | ||
ImoId | childId, | ||
EventHandler * | pHandler | ||
) |
Register to receive notifications from this Observer.
|
inline |
Returns the type of the observed event generator object.
void Observer::notify | ( | SpEventInfo | pEvent | ) |
Notify the event pEvent to all registered objects observing events of the same type than pEvent type.
void Observer::remove_handler | ( | int | evtType | ) |
Remove a registered handler so that in future it will not be notified of new events.
Observable* Observer::target | ( | ) |
Returns the event generator object that is being observed by this Observer.