Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GMessageQueue Class Reference

Facilitates the distribution of messages. More...

#include <gauge3d/input/messagequeue.h>

Inherits GAUGE3D::GObject.

List of all members.

Public Types

typedef GSmartPointer<HandlerpHandler

Public Methods

 GMessageQueue ()
 ~GMessageQueue ()
void EnqueueMessage (pGMessage message)
 Enqueue a message.

void DispatchMessage (pGMessage message)
 Immediately dispatch a message, bypassing the queue.

void DiscardMessages ()
 Discard all enqueued messages.

void AddHandler (pHandler handler,float priority=0.5)
 Add a handler to the list of handlers. More...

void RemoveHandler (pHandler handler)
 Remove a message handler from the list.

void ClearHandlers ()
 Remove all handlers from the message handler list.

virtual void DoFrame (tTime time,tTime frametime)
 Dispatch all enqueued messages that have not been sent. Will be called automatically. More...


Detailed Description

Facilitates the distribution of messages.

This class queues and distributes messages. First, you give it pointers to one or more message handlers. When a message is ready to be dispatched, it will be sent to each handler one by one until one of the handlers reports that it has handled the message.


Member Function Documentation

void GAUGE3D::GMessageQueue::AddHandler ( pHandler handler,
float priority = 0.5 )
 

Add a handler to the list of handlers.

Parameters:
handler   A pointer to a Handler to add.
priority   A priority for the handler, between 0.0 and 1.0. This determines the order in which the handlers will be called. Lower numbers will be called first. Do not set this to exactly 0.0 or 1.0 unless you are doing something special (like creating an input filter).
Remarks:
You could have a handler that acts as an input filter by giving it a priority of 0.0. Have the handler return true if the message should be ignored. Since the priority is 0.0, it will always be called first, and if it returns true, no other handlers will be called.

void GAUGE3D::GMessageQueue::DoFrame ( tTime time,
tTime frametime ) [virtual]
 

Dispatch all enqueued messages that have not been sent. Will be called automatically.

Remarks:
You can pretend this function does not exist if you want. You should never call it yourself.

Reimplemented from GAUGE3D::GObject.


The documentation for this class was generated from the following file:
Generated at Tue Jan 30 17:07:34 2001 for gauge3d by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000