CrystalSpace

Public API Reference

csEventTree Class Reference

This class is used to represent the event namespace (tree). More...

#include <csutil/cssubscription.h>

Inheritance diagram for csEventTree:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void Dispatch (iEvent &e)
 Send the provided event to all subscribers, using the normal return and Broadcast rules.
csEventTreeFindNode (csEventID name, csEventQueue *q)
 Find a node with a given name in the event tree owned by q .
SubscriberIteratorGetIterator ()
 Return a csEventTree::SubscriberIterator for all subscribers to this event name (and to its parents).
void Notify ()
 Send the provided event to all subscribers, regardless of their return values.
bool Subscribe (csHandlerID, csEventID, csEventQueue *q)
 Subscribe a given handler to a given event name subtree via a given event queue.
void Unsubscribe (csHandlerID, csEventID, csEventQueue *q)
 Unubscribe a given handler to a given event name subtree via a given event queue.

Static Public Member Functions

static csEventTreeCreateRootNode (csRef< iEventHandlerRegistry > &reg1, csRef< iEventNameRegistry > &reg2, csEventQueue *q)
static void DeleteRootNode (csEventTree *node)

Friends

class csEventQueueTest
class SubscriberIterator

Classes

class  SubscriberIterator
 The SubscriberIterator is a wrapper for the messy internals of figuring out which event handler to call next. More...

Detailed Description

This class is used to represent the event namespace (tree).

Each node represents an event name (e.g., "crystalspace.input.mouse") and contains two data structures: a partial order graph representing subscribers to this event (including those who subscribed to parent event names) along with their ordering constraints, and a queue of subscribers representing a valid total order of that graph (used to speed up the common case).

Definition at line 41 of file cssubscription.h.


Member Function Documentation

void csEventTree::Dispatch ( iEvent e  ) 

Send the provided event to all subscribers, using the normal return and Broadcast rules.

csEventTree* csEventTree::FindNode ( csEventID  name,
csEventQueue q 
)

Find a node with a given name in the event tree owned by q .

If no such node yet exists, create it (along with any necessary parent nodes, including the name root).

SubscriberIterator* csEventTree::GetIterator (  ) 

Return a csEventTree::SubscriberIterator for all subscribers to this event name (and to its parents).

void csEventTree::Notify (  ) 

Send the provided event to all subscribers, regardless of their return values.

bool csEventTree::Subscribe ( csHandlerID  ,
csEventID  ,
csEventQueue q 
)

Subscribe a given handler to a given event name subtree via a given event queue.

This is wrapped by csEventQueue::Subscribe which may be easier to use in some situations.

See also:
csEventQueue::Subscribe

void csEventTree::Unsubscribe ( csHandlerID  ,
csEventID  ,
csEventQueue q 
)

Unubscribe a given handler to a given event name subtree via a given event queue.

This is wrapped by csEventQueue::Unsubscribe which may be easier to use in some situations. Note that unsubscribing is reentrant (an event handler can unsubscribe itself) but NOT thread-safe (only event handlers in the same thread as the event queue can unsubscribe).

See also:
csEventQueue::Unsubscribe


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.4.7