Dispatcher::IMessageListener Class Reference [Message System]

#include <dispatcher.h>

Inheritance diagram for Dispatcher::IMessageListener:

Inheritance graph
[legend]
List of all members.

Detailed Description

Listener interface for objects that receive messages.

See also:
ScriptMsgListener


Public Member Functions

virtual ~IMessageListener ()
virtual bool onMessageReceived (StringTableEntry queue, const char *msg, const char *data)=0
 Callback for when messages are received.
virtual bool onMessageObjectReceived (StringTableEntry queue, Message *msg)=0
 Callback for when message objects are received.
virtual void onAddToQueue (StringTableEntry queue)
 Callback for when the listener is added to a queue.
virtual void onRemoveFromQueue (StringTableEntry queue)
 Callback for when the listener is removed from a queue.

Protected Attributes

Vector< StringTableEntrymQueues
 List of queues this listener is registered with.


Constructor & Destructor Documentation

virtual Dispatcher::IMessageListener::~IMessageListener (  )  [virtual]


Member Function Documentation

virtual bool Dispatcher::IMessageListener::onMessageReceived ( StringTableEntry  queue,
const char *  msg,
const char *  data 
) [pure virtual]

Callback for when messages are received.

Parameters:
queue The name of the queue the message was dispatched to
msg The type of message
data The data for the message
Returns:
false to prevent other listeners receiving this message, true otherwise
See also:
onMessageObjectReceived()

Implemented in PopupMenu, EventManagerListener, MessageForwarder, and ScriptMsgListener.

virtual bool Dispatcher::IMessageListener::onMessageObjectReceived ( StringTableEntry  queue,
Message msg 
) [pure virtual]

Callback for when message objects are received.

Parameters:
queue The name of the queue the message was dispatched to
msg The message object
Returns:
false to prevent other listeners receiving this message, true otherwise
See also:
onMessageReceived()

Implemented in PopupMenu, EventManagerListener, MessageForwarder, and ScriptMsgListener.

virtual void Dispatcher::IMessageListener::onAddToQueue ( StringTableEntry  queue  )  [virtual]

Callback for when the listener is added to a queue.

The default implementation of onAddToQueue() and onRemoveFromQueue() provide tracking of the queues this listener is added to through the mQueues member. Overrides of onAddToQueue() or onRemoveFromQueue() should ensure they call the parent implementation in any overrides.

Parameters:
queue The name of the queue that the listener added to
See also:
onRemoveFromQueue()

Reimplemented in ScriptMsgListener.

virtual void Dispatcher::IMessageListener::onRemoveFromQueue ( StringTableEntry  queue  )  [virtual]

Callback for when the listener is removed from a queue.

The default implementation of onAddToQueue() and onRemoveFromQueue() provide tracking of the queues this listener is added to through the mQueues member. Overrides of onAddToQueue() or onRemoveFromQueue() should ensure they call the parent implementation in any overrides.

Parameters:
queue The name of the queue the listener was removed from
See also:
onAddToQueue()

Reimplemented in ScriptMsgListener.


Member Data Documentation

List of queues this listener is registered with.