Torque3D Documentation / _generateds / Dispatcher::IMessageListener

Dispatcher::IMessageListener

Engine/source/util/messaging/dispatcher.h

Listener interface for objects that receive messages.

More...

Protected Attributes

List of queues this listener is registered with.

Public Functions

Callback for when the listener is added to a queue.

bool

Callback for when message objects are received.

bool
onMessageReceived(StringTableEntry queue, const char * msg, const char * data)

Callback for when messages are received.

Callback for when the listener is removed from a queue.

Detailed Description

Listener interface for objects that receive messages.

Protected Attributes

Vector< StringTableEntry > mQueues 

List of queues this listener is registered with.

Public Functions

~IMessageListener()

onAddToQueue(StringTableEntry queue)

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

Reimplemented by: ScriptMsgListener

onMessageObjectReceived(StringTableEntry queue, Message * msg)

Callback for when message objects are received.

Parameters:

queue

The name of the queue the message was dispatched to

msg

The message object

return:

false to prevent other listeners receiving this message, true otherwise

Reimplemented by: PopupMenu, EventManagerListener, MessageForwarder, ScriptMsgListener

onMessageReceived(StringTableEntry queue, const char * msg, const char * data)

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

return:

false to prevent other listeners receiving this message, true otherwise

Reimplemented by: PopupMenu, EventManagerListener, MessageForwarder, ScriptMsgListener

onRemoveFromQueue(StringTableEntry queue)

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

Reimplemented by: ScriptMsgListener