Dispatcher

Engine/source/util/messaging/dispatcher.cpp

Namespace for the message dispatcher functions.

More...

Classes:

class

Listener interface for objects that receive messages.

class

Internal class for tracking message queues.

Message Queue Management

bool
isQueueRegistered(const char * name)

Check if a message queue is registered.

Register a message queue.

const char *

Register an anonymous message queue.

Unregister a message queue.

bool

Register a listener with a queue to receive messages.

Unregister a listener with a queue.

Message Dispatcher

bool
dispatchMessage(const char * queue, const char * msg, const char * data)

Dispatch a message to a queue.

bool
dispatchMessageObject(const char * queue, Message * msg)

Dispatch a message object to a queue.

Internal Functions

getMessageQueue(const char * name)

Internal function: obtain message queue.

bool

Internal function: Lock the dispatcher mutex.

Internal function: Unlock the dispatcher mutex.

Detailed Description

Namespace for the message dispatcher functions.

Message Queue Management

isQueueRegistered(const char * name)

Check if a message queue is registered.

Parameters:

name

The name of the message queue

return:

true if the queue is registered, false otherwise

registerMessageQueue(const char * name)

Register a message queue.

Parameters:

name

The name of the message queue to register

registerAnonMessageQueue()

Register an anonymous message queue.

return:

name of anonymous message queue for passing to other functions

unregisterMessageQueue(const char * name)

Unregister a message queue.

Parameters:

name

The name of the message queue

registerMessageListener(const char * queue, IMessageListener * listener)

Register a listener with a queue to receive messages.

Parameters:

queue

The name of the queue to register the listener with

listener

The listener interface that receives messages

return:

true for success, false otherwise

unregisterMessageListener(const char * queue, IMessageListener * listener)

Unregister a listener with a queue.

Parameters:

queue

The name of the queue to unregister the listener

listener

The listener interface that was passed to registerMessageListener()

Message Dispatcher

dispatchMessage(const char * queue, const char * msg, const char * data)

Dispatch a message to a queue.

Parameters:

queue

Queue to dispatch the message to

msg

Message to dispatch

data

Data for message

return:

true for success, false for failure

dispatchMessageObject(const char * queue, Message * msg)

Dispatch a message object to a queue.

Parameters:

queue

Queue to dispatch the message to

msg

Message to dispatch

return:

true for success, false for failure

Internal Functions

getMessageQueue(const char * name)

Internal function: obtain message queue.

Dispatcher mutex must be locked.

Parameters:

name

Name of the queue

return:

Message queue

lockDispatcherMutex()

Internal function: Lock the dispatcher mutex.

return:

true for success, false for failure

unlockDispatcherMutex()

Internal function: Unlock the dispatcher mutex.

Public Functions

_dispatcherGetGDispatchData()