csEventTree Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions
csEventTree Class Reference

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

`#include <csutil/cssubscription.h>`

Inheritance diagram for csEventTree:

List of all members.

## Classes
class | SubscriberIterator
| The SubscriberIterator is a wrapper for the messy internals of figuring out which event handler to call next. More...
## Public Member Functions
void | Dispatch (iEvent &e)
| Send the provided event to all subscribers, using the normal return and Broadcast rules.
csEventTree * | FindNode (csEventID name, csEventQueue *q)
| Find a node with a given name in the event tree owned by q .
SubscriberIterator * | GetIterator ()
| 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.

## 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:

- csutil/cssubscription.h