MessageDispatcher Class Reference

#include <MessageDispatcher.h>

Inheritance diagram for MessageDispatcher:
Object

# Public Member Functions

void setClock (Clock clock)
bool dispatchDelayedMessages ()
 Dispatch the delayed messages whose delay has expired.
bool discardDelayedMessagesWithClock (Clock clock)

# Static Public Member Functions

static bool dispatchMessage (uint32 delay, ListenerObject sender, ListenerObject receiver, int32 message, void *extraInfo)
static bool discardDelayedMessagesFromSender (ListenerObject sender, int32 message)
static bool discardDelayedMessagesForReceiver (ListenerObject receiver, int32 message)
static bool discardAllDelayedMessagesFromSender (ListenerObject sender)
static bool discardAllDelayedMessagesForReceiver (ListenerObject receiver)
static bool discardAllDelayedMessages (ListenerObject listenerObject)
static void print (int32 x, int32 y)
static void printAllDelayedMessagesFromSender (ListenerObject sender, int16 x, int16 y)

# Protected Attributes

Clock clock
 Clock to use for delayed messages.
VirtualList delayedMessages
 Linked list of queued messages to be dispatched.
Telegram helperTelegram
 Telegram used when there is no stacking of telegrams.
bool helperTelegramIsInUse
 Flag that indicates the usage state of the helper telegram.

# Additional Inherited Members

- Private Member Functions inherited from Object
void constructor ()
 Class' constructor.
const void * getVTable ()
bool mutateTo (const void *targetClass)
- Static Private Member Functions inherited from Object
static Object getCast (void *object, ClassPointer targetClassGetClassMethod, ClassPointer baseClassGetClassMethod)
- Private Attributes inherited from Object
void * vTable
 Pointer to the class's virtual table.

# Detailed Description

Class MessageDispatcher

Inherits from Object

Implements a dispatcher central of message codes wrapped in a Telegram.

Definition at line 57 of file MessageDispatcher.h.

# Member Function Documentation

# discardAllDelayedMessages()

static bool MessageDispatcher::discardAllDelayedMessages ( ListenerObject listenerObject)
static

Discard all delayed messages sent to an object.

Parameters
listenerObjectObject that the messages were originally sent to or sent by

Definition at line 210 of file MessageDispatcher.c.

# discardAllDelayedMessagesForReceiver()

static bool MessageDispatcher::discardAllDelayedMessagesForReceiver ( ListenerObject receiver)
static

Discard all delayed messages sent to an object.

Parameters
receiverObject that was the target of the message
Returns
True if any messages is discarded

Definition at line 182 of file MessageDispatcher.c.

# discardAllDelayedMessagesFromSender()

static bool MessageDispatcher::discardAllDelayedMessagesFromSender ( ListenerObject sender)
static

Discard all delayed messages sent by an object.

Parameters
senderObject that was the target of the message
Returns
True if any messages is discarded

Definition at line 154 of file MessageDispatcher.c.

# discardDelayedMessagesForReceiver()

static bool MessageDispatcher::discardDelayedMessagesForReceiver ( ListenerObject receiver,
int32 message )
static

Discard delayed messages sent to an object.

Parameters
receiverObject that was the target of the message
messageMessage's code
Returns
True if any messages is discarded

Definition at line 126 of file MessageDispatcher.c.

# discardDelayedMessagesFromSender()

static bool MessageDispatcher::discardDelayedMessagesFromSender ( ListenerObject sender,
int32 message )
static

Discard delayed messages sent by an object.

Parameters
senderObject that originally sent the message
messageMessage's code
Returns
True if any messages is discarded

Definition at line 98 of file MessageDispatcher.c.

# discardDelayedMessagesWithClock()

secure bool MessageDispatcher::discardDelayedMessagesWithClock ( Clock clock)

Discarde delayed messages associated to the given clock.

Parameters
clockClock to search in delayed messages to discard
Returns
True if any messages is discarded

Definition at line 380 of file MessageDispatcher.c.

# dispatchDelayedMessages()

secure bool MessageDispatcher::dispatchDelayedMessages ( )

Dispatch the delayed messages whose delay has expired.

Definition at line 294 of file MessageDispatcher.c.

# dispatchMessage()

static bool MessageDispatcher::dispatchMessage ( uint32 delay,
ListenerObject sender,
ListenerObject receiver,
int32 message,
void * extraInfo )
static

Dispatch a message

Parameters
delayMilliseconds to wait before dispatching the message
senderObject that sends the message
receiverObject that receives the message
messageMessage's code
extraInfoPointer to any extra data that must accompany the message
Returns
Boolean indicating the status of the processing of the message if immediately dispatched

Definition at line 38 of file MessageDispatcher.c.

# print()

static void MessageDispatcher::print ( int32 x,
int32 y )
static

Print all delayed messages sent by an object.

Parameters
xScreen x coordinate where to print
yScreen y coordinate where to print

Definition at line 239 of file MessageDispatcher.c.

# printAllDelayedMessagesFromSender()

static void MessageDispatcher::printAllDelayedMessagesFromSender ( ListenerObject sender,
int16 x,
int16 y )
static

Print all delayed messages sent by an object.

Parameters
senderObject that originally sent the message
xScreen x coordinate where to print
yScreen y coordinate where to print

Definition at line 252 of file MessageDispatcher.c.

# setClock()

secure void MessageDispatcher::setClock ( Clock clock)

Set the clock to use for new delayed messages.

Parameters
clockClock to use

Definition at line 287 of file MessageDispatcher.c.

# Member Data Documentation

# clock

Clock MessageDispatcher::clock
protected

Clock to use for delayed messages.

Definition at line 62 of file MessageDispatcher.h.

# delayedMessages

VirtualList MessageDispatcher::delayedMessages
protected

Linked list of queued messages to be dispatched.

Definition at line 65 of file MessageDispatcher.h.

# helperTelegram

Telegram MessageDispatcher::helperTelegram
protected

Telegram used when there is no stacking of telegrams.

Definition at line 68 of file MessageDispatcher.h.

# helperTelegramIsInUse

bool MessageDispatcher::helperTelegramIsInUse
protected

Flag that indicates the usage state of the helper telegram.

Definition at line 71 of file MessageDispatcher.h.


The documentation for this class was generated from the following files: