EventDispatcher Class Reference

An Event dispatcher. More...

#include <eventdispatcher.h>

List of all members.

Public Member Functions

 EventDispatcher ()
virtual ~EventDispatcher ()
void dispatch (const Event &event, const std::string &context, bool remove)
void dispatch (const Event &event)
void registerEventHandler (EventHandler *eh, const std::string &context)
void removeEventHandler (EventHandler *eh)

Detailed Description

An Event dispatcher.

Author:
Jakob Schroeter <js@camaya.net>
Since:
1.0

Definition at line 33 of file eventdispatcher.h.


Constructor & Destructor Documentation

EventDispatcher (  ) 

Creates a new EventDispatcher object. You should not need to use this class directly.

Definition at line 20 of file eventdispatcher.cpp.

~EventDispatcher (  )  [virtual]

Virtual Destructor.

Definition at line 24 of file eventdispatcher.cpp.


Member Function Documentation

void dispatch ( const Event event  ) 

Looks for handlers for the given Event, identified by its type.

Parameters:
event The event to dispatch.

Definition at line 43 of file eventdispatcher.cpp.

void dispatch ( const Event event,
const std::string &  context,
bool  remove 
)

Looks for handlers for the given Event, and removes the handlers if requested.

Parameters:
event The Event to dispatch.
context An identifier that limits the EventHandlers that will get notified to those that are specifically interested in this context.
remove Whether or not to remove the context from the list of known contexts. Useful for IQ IDs.

Definition at line 28 of file eventdispatcher.cpp.

void registerEventHandler ( EventHandler eh,
const std::string &  context 
)

Registers the given EventHandler to be notified about Events with the given context. The context will usually be an IQ ID.

Parameters:
eh The EventHandler to register.
context The context to register the EventHandler for.

Definition at line 53 of file eventdispatcher.cpp.

void removeEventHandler ( EventHandler eh  ) 

Removes the given EventHandler.

Parameters:
eh The EventHandler to remove.

Definition at line 61 of file eventdispatcher.cpp.


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2