OpenGLPrakt --> events --> cEventDispatcher

class cEventDispatcher

The event dispatching class.

This is the core of the event system.

There should usually be no need to derive from this class.

Take care to destroy all cEventProducer's before destroying this class! They've got no way to know whether the dispatcher they want to send their events to has been destroyed.

Source:
../src/cEventDispatcher.hh:34

See Also:
cEventProducer

Constructors Index

cEventDispatcher
[public] default constructor
~cEventDispatcher
[public] destructor


Typedefs Index

tRegisteredEvents
[protected]


Variables Index

mRegisteredEvents
[protected]


Methods Index

DisplayRegistered
[public] for debugging purposes only: display list of registered events
SendEvent
[public] send an event
SubscribeToEvent
[public] register an event consumer for receiving of an event
UnregisterConsumer
[public] unregister a whole consumer
UnsubscribeFromEvent
[public] unregister an event consumer for receiving of an event


Constructors

cEventDispatcher

public cEventDispatcher ( ) ;

default constructor

cEventDispatcher

public virtual ~ cEventDispatcher ( ) ;

destructor


Typedefs

tRegisteredEvents

protected typedef multimap < const cStorableEvent , cEventConsumer * > tRegisteredEvents ;


Variables

mRegisteredEvents

protected tRegisteredEvents mRegisteredEvents


Methods

SubscribeToEvent

public virtual void SubscribeToEvent ( const cEvent & event ,
                                       cEventConsumer * consumer ) ;

register an event consumer for receiving of an event

Parameters:
event a "template" of an cEvent to receive
consumer the cEventConsumer to call upon receiption of the event

UnsubscribeFromEvent

public virtual void UnsubscribeFromEvent ( const cEvent & event ,
                                           cEventConsumer * consumer ) ;

unregister an event consumer for receiving of an event

Parameters:
event a "template" of an cEvent
consumer the cEventConsumer to deregister from receiption of events of type event.

UnregisterConsumer

public virtual void UnregisterConsumer ( const cEventConsumer * consumer ) ;

unregister a whole consumer

Delete all subscriptions of this consumer (e.g. because it has been destroyed).

Parameters:
consumer cEventConsumer to unregister

SendEvent

public virtual void SendEvent ( const cEvent & event ,
                                bool global = false ) ;

send an event

The event is sent to all subscribers of this event type until one accepts it.

Parameters:
event cEvent (or descendant) to send
global is this a global event? - Send it until someone accepts it or send it to everyone who's subscribed? (optional, default: non-global)

DisplayRegistered

public void DisplayRegistered ( ) ;

for debugging purposes only: display list of registered events

sends the list of registered events to cout


This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.

Click here to return to the top of the page.