CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csEventQueue Class Reference

This class represents a general event queue. More...

#include <cseventq.h>

Inheritance diagram for csEventQueue:

iEventQueue iBase List of all members.

Public Methods

 csEventQueue (iObjectRegistry *, size_t iLength=DEF_EVENT_QUEUE_LENGTH)
 Initialize the event queue.

virtual ~csEventQueue ()
 Destroy an event queue object.

virtual void Process ()
 Process the event queue. Calls Dispatch () once for each contained event.

virtual void Dispatch (iEvent &)
 Dispatch a single event from the queue; normally called by Process ().

virtual void RegisterListener (iEventHandler *, unsigned int trigger)
 Register a listener for specific events.

virtual void RemoveListener (iEventHandler *)
 Unregister a listener.

virtual void RemoveAllListeners ()
 Unregister all listeners.

virtual void ChangeListenerTrigger (iEventHandler *, unsigned int trigger)
 Change a listener's trigger.

virtual csPtr< iEventOutletCreateEventOutlet (iEventPlug *)
 Register an event plug and return a new outlet.

virtual iEventOutletGetEventOutlet ()
 Get a public event outlet for posting just an event.

virtual iEventCordGetEventCord (int Category, int Subcategory)
 Get the event cord for a given category and subcategory.

uint32 CountPool ()
 Get a count of events in the pool, for testing only.

virtual csPtr< iEventCreateEvent (uint8 type)
 Grab an event from the pool or make a new one if it's empty.

virtual void Post (iEvent *)
 Place an event into queue.

virtual csPtr< iEventGet ()
 Get next event from queue or a null references if no event.

virtual void Clear ()
 Clear event queue.

virtual bool IsEmpty ()
 Query if queue is empty (@ Not thread safe!).


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 50 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::ChangeListenerTrigger iEventHandler  ,
unsigned int    trigger
[virtual]
 

Change a listener's trigger.

Implements iEventQueue.

virtual void csEventQueue::Clear   [virtual]
 

Clear event queue.

Implements iEventQueue.

uint32 csEventQueue::CountPool  
 

Get a count of events in the pool, for testing only.

virtual csPtr<iEvent> csEventQueue::CreateEvent uint8    type [virtual]
 

Grab an event from the pool or make a new one if it's empty.

Implements iEventQueue.

virtual csPtr<iEventOutlet> csEventQueue::CreateEventOutlet iEventPlug   [virtual]
 

Register an event plug and return a new outlet.

Implements iEventQueue.

virtual void csEventQueue::Dispatch iEvent   [virtual]
 

Dispatch a single event from the queue; normally called by Process ().

Implements iEventQueue.

virtual csPtr<iEvent> csEventQueue::Get   [virtual]
 

Get next event from queue or a null references if no event.

Implements iEventQueue.

virtual iEventCord* csEventQueue::GetEventCord int    Category,
int    Subcategory
[virtual]
 

Get the event cord for a given category and subcategory.

Implements iEventQueue.

virtual iEventOutlet* csEventQueue::GetEventOutlet   [virtual]
 

Get a public event outlet for posting just an event.

Implements iEventQueue.

virtual bool csEventQueue::IsEmpty   [inline, virtual]
 

Query if queue is empty (@ Not thread safe!).

@

Implements iEventQueue.

Definition at line 155 of file cseventq.h.

virtual void csEventQueue::Post iEvent   [virtual]
 

Place an event into queue.

Implements iEventQueue.

virtual void csEventQueue::Process   [virtual]
 

Process the event queue. Calls Dispatch () once for each contained event.

Implements iEventQueue.

virtual void csEventQueue::RegisterListener iEventHandler  ,
unsigned int    trigger
[virtual]
 

Register a listener for specific events.

Implements iEventQueue.

virtual void csEventQueue::RemoveAllListeners   [virtual]
 

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. ()

Implements iEventQueue.

virtual void csEventQueue::RemoveListener iEventHandler   [virtual]
 

Unregister a listener.

Implements iEventQueue.


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