ScriptMsgListener
Engine/source/util/messaging/scriptMsgListener.h
Script accessible version of Dispatcher::IMessageListener.
Private Types
IMLParent
Parent
Public Functions
DECLARE_CALLBACK(bool , onMessageObjectReceived , (const char *queue, Message *msg) )
DECLARE_CALLBACK(bool , onMessageReceived , (const char *queue, const char *event, const char *data) )
DECLARE_CALLBACK(void , onAdd , () )
DECLARE_CALLBACK(void , onAddToQueue , (const char *queue) )
DECLARE_CALLBACK(void , onRemove , () )
DECLARE_CALLBACK(void , onRemoveFromQueue , (const char *queue) )
bool
onAdd()
Called when the object is added to the sim.
onAddToQueue(StringTableEntry queue)
Callback for when the listener is added to a queue.
bool
onMessageObjectReceived(StringTableEntry queue, Message * msg)
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
Script accessible version of Dispatcher::IMessageListener.
The main use of ScriptMsgListener is to allow script to listen for messages. You can subclass ScriptMsgListener in script to receive the Dispatcher::IMessageListener callbacks.
Alternatively, you can derive from it in C++ instead of SimObject to get an object that implements Dispatcher::IMessageListener with script callbacks. If you need to derive from something other then SimObject, then you will need to implement the Dispatcher::IMessageListener interface yourself.
Private Types
typedef Dispatcher::IMessageListener IMLParent
typedef SimObject Parent
Public Functions
ScriptMsgListener()
DECLARE_CALLBACK(bool , onMessageObjectReceived , (const char *queue, Message *msg) )
DECLARE_CALLBACK(bool , onMessageReceived , (const char *queue, const char *event, const char *data) )
DECLARE_CALLBACK(void , onAdd , () )
DECLARE_CALLBACK(void , onAddToQueue , (const char *queue) )
DECLARE_CALLBACK(void , onRemove , () )
DECLARE_CALLBACK(void , onRemoveFromQueue , (const char *queue) )
DECLARE_CONOBJECT(ScriptMsgListener )
onAdd()
Reimplemented from: SimObject
onAddToQueue(StringTableEntry queue)
Reimplemented from: Dispatcher::IMessageListener
onMessageObjectReceived(StringTableEntry queue, Message * msg)
Reimplemented from: Dispatcher::IMessageListener
Reimplemented by: MessageForwarder
onMessageReceived(StringTableEntry queue, const char * msg, const char * data)
Reimplemented from: Dispatcher::IMessageListener
Reimplemented by: MessageForwarder
onRemove()
Reimplemented from: SimObject
onRemoveFromQueue(StringTableEntry queue)
Reimplemented from: Dispatcher::IMessageListener