summaryrefslogtreecommitdiff
path: root/docs/man/man3/Request.3
blob: a3a0db8b196554b86ea373cf541b04d2e7d4d7f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
.TH "Request" 3 "12 May 2005" "InspIRCd" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Request \- The Request class is a unicast message directed at a given module.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <modules.h>\fP
.PP
Inherits \fBModuleMessage\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBRequest\fP (char *anydata, \fBModule\fP *src, \fBModule\fP *dst)"
.br
.RI "\fICreate a new Request. \fP"
.ti -1c
.RI "char * \fBGetData\fP ()"
.br
.RI "\fIFetch the Request data. \fP"
.ti -1c
.RI "\fBModule\fP * \fBGetSource\fP ()"
.br
.RI "\fIFetch the request source. \fP"
.ti -1c
.RI "\fBModule\fP * \fBGetDest\fP ()"
.br
.RI "\fIFetch the request destination (should be 'this' in the receiving module). \fP"
.ti -1c
.RI "char * \fBSend\fP ()"
.br
.RI "\fISend the Request. \fP"
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "char * \fBdata\fP"
.br
.RI "\fIThis member holds a pointer to arbitary data set by the emitter of the message. \fP"
.ti -1c
.RI "\fBModule\fP * \fBsource\fP"
.br
.RI "\fIThis is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply. \fP"
.ti -1c
.RI "\fBModule\fP * \fBdest\fP"
.br
.RI "\fIThe single destination of the Request. \fP"
.in -1c
.SH "Detailed Description"
.PP 
The Request class is a unicast message directed at a given module. 

When this class is properly instantiated it may be sent to a module using the \fBSend()\fP method, which will call the given module's OnRequest method with this class as its parameter. 
.PP
Definition at line 154 of file modules.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "Request::Request (char * anydata, \fBModule\fP * src, \fBModule\fP * dst)"
.PP
Create a new Request. Definition at line 316 of file modules.cpp.
.PP
.nf
316 : data(anydata), source(src), dest(dst) { };
.fi
.SH "Member Function Documentation"
.PP 
.SS "char * Request::GetData ()"
.PP
Fetch the Request data. Definition at line 318 of file modules.cpp.
.PP
References data.
.PP
.nf
319 {
320         return this->data;
321 }
.fi
.SS "\fBModule\fP * Request::GetDest ()"
.PP
Fetch the request destination (should be 'this' in the receiving module). Definition at line 328 of file modules.cpp.
.PP
References dest.
.PP
.nf
329 {
330         return this->dest;
331 }
.fi
.SS "\fBModule\fP * Request::GetSource ()"
.PP
Fetch the request source. Definition at line 323 of file modules.cpp.
.PP
References source.
.PP
.nf
324 {
325         return this->source;
326 }
.fi
.SS "char * Request::Send ()\fC [virtual]\fP"
.PP
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 \fBModuleMessage\fP.
.PP
Definition at line 333 of file modules.cpp.
.PP
References dest, and Module::OnRequest().
.PP
.nf
334 {
335         if (this->dest)
336         {
337                 return dest->OnRequest(this);
338         }
339         else
340         {
341                 return NULL;
342         }
343 }
.fi
.SH "Member Data Documentation"
.PP 
.SS "char* \fBRequest::data\fP\fC [protected]\fP"
.PP
This member holds a pointer to arbitary data set by the emitter of the message. Definition at line 159 of file modules.h.
.PP
Referenced by GetData().
.SS "\fBModule\fP* \fBRequest::dest\fP\fC [protected]\fP"
.PP
The single destination of the Request. Definition at line 166 of file modules.h.
.PP
Referenced by GetDest(), and Send().
.SS "\fBModule\fP* \fBRequest::source\fP\fC [protected]\fP"
.PP
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 163 of file modules.h.
.PP
Referenced by GetSource().

.SH "Author"
.PP 
Generated automatically by Doxygen for InspIRCd from the source code.