![]() |
Angel
A 2D Game Prototyping Engine
|
The base message class which signals an event. More...
#include <Message.h>
Inheritance diagram for Message:Public Member Functions | |
| Message () | |
| Message (const String &messageName, MessageListener *sender=NULL) | |
| virtual const String & | GetMessageName () const |
| MessageListener *const | GetSender () |
Protected Attributes | |
| String | _messageName |
| MessageListener * | _sender |
A message is used by the Switchboard class to signal to any listeners that an event has happened. The only information it conveys is the message name (a user-definable string) and who sent the message.
Classes which implement the MessageListener interface can subscribe to specific types of messages to get notification.
| Message::Message | ( | ) |
The default constructor creates a Message with the name "GenericMessage" and no sender.
Definition at line 34 of file Message.cpp.
| Message::Message | ( | const String & | messageName, |
| MessageListener * | sender = NULL |
||
| ) |
This is the constructor you should actually use -- gives the Message a name and sender.
| messageName | The name of this Message; used by MessageListener and the Switchboard to manage delivery. |
| sender | Who sent this Message; NULL by default |
Definition at line 40 of file Message.cpp.
| const String & Message::GetMessageName | ( | ) | const [virtual] |
Get the name of this Message. Since all Messages come to the listener via the same ReceiveMessage function, this can be used to filter for specific notifications.
Definition at line 46 of file Message.cpp.
| MessageListener *const Message::GetSender | ( | ) |
Find out who requested this Message to be sent. This can have all sorts of semantics depending on what the Message itself is communicating.
Definition at line 51 of file Message.cpp.


1.7.5.1