green::MessagePool Class Reference

#include <MessagePool.h>

List of all members.

Public Member Functions

virtual void AddMessage (Key targetType, MessageInstancePtr msg)
virtual size_t GetNumMessagesOfFormat (MsgFormat format)
virtual MessageInstancePtr GetMessageOfFormat (size_t n, MsgFormat format) const
virtual void Clear ()
 Clear all messages in the pool. This is usually done at the end of an event loop iteration, or at the beginning, to prepare for the next set of messages.

Protected Types

typedef std::vector< MessageInstancePtr > MsgList
typedef std::map< MsgFormat,
MsgList
MsgMap

Protected Member Functions

MsgMap::iterator _getList (MsgFormat format)
MsgMap::const_iterator _getConstList (MsgFormat format) const

Protected Attributes

MsgMap mMsgMap
 The main message list map.


Detailed Description

MessagePool handles messages for the event loop. You can add as many messages as you like, and then you can query them by a message Format, which is basically the entity type the message is for, and the message type of the message.


Member Typedef Documentation

typedef std::vector<MessageInstancePtr> green::MessagePool::MsgList [protected]

This is just a convenience typedef for a pointer to a vector of message instance shared pointers


Member Function Documentation

virtual void green::MessagePool::AddMessage ( Key  targetType,
MessageInstancePtr  msg 
) [inline, virtual]

Add a Message to the pool.

Parameters:
targetType The Key for the type of entity this message is meant for
msg The message instance to add to the pool

virtual size_t green::MessagePool::GetNumMessagesOfFormat ( MsgFormat  format  )  [inline, virtual]

Get the number of messages of a given format in the pool.

Parameters:
format The format of the messages you want to know about.
Returns:
Returns the number of messages of a given type there are in the pool.

virtual MessageInstancePtr green::MessagePool::GetMessageOfFormat ( size_t  n,
MsgFormat  format 
) const [inline, virtual]

Get the nth message of a given format.

Parameters:
n The number of the message you want to get.
format The format of the message you want to get
Returns:
Returns the nth message of the given format, or throws an Error if n is greater than the number of messages of that format.


The documentation for this class was generated from the following file:
Generated on Fri Apr 27 10:27:39 2007 for Green Engine by  doxygen 1.5.1