]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/Request.3
d910f5ab35bad7c4d646c53f62b29fe24ffcd5c2
[user/henk/code/inspircd.git] / docs / man / man3 / Request.3
1 .TH "Request" 3 "15 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 Request \- The Request class is a unicast message directed at a given module.  
6
7 .PP
8 .SH SYNOPSIS
9 .br
10 .PP
11 \fC#include <modules.h>\fP
12 .PP
13 Inherits \fBModuleMessage\fP.
14 .PP
15 .SS "Public Member Functions"
16
17 .in +1c
18 .ti -1c
19 .RI "\fBRequest\fP (char *anydata, \fBModule\fP *src, \fBModule\fP *dst)"
20 .br
21 .RI "\fICreate a new Request. \fP"
22 .ti -1c
23 .RI "char * \fBGetData\fP ()"
24 .br
25 .RI "\fIFetch the Request data. \fP"
26 .ti -1c
27 .RI "\fBModule\fP * \fBGetSource\fP ()"
28 .br
29 .RI "\fIFetch the request source. \fP"
30 .ti -1c
31 .RI "\fBModule\fP * \fBGetDest\fP ()"
32 .br
33 .RI "\fIFetch the request destination (should be 'this' in the receiving module). \fP"
34 .ti -1c
35 .RI "char * \fBSend\fP ()"
36 .br
37 .RI "\fISend the Request. \fP"
38 .in -1c
39 .SS "Protected Attributes"
40
41 .in +1c
42 .ti -1c
43 .RI "char * \fBdata\fP"
44 .br
45 .RI "\fIThis member holds a pointer to arbitary data set by the emitter of the message. \fP"
46 .ti -1c
47 .RI "\fBModule\fP * \fBsource\fP"
48 .br
49 .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"
50 .ti -1c
51 .RI "\fBModule\fP * \fBdest\fP"
52 .br
53 .RI "\fIThe single destination of the Request. \fP"
54 .in -1c
55 .SH "Detailed Description"
56 .PP 
57 The Request class is a unicast message directed at a given module. 
58
59 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.
60 .PP
61 Definition at line 157 of file modules.h.
62 .SH "Constructor & Destructor Documentation"
63 .PP 
64 .SS "Request::Request (char * anydata, \fBModule\fP * src, \fBModule\fP * dst)"
65 .PP
66 Create a new Request. 
67 .PP
68 Definition at line 165 of file modules.cpp.
69 .PP
70 .nf
71 165 : data(anydata), source(src), dest(dst) { };
72 .fi
73 .PP
74 .SH "Member Function Documentation"
75 .PP 
76 .SS "char * Request::GetData ()"
77 .PP
78 Fetch the Request data. 
79 .PP
80 Definition at line 167 of file modules.cpp.
81 .PP
82 References data.
83 .PP
84 .nf
85 168 {
86 169         return this->data;
87 170 }
88 .fi
89 .PP
90 .SS "\fBModule\fP * Request::GetDest ()"
91 .PP
92 Fetch the request destination (should be 'this' in the receiving module). 
93 .PP
94 Definition at line 177 of file modules.cpp.
95 .PP
96 References dest.
97 .PP
98 .nf
99 178 {
100 179         return this->dest;
101 180 }
102 .fi
103 .PP
104 .SS "\fBModule\fP * Request::GetSource ()"
105 .PP
106 Fetch the request source. 
107 .PP
108 Definition at line 172 of file modules.cpp.
109 .PP
110 References source.
111 .PP
112 .nf
113 173 {
114 174         return this->source;
115 175 }
116 .fi
117 .PP
118 .SS "char * Request::Send ()\fC [virtual]\fP"
119 .PP
120 Send the Request. 
121 .PP
122 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.
123 .PP
124 Implements \fBModuleMessage\fP.
125 .PP
126 Definition at line 182 of file modules.cpp.
127 .PP
128 References dest, and Module::OnRequest().
129 .PP
130 .nf
131 183 {
132 184         if (this->dest)
133 185         {
134 186                 return dest->OnRequest(this);
135 187         }
136 188         else
137 189         {
138 190                 return NULL;
139 191         }
140 192 }
141 .fi
142 .PP
143 .SH "Member Data Documentation"
144 .PP 
145 .SS "char* \fBRequest::data\fP\fC [protected]\fP"
146 .PP
147 This member holds a pointer to arbitary data set by the emitter of the message. 
148 .PP
149 Definition at line 162 of file modules.h.
150 .PP
151 Referenced by GetData().
152 .SS "\fBModule\fP* \fBRequest::dest\fP\fC [protected]\fP"
153 .PP
154 The single destination of the Request. 
155 .PP
156 Definition at line 169 of file modules.h.
157 .PP
158 Referenced by GetDest(), and Send().
159 .SS "\fBModule\fP* \fBRequest::source\fP\fC [protected]\fP"
160 .PP
161 This is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply. 
162 .PP
163 Definition at line 166 of file modules.h.
164 .PP
165 Referenced by GetSource().
166
167 .SH "Author"
168 .PP 
169 Generated automatically by Doxygen for InspIRCd from the source code.