Distributes events to event handlers.
More...
|
virtual void | addHandler (IEventHandler *inHandler, long inType=all_events) |
| add a new handler for some event type, or for all events if no type specified
|
|
virtual void | removeHandler (IEventHandler *inHandler, long inType=all_events) |
| Remove a handler for some event type, or for all events if no type specified.
|
|
virtual void | clear (bool doRelease=true) |
| remove all handlers
|
|
virtual void | blockEvent (long inEventType) |
| temporarily ignore all events of a particular type, just drop them on the floor
|
|
virtual void | unblockEvent (long inEventType) |
| stop ignoring events of a particular type, no recovery of previously ignored events
|
|
| EventEmitter () |
| constructor for new event emitter
|
|
virtual bool | postEvent (long inEventType, void *inEventData, EventEmitter *fromEmitter=0) |
| post an event for immediate handling locally, or relay it to the EventManger
|
|
Distributes events to event handlers.
Distributes events to event handlers. The EventEmitter expects the game developer to implement IEventHandler subclasses and register them to handle various events they are interested in.
- See Also
- IEventHandler
The EventEmitter expects the game developer to implement IEventHandler subclasses and register them to handle various events they are interested in.
- See Also
- IEventHandler
-
EventManager
constructor for new event emitter
add a new handler for some event type, or for all events if no type specified
virtual void blockEvent |
( |
long |
inEventType | ) |
|
|
virtual |
temporarily ignore all events of a particular type, just drop them on the floor
Reimplemented in EventManager.
virtual void clear |
( |
bool |
doRelease = true | ) |
|
|
virtual |
virtual bool postEvent |
( |
long |
inEventType, |
|
|
void * |
inEventData, |
|
|
EventEmitter * |
fromEmitter = 0 |
|
) |
| |
|
virtual |
post an event for immediate handling locally, or relay it to the EventManger
Reimplemented in EventManager.
Remove a handler for some event type, or for all events if no type specified.
Remove a handler for some event type, or for all events if no type specified. If the handler is listed multiple times it will only remove it once. inType == all_events doesn't work quite like you might expect. If you have registered a handler for multiple events, but not with all_events, doing removeHandler(handler, all_events) will do nothing. Basically, all_events is a special event type that matches all event types when considering whether to invoke a handler or not. It is safe to call remove handler from within an event handler's handleEvent() call.
If the handler is listed multiple times it will only remove it once.
- Note
- inType == all_events doesn't work quite like you might expect. If you have registered a handler for multiple events, but not with all_events, doing
removeHandler(handler, all_events)
will do nothing. Basically, all_events is a special event type that matches all event types when considering whether to invoke a handler or not.
It is safe to call remove handler from within an event handler's handleEvent() call.
- Parameters
-
inHandler | the handler that is no longer handling events |
inType | the type of events the handler will no longer handle (optional) |
virtual void unblockEvent |
( |
long |
inEventType | ) |
|
|
virtual |
stop ignoring events of a particular type, no recovery of previously ignored events
Reimplemented in EventManager.