MessageReceiver_t< TASK_TYPE, MESSAGE_TYPE > Class Template Reference

Template message receiver class. More...

#include <UTMessageReceiver.h>

Inheritance diagram for MessageReceiver_t< TASK_TYPE, MESSAGE_TYPE >:
MessageTypeReceiver_t< MESSAGE_TYPE > AbstractMessageReceiver_t

List of all members.

Public Member Functions

 MessageReceiver_t (void(TASK_TYPE::*receiver_function)(const MESSAGE_TYPE *))
void SetReceiverFunction (void(TASK_TYPE::*receiver_function)(const MESSAGE_TYPE *))

Detailed Description

template<class TASK_TYPE, class MESSAGE_TYPE>
class MessageReceiver_t< TASK_TYPE, MESSAGE_TYPE >

Template message receiver class. When a message is received, a receiver function is called in the Task_t subclass which owns this message receiver, and whose type must match the template TASK_TYPE. For dispatch purposes, the message must be the same type as, or derived from, the template MESSAGE_TYPE. Otherwise, the message could not be cast to the correct type for calling the message receiver function. If the required dynamic cast is not possible, an assertion failure will occur, but use of the MessageDestination_t template, which is also a template of MESSAGE_TYPE, makes that unlikely. See MessageLoop_t for a comprehensive explanation of the UT messaging architecture.

Definition at line 78 of file UTMessageReceiver.h.


Constructor & Destructor Documentation

template<class TASK_TYPE, class MESSAGE_TYPE>
MessageReceiver_t< TASK_TYPE, MESSAGE_TYPE >::MessageReceiver_t ( void(TASK_TYPE::*)(const MESSAGE_TYPE *)  receiver_function  )  [inline]

Constructor for a message receiver where the specified receiver_function in a task of tbe specified type will be called when it receives a message.

Definition at line 140 of file UTMessageReceiver.h.


Member Function Documentation

template<class TASK_TYPE, class MESSAGE_TYPE>
void MessageReceiver_t< TASK_TYPE, MESSAGE_TYPE >::SetReceiverFunction ( void(TASK_TYPE::*)(const MESSAGE_TYPE *)  receiver_function  )  [inline]

Changes the registered receiver function.

Definition at line 149 of file UTMessageReceiver.h.


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

Generated on Tue Dec 14 22:35:07 2010 for UT library by  doxygen 1.6.1