]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/module-doc/classEvent.html
Added final documentation for inspircd Beta 4
[user/henk/code/inspircd.git] / docs / module-doc / classEvent.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>InspIRCd: Event class Reference</title>
4 <link href="inspircd.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.3.3 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
8 <h1>Event Class Reference</h1>The Event class is a unicast message directed at all modules.  
9 <a href="#_details">More...</a>
10 <p>
11 <code>#include &lt;<a class="el" href="modules_8h-source.html">modules.h</a>&gt;</code>
12 <p>
13 Inherits <a class="el" href="classModuleMessage.html">ModuleMessage</a>.
14 <p>
15 <a href="classEvent-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
16 <tr><td></td></tr>
17 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
18 <tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classEvent.html#a0">Event</a> (char *anydata, <a class="el" href="classModule.html">Module</a> *src, std::string eventid)</td></tr>
19
20 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a new Event. </em> <a href="#a0"></a><em><br><br></td></tr>
21 <tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classEvent.html#a1">GetData</a> ()</td></tr>
22
23 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the Event data. </em> <a href="#a1"></a><em><br><br></td></tr>
24 <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classModule.html">Module</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classEvent.html#a2">GetSource</a> ()</td></tr>
25
26 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the event Source. </em> <a href="#a2"></a><em><br><br></td></tr>
27 <tr><td class="memItemLeft" nowrap align=right valign=top>std::string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classEvent.html#a3">GetEventID</a> ()</td></tr>
28
29 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the event ID. </em> <a href="#a3"></a><em><br><br></td></tr>
30 <tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classEvent.html#a4">Send</a> ()</td></tr>
31
32 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send the Event. </em> <a href="#a4"></a><em><br><br></td></tr>
33 <tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
34 <tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classEvent.html#p0">data</a></td></tr>
35
36 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This member holds a pointer to arbitary data set by the emitter of the message. </em> <a href="#p0"></a><em><br><br></td></tr>
37 <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classModule.html">Module</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classEvent.html#p1">source</a></td></tr>
38
39 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply. </em> <a href="#p1"></a><em><br><br></td></tr>
40 <tr><td class="memItemLeft" nowrap align=right valign=top>std::string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classEvent.html#p2">id</a></td></tr>
41
42 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The event identifier. </em> <a href="#p2"></a><em><br><br></td></tr>
43 </table>
44 <hr><a name="_details"></a><h2>Detailed Description</h2>
45 The Event class is a unicast message directed at all modules. 
46 <p>
47 When the class is properly instantiated it may be sent to all modules using the <a class="el" href="classEvent.html#a4">Send()</a> method, which will trigger the OnEvent method in all modules passing the object as its parameter. 
48 <p>
49
50 <p>
51 Definition at line <a class="el" href="modules_8h-source.html#l00194">194</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
52 <a name="a0" doxytag="Event::Event"></a><p>
53 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
54   <tr>
55     <td class="mdRow">
56       <table cellpadding="0" cellspacing="0" border="0">
57         <tr>
58           <td class="md" nowrap valign="top"> Event::Event </td>
59           <td class="md" valign="top">(&nbsp;</td>
60           <td class="md" nowrap valign="top">char *&nbsp;</td>
61           <td class="mdname" nowrap> <em>anydata</em>, </td>
62         </tr>
63         <tr>
64           <td></td>
65           <td></td>
66           <td class="md" nowrap><a class="el" href="classModule.html">Module</a> *&nbsp;</td>
67           <td class="mdname" nowrap> <em>src</em>, </td>
68         </tr>
69         <tr>
70           <td></td>
71           <td></td>
72           <td class="md" nowrap>std::string&nbsp;</td>
73           <td class="mdname" nowrap> <em>eventid</em></td>
74         </tr>
75         <tr>
76           <td></td>
77           <td class="md">)&nbsp;</td>
78           <td class="md" colspan="2"></td>
79         </tr>
80
81       </table>
82     </td>
83   </tr>
84 </table>
85 <table cellspacing=5 cellpadding=0 border=0>
86   <tr>
87     <td>
88       &nbsp;
89     </td>
90     <td>
91
92 <p>
93 Create a new Event. 
94 <p>
95
96 <p>
97 Definition at line <a class="el" href="modules_8cpp-source.html#l00335">335</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
98 <p>
99 <div class="fragment"><pre>00335 : <a class="code" href="classEvent.html#p0">data</a>(anydata), <a class="code" href="classEvent.html#p1">source</a>(src), <a class="code" href="classEvent.html#p2">id</a>(eventid) { };
100 </pre></div>    </td>
101   </tr>
102 </table>
103 <hr><h2>Member Function Documentation</h2>
104 <a name="a1" doxytag="Event::GetData"></a><p>
105 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
106   <tr>
107     <td class="mdRow">
108       <table cellpadding="0" cellspacing="0" border="0">
109         <tr>
110           <td class="md" nowrap valign="top"> char * Event::GetData </td>
111           <td class="md" valign="top">(&nbsp;</td>
112           <td class="mdname1" valign="top" nowrap>          </td>
113           <td class="md" valign="top">&nbsp;)&nbsp;</td>
114           <td class="md" nowrap></td>
115         </tr>
116
117       </table>
118     </td>
119   </tr>
120 </table>
121 <table cellspacing=5 cellpadding=0 border=0>
122   <tr>
123     <td>
124       &nbsp;
125     </td>
126     <td>
127
128 <p>
129 Get the Event data. 
130 <p>
131
132 <p>
133 Definition at line <a class="el" href="modules_8cpp-source.html#l00337">337</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
134 <p>
135 References <a class="el" href="modules_8h-source.html#l00199">data</a>.
136 <p>
137 <div class="fragment"><pre>00338 {
138 00339         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classEvent.html#p0">data</a>;
139 00340 }
140 </pre></div>    </td>
141   </tr>
142 </table>
143 <a name="a3" doxytag="Event::GetEventID"></a><p>
144 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
145   <tr>
146     <td class="mdRow">
147       <table cellpadding="0" cellspacing="0" border="0">
148         <tr>
149           <td class="md" nowrap valign="top"> std::string Event::GetEventID </td>
150           <td class="md" valign="top">(&nbsp;</td>
151           <td class="mdname1" valign="top" nowrap>          </td>
152           <td class="md" valign="top">&nbsp;)&nbsp;</td>
153           <td class="md" nowrap></td>
154         </tr>
155
156       </table>
157     </td>
158   </tr>
159 </table>
160 <table cellspacing=5 cellpadding=0 border=0>
161   <tr>
162     <td>
163       &nbsp;
164     </td>
165     <td>
166
167 <p>
168 Get the event ID. 
169 <p>
170 Use this to determine the event type for safe casting of the data 
171 <p>
172 Definition at line <a class="el" href="modules_8cpp-source.html#l00353">353</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
173 <p>
174 References <a class="el" href="modules_8h-source.html#l00208">id</a>.
175 <p>
176 <div class="fragment"><pre>00354 {
177 00355         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classEvent.html#p2">id</a>;
178 00356 }
179 </pre></div>    </td>
180   </tr>
181 </table>
182 <a name="a2" doxytag="Event::GetSource"></a><p>
183 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
184   <tr>
185     <td class="mdRow">
186       <table cellpadding="0" cellspacing="0" border="0">
187         <tr>
188           <td class="md" nowrap valign="top"> <a class="el" href="classModule.html">Module</a> * Event::GetSource </td>
189           <td class="md" valign="top">(&nbsp;</td>
190           <td class="mdname1" valign="top" nowrap>          </td>
191           <td class="md" valign="top">&nbsp;)&nbsp;</td>
192           <td class="md" nowrap></td>
193         </tr>
194
195       </table>
196     </td>
197   </tr>
198 </table>
199 <table cellspacing=5 cellpadding=0 border=0>
200   <tr>
201     <td>
202       &nbsp;
203     </td>
204     <td>
205
206 <p>
207 Get the event Source. 
208 <p>
209
210 <p>
211 Definition at line <a class="el" href="modules_8cpp-source.html#l00342">342</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
212 <p>
213 References <a class="el" href="modules_8h-source.html#l00203">source</a>.
214 <p>
215 <div class="fragment"><pre>00343 {
216 00344         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classEvent.html#p1">source</a>;
217 00345 }
218 </pre></div>    </td>
219   </tr>
220 </table>
221 <a name="a4" doxytag="Event::Send"></a><p>
222 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
223   <tr>
224     <td class="mdRow">
225       <table cellpadding="0" cellspacing="0" border="0">
226         <tr>
227           <td class="md" nowrap valign="top"> char * Event::Send </td>
228           <td class="md" valign="top">(&nbsp;</td>
229           <td class="mdname1" valign="top" nowrap>          </td>
230           <td class="md" valign="top">&nbsp;)&nbsp;</td>
231           <td class="md" nowrap><code> [virtual]</code></td>
232         </tr>
233
234       </table>
235     </td>
236   </tr>
237 </table>
238 <table cellspacing=5 cellpadding=0 border=0>
239   <tr>
240     <td>
241       &nbsp;
242     </td>
243     <td>
244
245 <p>
246 Send the Event. 
247 <p>
248 The return result of an <a class="el" href="classEvent.html#a4">Event::Send()</a> will always be NULL as no replies are expected. 
249 <p>
250 Implements <a class="el" href="classModuleMessage.html#a0">ModuleMessage</a>.
251 <p>
252 Definition at line <a class="el" href="modules_8cpp-source.html#l00347">347</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
253 <p>
254 References <a class="el" href="modules_8h-source.html#l00079">FOREACH_MOD</a>.
255 <p>
256 <div class="fragment"><pre>00348 {
257 00349         <a class="code" href="modules_8h.html#a24">FOREACH_MOD</a> OnEvent(<span class="keyword">this</span>);
258 00350         <span class="keywordflow">return</span> NULL;
259 00351 }
260 </pre></div>    </td>
261   </tr>
262 </table>
263 <hr><h2>Member Data Documentation</h2>
264 <a name="p0" doxytag="Event::data"></a><p>
265 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
266   <tr>
267     <td class="mdRow">
268       <table cellpadding="0" cellspacing="0" border="0">
269         <tr>
270           <td class="md" nowrap valign="top"> char* <a class="el" href="classEvent.html#p0">Event::data</a><code> [protected]</code>
271       </table>
272     </td>
273   </tr>
274 </table>
275 <table cellspacing=5 cellpadding=0 border=0>
276   <tr>
277     <td>
278       &nbsp;
279     </td>
280     <td>
281
282 <p>
283 This member holds a pointer to arbitary data set by the emitter of the message. 
284 <p>
285
286 <p>
287 Definition at line <a class="el" href="modules_8h-source.html#l00199">199</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.
288 <p>
289 Referenced by <a class="el" href="modules_8cpp-source.html#l00337">GetData()</a>.    </td>
290   </tr>
291 </table>
292 <a name="p2" doxytag="Event::id"></a><p>
293 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
294   <tr>
295     <td class="mdRow">
296       <table cellpadding="0" cellspacing="0" border="0">
297         <tr>
298           <td class="md" nowrap valign="top"> std::string <a class="el" href="classEvent.html#p2">Event::id</a><code> [protected]</code>
299       </table>
300     </td>
301   </tr>
302 </table>
303 <table cellspacing=5 cellpadding=0 border=0>
304   <tr>
305     <td>
306       &nbsp;
307     </td>
308     <td>
309
310 <p>
311 The event identifier. 
312 <p>
313 This is arbitary text which should be used to distinguish one type of event from another. 
314 <p>
315 Definition at line <a class="el" href="modules_8h-source.html#l00208">208</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.
316 <p>
317 Referenced by <a class="el" href="modules_8cpp-source.html#l00353">GetEventID()</a>.    </td>
318   </tr>
319 </table>
320 <a name="p1" doxytag="Event::source"></a><p>
321 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
322   <tr>
323     <td class="mdRow">
324       <table cellpadding="0" cellspacing="0" border="0">
325         <tr>
326           <td class="md" nowrap valign="top"> <a class="el" href="classModule.html">Module</a>* <a class="el" href="classEvent.html#p1">Event::source</a><code> [protected]</code>
327       </table>
328     </td>
329   </tr>
330 </table>
331 <table cellspacing=5 cellpadding=0 border=0>
332   <tr>
333     <td>
334       &nbsp;
335     </td>
336     <td>
337
338 <p>
339 This is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply. 
340 <p>
341
342 <p>
343 Definition at line <a class="el" href="modules_8h-source.html#l00203">203</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.
344 <p>
345 Referenced by <a class="el" href="modules_8cpp-source.html#l00342">GetSource()</a>.    </td>
346   </tr>
347 </table>
348 <hr>The documentation for this class was generated from the following files:<ul>
349 <li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul>
350 <hr size="1"><address style="align: right;"><small>Generated on Sat May 7 15:34:24 2005 for InspIRCd by
351 <a href="http://www.doxygen.org/index.html">
352 <img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
353 </a>1.3.3 </small></address>
354 </body>
355 </html>