#include <modules.h>
Inheritance diagram for Request:
Public Member Functions | |
Request (char *anydata, Module *src, Module *dst) | |
Create a new Request. | |
char * | GetData () |
Fetch the Request data. | |
Module * | GetSource () |
Fetch the request source. | |
Module * | GetDest () |
Fetch the request destination (should be 'this' in the receiving module). | |
char * | Send () |
Send the Request. | |
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. | |
Module * | dest |
The single destination of the Request. |
When this class is properly instantiated it may be sent to a module using the Send() method, which will call the given module's OnRequest method with this class as its parameter.
Definition at line 175 of file modules.h.
|
Create a new Request.
Definition at line 164 of file modules.cpp.
|
|
Fetch the Request data.
Definition at line 166 of file modules.cpp. References data. 00167 { 00168 return this->data; 00169 }
|
|
Fetch the request destination (should be 'this' in the receiving module).
Definition at line 176 of file modules.cpp. References dest. 00177 { 00178 return this->dest; 00179 }
|
|
Fetch the request source.
Definition at line 171 of file modules.cpp. References source. 00172 { 00173 return this->source; 00174 }
|
|
Send the Request. Upon returning the result will be arbitary data returned by the module you sent the request to. It is up to your module to know what this data is and how to deal with it. Implements ModuleMessage. Definition at line 181 of file modules.cpp. References dest, and Module::OnRequest(). 00182 { 00183 if (this->dest) 00184 { 00185 return dest->OnRequest(this); 00186 } 00187 else 00188 { 00189 return NULL; 00190 } 00191 }
|
|
This member holds a pointer to arbitary data set by the emitter of the message.
Definition at line 180 of file modules.h. Referenced by GetData(). |
|
The single destination of the Request.
|
|
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 184 of file modules.h. Referenced by GetSource(). |