#include <MessagePool.h>
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. |
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
virtual void green::MessagePool::AddMessage | ( | Key | targetType, | |
MessageInstancePtr | msg | |||
) | [inline, virtual] |
Add a Message to the pool.
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.
format | The format of the messages you want to know about. |
virtual MessageInstancePtr green::MessagePool::GetMessageOfFormat | ( | size_t | n, | |
MsgFormat | format | |||
) | const [inline, virtual] |
Get the nth message of a given format.
n | The number of the message you want to get. | |
format | The format of the message you want to get |