gloox  1.0.1
Public Member Functions | List of all members
EventDispatcher Class Reference

#include <eventdispatcher.h>

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@ca.nosp@m.maya.nosp@m..net
Since
1.0

Definition at line 33 of file eventdispatcher.h.

Constructor & Destructor Documentation

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,
const std::string &  context,
bool  remove 
)

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

Parameters
eventThe Event to dispatch.
contextAn identifier that limits the EventHandlers that will get notified to those that are specifically interested in this context.
removeWhether 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 dispatch ( const Event event)

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

Parameters
eventThe event to dispatch.

Definition at line 43 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
ehThe EventHandler to register.
contextThe context to register the EventHandler for.

Definition at line 53 of file eventdispatcher.cpp.

void removeEventHandler ( EventHandler eh)

Removes the given EventHandler.

Parameters
ehThe EventHandler to remove.

Definition at line 61 of file eventdispatcher.cpp.


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