|
|||
|
|||
|
#include <modules.h>
Inheritance diagram for Request:


Public Member Functions | |
| Request (char *anydata, Module *src, Module *dst) | |
| Create a new Request This is for the 'old' way of casting whatever the data is to char* and hoping you get the right thing at the other end. | |
| Request (Module *src, Module *dst, const char *idstr) | |
| Create a new Request This is for the 'new' way of defining a subclass of Request and defining it in a common header, passing an object of your Request subclass through as a Request* and using the ID string to determine what to cast it back to and the other end. | |
| char * | GetData () |
| Fetch the Request data. | |
| const char * | GetId () |
| Fetch the ID string. | |
| Module * | GetSource () |
| Fetch the request source. | |
| Module * | GetDest () |
| Fetch the request destination (should be 'this' in the receiving module). | |
| const char * | Send () |
| Send the Request. | |
Protected Attributes | |
| char * | data |
| This member holds a pointer to arbitary data set by the emitter of the message. | |
| const char * | id |
| This should be a null-terminated string identifying the type of request, all modules should define this and use it to determine the nature of the request before they attempt to cast the Request in any way. | |
| 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 284 of file modules.h.
|
||||||||||||||||
|
Create a new Request This is for the 'old' way of casting whatever the data is to char* and hoping you get the right thing at the other end. This is slowly being depreciated in favor of the 'new' way. Definition at line 34 of file modules.cpp. |
|
||||||||||||||||
|
Create a new Request This is for the 'new' way of defining a subclass of Request and defining it in a common header, passing an object of your Request subclass through as a Request* and using the ID string to determine what to cast it back to and the other end. This is much safer as there are no casts not confirmed by the ID string, and all casts are child->parent and can be checked at runtime with dynamic_cast<>() Definition at line 43 of file modules.cpp. |
|
|
Fetch the Request data.
Definition at line 48 of file modules.cpp. References data. Referenced by ModuleHttpServer::OnRequest(). |
|
|
Fetch the request destination (should be 'this' in the receiving module).
Definition at line 63 of file modules.cpp. References dest. Referenced by SQLConn::SendResults(). |
|
|
|
Fetch the request source.
Definition at line 58 of file modules.cpp. References source. Referenced by SQLConn::DoConnectedPoll(), SQLConnection::DoLeadingQuery(), and SQLConn::Query(). |
|
|
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. Definition at line 68 of file modules.cpp. References dest, and Module::OnRequest(). Referenced by ModuleSQLLog::AddLogEntry(), ModuleHTTPAccessList::BlockAccess(), ModuleSQLAuth::CheckCredentials(), SQLConn::DoConnectedPoll(), QueryInfo::Go(), ModuleSQLOper::LookupOper(), ModuleTestClient::OnBackgroundTimer(), ModuleRpcJson::OnEvent(), ModuleHttpStats::OnEvent(), ModuleBanRedirect::OnUserPreJoin(), GetAssocChan::S(), GetAssocUser::S(), UnAssociate::S(), AssociateChan::S(), AssociateUser::S(), and SQLConn::SendResults(). |
|
|
This member holds a pointer to arbitary data set by the emitter of the message.
Definition at line 289 of file modules.h. Referenced by GetData(). |
|
|
The single destination of the Request.
|
|
|
This should be a null-terminated string identifying the type of request, all modules should define this and use it to determine the nature of the request before they attempt to cast the Request in any way.
Reimplemented in AssociateUser, AssociateChan, UnAssociate, GetAssocUser, GetAssocChan, SQLrequest, and SQLresult. Definition at line 294 of file modules.h. Referenced by GetId(). |
|
|
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 298 of file modules.h. Referenced by GetSource(), and SQLrequest::SetSource(). |