|
Properties | |
void | setMessageQueue (const char *queue) |
static bool | setMessageQueue (void *obj, const char *data) |
Sets the message queue. | |
Public Member Functions | |
DECLARE_CONOBJECT (EventManager) | |
EventManager () | |
virtual | ~EventManager () |
Event Management | |
bool | isRegisteredEvent (const char *eventName) |
Checks if an event is registered. | |
bool | registerEvent (const char *eventName) |
Registers an event. | |
void | unregisterEvent (const char *eventName) |
Removes an event. | |
void | unregisterAllEvents () |
Removes all events. | |
bool | postEvent (const char *eventName, const char *data) |
Triggers an event. | |
bool | subscribe (SimObject *callbackObj, const char *event, const char *callback=NULL) |
Adds a subscription to an event. | |
void | remove (SimObject *cbObj, const char *event) |
Remove a subscriber from an event. | |
Debug Output | |
void | dumpEvents () |
Prints all registered events to the console. | |
void | dumpSubscribers () |
Prints all subscribers to the console. | |
void | dumpSubscribers (const char *event) |
Prints subscribers to a specific event to the console. | |
Static Public Member Functions | |
static void | initPersistFields () |
Register dynamic fields in a subclass of ConsoleObject. | |
Event Manager Tracking | |
static void | addEventManager (EventManager *em) |
Adds an EventManager. | |
static void | removeEventManager (EventManager *em) |
Removes an EventManager. | |
static EventManager * | getEventManager (const char *name) |
Retrieves an EventManager. | |
static void | printEventManagers () |
Prints all the EventManagers to the console. | |
Private Types | |
typedef SimObject | Parent |
Private Attributes | |
StringTableEntry | mQueue |
The name of the message queue. | |
Vector< StringTableEntry > | mEvents |
Registered events. | |
EventManagerListener | mListener |
The event listener. Listens for all events and dispatches them to the appropriate subscribers. | |
Static Private Attributes | |
static Vector< EventManager * > | smEventManagers |
List of all EventManagers. |
typedef SimObject EventManager::Parent [private] |
Reimplemented from SimObject.
EventManager::EventManager | ( | ) |
virtual EventManager::~EventManager | ( | ) | [virtual] |
EventManager::DECLARE_CONOBJECT | ( | EventManager | ) |
static void EventManager::initPersistFields | ( | ) | [static] |
Register dynamic fields in a subclass of ConsoleObject.
Reimplemented from SimObject.
Sets the message queue.
void EventManager::setMessageQueue | ( | const char * | queue | ) |
bool EventManager::isRegisteredEvent | ( | const char * | eventName | ) |
Checks if an event is registered.
bool EventManager::registerEvent | ( | const char * | eventName | ) |
Registers an event.
void EventManager::unregisterEvent | ( | const char * | eventName | ) |
Removes an event.
void EventManager::unregisterAllEvents | ( | ) |
Removes all events.
bool EventManager::postEvent | ( | const char * | eventName, | |
const char * | data | |||
) |
Triggers an event.
bool EventManager::subscribe | ( | SimObject * | callbackObj, | |
const char * | event, | |||
const char * | callback = NULL | |||
) |
Adds a subscription to an event.
Remove a subscriber from an event.
void EventManager::dumpEvents | ( | ) |
Prints all registered events to the console.
void EventManager::dumpSubscribers | ( | ) |
Prints all subscribers to the console.
void EventManager::dumpSubscribers | ( | const char * | event | ) |
Prints subscribers to a specific event to the console.
static void EventManager::addEventManager | ( | EventManager * | em | ) | [inline, static] |
Adds an EventManager.
static void EventManager::removeEventManager | ( | EventManager * | em | ) | [inline, static] |
Removes an EventManager.
static EventManager* EventManager::getEventManager | ( | const char * | name | ) | [inline, static] |
Retrieves an EventManager.
static void EventManager::printEventManagers | ( | ) | [inline, static] |
Prints all the EventManagers to the console.
StringTableEntry EventManager::mQueue [private] |
The name of the message queue.
Vector<StringTableEntry> EventManager::mEvents [private] |
Registered events.
EventManagerListener EventManager::mListener [private] |
The event listener. Listens for all events and dispatches them to the appropriate subscribers.
Vector<EventManager*> EventManager::smEventManagers [static, private] |
List of all EventManagers.