csEventQueue Class Reference
This class represents a general event queue. More...
#include <csutil/cseventq.h>
Inherits scfImplementation1<csEventQueue, iEventQueue>.
Classes | |
struct | iTypedFrameEventDispatcher |
As a transitional measure, the csevPreProcess, csevProcess, csevPostProcess and csevFinalProcess events are actually sub-events dispatched by a csevFrame handler. More... | |
Public Member Functions | |
virtual void | Clear () |
Clear event queue. | |
uint32 | CountPool () |
Get a count of events in the pool, for testing only. | |
virtual csPtr< iEvent > | CreateEvent () |
Grab an event from the pool or make a new one if it's empty. | |
virtual csPtr< iEventOutlet > | CreateEventOutlet (iEventPlug *) |
Register an event plug and return a new outlet. | |
csEventQueue (iObjectRegistry *, size_t iLength=DEF_EVENT_QUEUE_LENGTH) | |
Initialize the event queue. | |
virtual void | Dispatch (iEvent &) |
Dispatch a single event from the queue; normally called by Process (). | |
virtual csPtr< iEvent > | Get () |
Get next event from queue or a null references if no event. | |
virtual iEventCord * | GetEventCord (const csEventID &) |
Get the event cord for a given category and subcategory. | |
virtual iEventOutlet * | GetEventOutlet () |
Get a public event outlet for posting just an event. | |
virtual bool | IsEmpty () |
Query if queue is empty (@@ Not thread safe!). | |
virtual void | Post (iEvent *) |
Place an event into queue. | |
virtual void | Process () |
Process the event queue. Calls Dispatch () once for each contained event. | |
virtual csHandlerID | RegisterListener (iEventHandler *handler, const csEventID events[]) |
Shorthand for RegisterListener() followed by Subscribe(). | |
virtual csHandlerID | RegisterListener (iEventHandler *handler, const csEventID &event) |
Shorthand for RegisterListener() followed by Subscribe(). | |
virtual csHandlerID | RegisterListener (iEventHandler *) |
Make the event scheduler subsystem aware of an event handler. | |
virtual void | RemoveAllListeners () |
Remove all listeners from the queue. | |
virtual void | RemoveListener (iEventHandler *) |
Remove a given listener from the event queue. | |
virtual bool | Subscribe (iEventHandler *, const csEventID[]) |
Subscribe a listener to a set of event subtrees. | |
virtual bool | Subscribe (iEventHandler *, const csEventID &) |
Subscribe a listener to an event subtree. | |
virtual void | Unsubscribe (iEventHandler *, const csEventID[]) |
Unsubscribe a listener from a set of event subtrees. | |
virtual void | Unsubscribe (iEventHandler *, const csEventID &) |
Unsubscribe a listener from an event subtree. | |
virtual | ~csEventQueue () |
Destroy an event queue object. | |
Friends | |
class | csEventOutlet |
class | csEventTree |
class | csPoolEvent |
Detailed Description
This class represents a general event queue.See the documentation of iEventQueue for a detailed description of each method. One instance of this class is usually shared via iObjectRegistry. Event queues are thread-safe.
Definition at line 67 of file cseventq.h.
Constructor & Destructor Documentation
csEventQueue::csEventQueue | ( | iObjectRegistry * | , | |
size_t | iLength = DEF_EVENT_QUEUE_LENGTH | |||
) |
Initialize the event queue.
virtual csEventQueue::~csEventQueue | ( | ) | [virtual] |
Destroy an event queue object.
Member Function Documentation
virtual void csEventQueue::Clear | ( | ) | [virtual] |
Clear event queue.
uint32 csEventQueue::CountPool | ( | ) |
Get a count of events in the pool, for testing only.
Grab an event from the pool or make a new one if it's empty.
virtual csPtr<iEventOutlet> csEventQueue::CreateEventOutlet | ( | iEventPlug * | ) | [virtual] |
Register an event plug and return a new outlet.
virtual void csEventQueue::Dispatch | ( | iEvent & | ) | [virtual] |
Dispatch a single event from the queue; normally called by Process ().
Get next event from queue or a null references if no event.
virtual iEventCord* csEventQueue::GetEventCord | ( | const csEventID & | ) | [virtual] |
Get the event cord for a given category and subcategory.
virtual iEventOutlet* csEventQueue::GetEventOutlet | ( | ) | [virtual] |
Get a public event outlet for posting just an event.
virtual bool csEventQueue::IsEmpty | ( | ) | [inline, virtual] |
virtual void csEventQueue::Post | ( | iEvent * | ) | [virtual] |
Place an event into queue.
virtual void csEventQueue::Process | ( | ) | [virtual] |
Process the event queue. Calls Dispatch () once for each contained event.
virtual csHandlerID csEventQueue::RegisterListener | ( | iEventHandler * | handler, | |
const csEventID | events[] | |||
) | [inline, virtual] |
Shorthand for RegisterListener() followed by Subscribe().
Definition at line 145 of file cseventq.h.
virtual csHandlerID csEventQueue::RegisterListener | ( | iEventHandler * | handler, | |
const csEventID & | event | |||
) | [inline, virtual] |
Shorthand for RegisterListener() followed by Subscribe().
Definition at line 131 of file cseventq.h.
virtual csHandlerID csEventQueue::RegisterListener | ( | iEventHandler * | ) | [virtual] |
Make the event scheduler subsystem aware of an event handler.
virtual void csEventQueue::RemoveAllListeners | ( | ) | [virtual] |
Remove all listeners from the queue.
Unregister all listeners.
- Remarks:
- This function is used to clear all listeners from the event queue stack. You should only call this function at the end of your program after the event queue processing has terminated.
- If you make use of csInitializer::DestroyApplication(), this is done for you by that call.
virtual void csEventQueue::RemoveListener | ( | iEventHandler * | ) | [virtual] |
Remove a given listener from the event queue.
Removes all subscriptions. It is VERY important that this be called before deleting the event handler!
virtual bool csEventQueue::Subscribe | ( | iEventHandler * | , | |
const | csEventID[] | |||
) | [virtual] |
Subscribe a listener to a set of event subtrees.
The event subtrees should be disjoint, i.e., no event name should be a prefix of another.
- See also:
- csEventTree::Subscribe
virtual bool csEventQueue::Subscribe | ( | iEventHandler * | , | |
const csEventID & | ||||
) | [virtual] |
Subscribe a listener to an event subtree.
Thinly wraps csEventTree::Subscribe
- See also:
- csEventTree::Subscribe
virtual void csEventQueue::Unsubscribe | ( | iEventHandler * | , | |
const | csEventID[] | |||
) | [virtual] |
virtual void csEventQueue::Unsubscribe | ( | iEventHandler * | , | |
const csEventID & | ||||
) | [virtual] |
Unsubscribe a listener from an event subtree.
Thinly wraps csEventTree::Unsubscribe
- See also:
- csEventTree::Unsubscribe
The documentation for this class was generated from the following file:
- csutil/cseventq.h
Generated for Crystal Space 1.4.0 by doxygen 1.5.8