summaryrefslogtreecommitdiff
path: root/docs/module-doc/classEvent.html
blob: 56a41deab3f27e23862822b4dd7410e37c85b5d7 (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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>InspIRCd: Event Class Reference</title>
<link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.4-20050815 -->
<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">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>Event Class Reference</h1><!-- doxytag: class="Event" --><!-- doxytag: inherits="ModuleMessage" -->The Event class is a unicast message directed at all modules.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="modules_8h-source.html">modules.h</a>&gt;</code>
<p>
Inheritance diagram for Event:<p><center><img src="classEvent__inherit__graph.gif" border="0" usemap="#Event__inherit__map" alt="Inheritance graph"></center>
<map name="Event__inherit__map">
<area href="classModuleMessage.html" shape="rect" coords="7,81,127,108" alt="">
<area href="classclassbase.html" shape="rect" coords="27,7,107,33" alt="">
</map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for Event:<p><center><img src="classEvent__coll__graph.gif" border="0" usemap="#Event__coll__map" alt="Collaboration graph"></center>
<map name="Event__coll__map">
<area href="classModuleMessage.html" shape="rect" coords="7,175,127,202" alt="">
<area href="classclassbase.html" shape="rect" coords="95,98,175,124" alt="">
<area href="classModule.html" shape="rect" coords="151,175,217,202" alt="">
</map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classEvent-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEvent.html#Event_28char_20_2Aanydata_2C_20Module_20_2Asrc_2C_20std_3A_3Astring_20eventid_29">Event</a> (char *anydata, <a class="el" href="classModule.html">Module</a> *src, <a class="el" href="namespaceirc.html#string">std::string</a> eventid)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a new Event.  <a href="#Event_28char_20_2Aanydata_2C_20Module_20_2Asrc_2C_20std_3A_3Astring_20eventid_29"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEvent.html#GetData_28_29">GetData</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the Event data.  <a href="#GetData_28_29"></a><br></td></tr>
<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#GetSource_28_29">GetSource</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the event Source.  <a href="#GetSource_28_29"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceirc.html#string">std::string</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEvent.html#GetEventID_28_29">GetEventID</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the event ID.  <a href="#GetEventID_28_29"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEvent.html#Send_28_29">Send</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send the Event.  <a href="#Send_28_29"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEvent.html#data">data</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This member holds a pointer to arbitary data set by the emitter of the message.  <a href="#data"></a><br></td></tr>
<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#source">source</a></td></tr>

<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.  <a href="#source"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceirc.html#string">std::string</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEvent.html#id">id</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The event identifier.  <a href="#id"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The Event class is a unicast message directed at all modules. 
<p>
When the class is properly instantiated it may be sent to all modules using the <a class="el" href="classEvent.html#Send_28_29">Send()</a> method, which will trigger the OnEvent method in all modules passing the object as its parameter.
<p>

<p>
Definition at line <a class="el" href="modules_8h-source.html#l00197">197</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="Event_28char_20_2Aanydata_2C_20Module_20_2Asrc_2C_20std_3A_3Astring_20eventid_29"></a><!-- doxytag: member="Event::Event" ref="Event_28char_20_2Aanydata_2C_20Module_20_2Asrc_2C_20std_3A_3Astring_20eventid_29" args="(char *anydata, Module *src, std::string eventid)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">Event::Event           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char *&nbsp;</td>
          <td class="mdname" nowrap> <em>anydata</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="classModule.html">Module</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>src</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="namespaceirc.html#string">std::string</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>eventid</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create a new Event. 
<p>

<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00194">194</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.<div class="fragment"><pre class="fragment"><a name="l00194"></a>00194 : <a class="code" href="classEvent.html#data">data</a>(anydata), <a class="code" href="classEvent.html#source">source</a>(src), <a class="code" href="classEvent.html#id">id</a>(eventid) { };
</pre></div>
<p>
    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="GetData_28_29"></a><!-- doxytag: member="Event::GetData" ref="GetData_28_29" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">char * Event::GetData           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the Event data. 
<p>

<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00196">196</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="modules_8h-source.html#l00202">data</a>.<div class="fragment"><pre class="fragment"><a name="l00197"></a>00197 {
<a name="l00198"></a>00198         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classEvent.html#data">data</a>;
<a name="l00199"></a>00199 }
</pre></div>
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="GetEventID_28_29"></a><!-- doxytag: member="Event::GetEventID" ref="GetEventID_28_29" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="namespaceirc.html#string">std::string</a> Event::GetEventID           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the event ID. 
<p>
Use this to determine the event type for safe casting of the data
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00212">212</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="modules_8h-source.html#l00211">id</a>.<div class="fragment"><pre class="fragment"><a name="l00213"></a>00213 {
<a name="l00214"></a>00214         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classEvent.html#id">id</a>;
<a name="l00215"></a>00215 }
</pre></div>
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="GetSource_28_29"></a><!-- doxytag: member="Event::GetSource" ref="GetSource_28_29" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="classModule.html">Module</a> * Event::GetSource           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the event Source. 
<p>

<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00201">201</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="modules_8h-source.html#l00206">source</a>.<div class="fragment"><pre class="fragment"><a name="l00202"></a>00202 {
<a name="l00203"></a>00203         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classEvent.html#source">source</a>;
<a name="l00204"></a>00204 }
</pre></div>
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="Send_28_29"></a><!-- doxytag: member="Event::Send" ref="Send_28_29" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">char * Event::Send           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Send the Event. 
<p>
The return result of an <a class="el" href="classEvent.html#Send_28_29">Event::Send()</a> will always be NULL as no replies are expected.
<p>
Implements <a class="el" href="classModuleMessage.html#Send_28_29_3D_30">ModuleMessage</a>.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00206">206</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="modules_8h-source.html#l00081">FOREACH_MOD</a>.<div class="fragment"><pre class="fragment"><a name="l00207"></a>00207 {
<a name="l00208"></a>00208         <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnEvent(<span class="keyword">this</span>);
<a name="l00209"></a>00209         <span class="keywordflow">return</span> NULL;
<a name="l00210"></a>00210 }
</pre></div>
<p>
    </td>
  </tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="data"></a><!-- doxytag: member="Event::data" ref="data" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">char* <a class="el" href="classEvent.html#data">Event::data</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This member holds a pointer to arbitary data set by the emitter of the message. 
<p>

<p>
Definition at line <a class="el" href="modules_8h-source.html#l00202">202</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.
<p>
Referenced by <a class="el" href="modules_8cpp-source.html#l00196">GetData()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="id"></a><!-- doxytag: member="Event::id" ref="id" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="namespaceirc.html#string">std::string</a> <a class="el" href="classEvent.html#id">Event::id</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The event identifier. 
<p>
This is arbitary text which should be used to distinguish one type of event from another.
<p>
Definition at line <a class="el" href="modules_8h-source.html#l00211">211</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.
<p>
Referenced by <a class="el" href="modules_8cpp-source.html#l00212">GetEventID()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="source"></a><!-- doxytag: member="Event::source" ref="source" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="classModule.html">Module</a>* <a class="el" href="classEvent.html#source">Event::source</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply. 
<p>

<p>
Definition at line <a class="el" href="modules_8h-source.html#l00206">206</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.
<p>
Referenced by <a class="el" href="modules_8cpp-source.html#l00201">GetSource()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<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>
<hr size="1"><address style="align: right;"><small>Generated on Thu Dec 15 11:14:18 2005 for InspIRCd by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4-20050815 </small></address>
</body>
</html>