#include <modules.h>
Inheritance diagram for Event:
Public Member Functions | |
Event (char *anydata, Module *src, std::string eventid) | |
Create a new Event. | |
char * | GetData () |
Get the Event data. | |
Module * | GetSource () |
Get the event Source. | |
std::string | GetEventID () |
Get the event ID. | |
char * | Send () |
Send the Event. | |
Protected Attributes | |
char * | data |
This member holds a pointer to arbitary data set by the emitter of the message. | |
Module * | source |
This is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply. | |
std::string | id |
The event identifier. |
When the class is properly instantiated it may be sent to all modules using the Send() method, which will trigger the OnEvent method in all modules passing the object as its parameter.
Definition at line 197 of file modules.h.
|
Create a new Event.
Definition at line 202 of file modules.cpp.
|
|
Get the Event data.
Definition at line 204 of file modules.cpp. References data. 00205 { 00206 return this->data; 00207 }
|
|
Get the event ID. Use this to determine the event type for safe casting of the data Definition at line 220 of file modules.cpp. References id. 00221 { 00222 return this->id; 00223 }
|
|
Get the event Source.
Definition at line 209 of file modules.cpp. References source. 00210 { 00211 return this->source; 00212 }
|
|
Send the Event. The return result of an Event::Send() will always be NULL as no replies are expected. Implements ModuleMessage. Definition at line 214 of file modules.cpp. References FOREACH_MOD. 00215 { 00216 FOREACH_MOD OnEvent(this); 00217 return NULL; 00218 }
|
|
This member holds a pointer to arbitary data set by the emitter of the message.
Definition at line 202 of file modules.h. Referenced by GetData(). |
|
The event identifier. This is arbitary text which should be used to distinguish one type of event from another. Definition at line 211 of file modules.h. Referenced by GetEventID(). |
|
This is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply.
Definition at line 206 of file modules.h. Referenced by GetSource(). |