Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <EventRouter.h>
Actually only stores void*'s, so it's more general than just Listeners or Trappers
Definition at line 182 of file EventRouter.h.
Public Member Functions | |
EventMapper () | |
constructor | |
void | addMapping (void *el, EventBase::EventGeneratorID_t egid) |
Adds a listener for all events from a given event generator. | |
void | addMapping (void *el, EventBase::EventGeneratorID_t egid, unsigned int sid, EventBase::EventTypeID_t etid) |
Adds a listener for a specific source id and type from a given event generator. | |
void | removeMapping (void *el, EventBase::EventGeneratorID_t egid) |
Removes a listener for all events from a given event generator. | |
void | removeMapping (void *el, EventBase::EventGeneratorID_t egid, unsigned int sid, EventBase::EventTypeID_t etid) |
Removes a listener for a specific source id and type from a given event generator. | |
void | clean () |
compresses empty data structures | |
void | clear () |
Resets the mapping. | |
template<class T> void | getMapping (const EventBase &e, std::vector< T * > &listeners) |
builds a list of all listeners which should receive the event, templated to typecast the pointers for you | |
bool | hasMapping (EventBase::EventGeneratorID_t egid) |
so stuff can tell if it even needs to bother generating an event... | |
bool | hasMapping (EventBase::EventGeneratorID_t egid, unsigned int sid) |
so stuff can tell if it even needs to bother generating an event... | |
bool | hasMapping (EventBase::EventGeneratorID_t egid, unsigned int sid, EventBase::EventTypeID_t etid) |
so stuff can tell if it even needs to bother generating an event... | |
Protected Types | |
typedef std::map< unsigned int, std::vector< void * >, std::less< unsigned int > > | SIDtoListenerVectorMap_t |
a mapping from source IDs (unsigned ints), each to a vector of pointers to listeners | |
Protected Attributes | |
std::vector< void * > | allevents [EventBase::numEGIDs] |
an array of vectors of pointers to listeners... in other words, a vector of listener pointers for each generator | |
SIDtoListenerVectorMap_t * | filteredevents [EventBase::numEGIDs][EventBase::numETIDs] |
not for the faint of heart: a matrix of mappings to vectors of pointers to listeners | |
Private Member Functions | |
EventMapper (const EventMapper &) | |
this shouldn't be called... | |
EventMapper | operator= (const EventMapper &) |
this shouldn't be called... |
|
a mapping from source IDs (unsigned ints), each to a vector of pointers to listeners main use in filteredevents
Definition at line 222 of file EventRouter.h. |
|
constructor
Definition at line 162 of file EventRouter.cc. References filteredevents, EventBase::numEGIDs, and EventBase::numETIDs. |
|
this shouldn't be called...
|
|
Adds a listener for a specific source id and type from a given event generator.
Definition at line 168 of file EventRouter.cc. References filteredevents, and SIDtoListenerVectorMap_t. |
|
Adds a listener for all events from a given event generator.
Definition at line 187 of file EventRouter.h. References allevents. |
|
compresses empty data structures
Definition at line 212 of file EventRouter.cc. References filteredevents, EventBase::numEGIDs, EventBase::numETIDs, and SIDtoListenerVectorMap_t. |
|
Resets the mapping.
Definition at line 247 of file EventRouter.cc. References filteredevents, EventBase::numEGIDs, EventBase::numETIDs, and SIDtoListenerVectorMap_t. |
|
builds a list of all listeners which should receive the event, templated to typecast the pointers for you
Definition at line 302 of file EventRouter.cc. References allevents, filteredevents, EventBase::getGeneratorID(), EventBase::getSourceID(), EventBase::getTypeID(), and SIDtoListenerVectorMap_t. |
|
so stuff can tell if it even needs to bother generating an event...
Definition at line 289 of file EventRouter.cc. References allevents, filteredevents, and SIDtoListenerVectorMap_t. |
|
so stuff can tell if it even needs to bother generating an event...
Definition at line 275 of file EventRouter.cc. References allevents, filteredevents, EventBase::numETIDs, and SIDtoListenerVectorMap_t. |
|
so stuff can tell if it even needs to bother generating an event...
Definition at line 260 of file EventRouter.cc. References allevents, filteredevents, EventBase::numETIDs, and SIDtoListenerVectorMap_t. |
|
this shouldn't be called...
|
|
Removes a listener for a specific source id and type from a given event generator. Doesn't necessarily remove the vector or mapping if this was the last listener, use clean() to do that Definition at line 201 of file EventRouter.cc. References filteredevents, and SIDtoListenerVectorMap_t. |
|
Removes a listener for all events from a given event generator. Doesn't necessarily remove the vector or mapping if this was the last listener, use clean() to do that Definition at line 184 of file EventRouter.cc. References allevents, filteredevents, EventBase::numETIDs, and SIDtoListenerVectorMap_t. |
|
an array of vectors of pointers to listeners... in other words, a vector of listener pointers for each generator
Definition at line 225 of file EventRouter.h. |
|
not for the faint of heart: a matrix of mappings to vectors of pointers to listeners
Definition at line 227 of file EventRouter.h. |
Tekkotsu v1.4 |
Generated Sat Jul 19 00:08:56 2003 by Doxygen 1.3.2 |