#include <MessageStream.h>
Inherits GameMessageList.
Classes | |
| struct | TranslatorData |
Public Member Functions | |
| MessageStream (void) | |
| virtual | ~MessageStream () |
| virtual void | init (void) |
| virtual void | reset (void) |
| virtual void | update (void) |
| virtual GameMessage * | appendMessage (GameMessage::Type type) |
| Append a message to the end of the stream. | |
| virtual GameMessage * | insertMessage (GameMessage::Type type, GameMessage *messageToInsertAfter) |
| void | propagateMessages (void) |
| Propagate messages through attached translators. | |
| TranslatorID | attachTranslator (GameMessageTranslator *translator, UnsignedInt priority) |
| GameMessageTranslator * | findTranslator (TranslatorID id) |
| void | removeTranslator (TranslatorID) |
| Remove a previously attached translator. | |
Public Member Functions inherited from SubsystemInterface | |
| SubsystemInterface () | |
| virtual | ~SubsystemInterface () |
| virtual void | postProcessLoad () |
| virtual void | draw (void) |
| void | UPDATE (void) |
| void | DRAW (void) |
| AsciiString | getName (void) |
| void | setName (AsciiString name) |
Protected Attributes | |
| TranslatorData * | m_firstTranslator |
| List of registered translators, in order of priority. | |
| TranslatorData * | m_lastTranslator |
| TranslatorID | m_nextTranslatorID |
| For issuing unique translator ID's. | |
Protected Attributes inherited from SubsystemInterface | |
| AsciiString | m_name |
A MessageStream contains an ordered list of messages which can have one or more prioritized message handler functions ("translators") attached to it.
Definition at line 736 of file MessageStream.h.
| MessageStream::MessageStream | ( | void | ) |
Constructor
Definition at line 807 of file MessageStream.cpp.
|
virtual |
Destructor
Definition at line 816 of file MessageStream.cpp.
|
virtual |
Append a message to the end of the stream.
Create a new message of the given message type and append it to this message stream. Return the message such that any data associated with this message can be attached to it.
Definition at line 864 of file MessageStream.cpp.
| TranslatorID MessageStream::attachTranslator | ( | GameMessageTranslator * | translator, |
| UnsignedInt | priority ) |
Attach a translator function to the stream at a priority value. Lower priorities are executed first. Note that MessageStream assumes ownership of the translator, and is responsible for freeing it!
Attach the given Translator to the message stream, and return a unique TranslatorID identifying it. Translators are placed on a list, sorted by priority order. If two Translators share a priority, they are kept in the same order they were attached.
Definition at line 894 of file MessageStream.cpp.
| GameMessageTranslator * MessageStream::findTranslator | ( | TranslatorID | id | ) |
Find a translator attached to this message stream given the ID
Definition at line 954 of file MessageStream.cpp.
|
virtual |
|
virtual |
Create a new message of the given message type and insert it in the stream after messageToInsertAfter, which must not be NULL.
Definition at line 878 of file MessageStream.cpp.
| void MessageStream::propagateMessages | ( | void | ) |
Propagate messages through attached translators.
Propagate messages thru attached Translators, invoking each Translator's callback for each message in the stream. Once all Translators have evaluated the message stream, all messages in the stream are destroyed.
Definition at line 1078 of file MessageStream.cpp.
| void MessageStream::removeTranslator | ( | TranslatorID | id | ) |
Remove a previously attached translator.
Remove a previously attached translator.
Definition at line 973 of file MessageStream.cpp.
|
virtual |
Reset
Reimplemented from GameMessageList.
Definition at line 839 of file MessageStream.cpp.
|
virtual |
|
protected |
List of registered translators, in order of priority.
Definition at line 782 of file MessageStream.h.
|
protected |
Definition at line 783 of file MessageStream.h.
|
protected |
For issuing unique translator ID's.
Definition at line 784 of file MessageStream.h.