CrystalSpace

Public API Reference

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

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. More...

virtual ~csEventQueue ()
 Destroy an event queue object. More...

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

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

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

virtual void RemoveListener (iEventHandler *)
 Unregister a listener. More...

virtual void RemoveAllListeners ()
 Unregister all listeners. More...

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

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

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

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

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

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

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

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

virtual void Clear ()
 Clear event queue. More...

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


Friends

class csEventOutlet
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.

The implemented event queue is limited thread-safe. There are some primitive spinlocks acquired/released in critical sections.

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 182 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.

\copydoc iEventQueue::RemoveAllListeners()

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.14