]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/Event.3
42c9851dae2a7430a21f38f2782d5aaa5a385aca
[user/henk/code/inspircd.git] / docs / man / man3 / Event.3
1 .TH "Event" 3 "15 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 Event \- The Event class is a unicast message directed at all modules.  
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 "\fBEvent\fP (char *anydata, \fBModule\fP *src, \fBstd::string\fP eventid)"
20 .br
21 .RI "\fICreate a new Event. \fP"
22 .ti -1c
23 .RI "char * \fBGetData\fP ()"
24 .br
25 .RI "\fIGet the Event data. \fP"
26 .ti -1c
27 .RI "\fBModule\fP * \fBGetSource\fP ()"
28 .br
29 .RI "\fIGet the event Source. \fP"
30 .ti -1c
31 .RI "\fBstd::string\fP \fBGetEventID\fP ()"
32 .br
33 .RI "\fIGet the event ID. \fP"
34 .ti -1c
35 .RI "char * \fBSend\fP ()"
36 .br
37 .RI "\fISend the Event. \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 "\fBstd::string\fP \fBid\fP"
52 .br
53 .RI "\fIThe event identifier. \fP"
54 .in -1c
55 .SH "Detailed Description"
56 .PP 
57 The Event class is a unicast message directed at all modules. 
58
59 When the class is properly instantiated it may be sent to all modules using the \fBSend()\fP method, which will trigger the OnEvent method in all modules passing the object as its parameter.
60 .PP
61 Definition at line 197 of file modules.h.
62 .SH "Constructor & Destructor Documentation"
63 .PP 
64 .SS "Event::Event (char * anydata, \fBModule\fP * src, \fBstd::string\fP eventid)"
65 .PP
66 Create a new Event. 
67 .PP
68 Definition at line 194 of file modules.cpp.
69 .PP
70 .nf
71 194 : data(anydata), source(src), id(eventid) { };
72 .fi
73 .PP
74 .SH "Member Function Documentation"
75 .PP 
76 .SS "char * Event::GetData ()"
77 .PP
78 Get the Event data. 
79 .PP
80 Definition at line 196 of file modules.cpp.
81 .PP
82 References data.
83 .PP
84 .nf
85 197 {
86 198         return this->data;
87 199 }
88 .fi
89 .PP
90 .SS "\fBstd::string\fP Event::GetEventID ()"
91 .PP
92 Get the event ID. 
93 .PP
94 Use this to determine the event type for safe casting of the data
95 .PP
96 Definition at line 212 of file modules.cpp.
97 .PP
98 References id.
99 .PP
100 .nf
101 213 {
102 214         return this->id;
103 215 }
104 .fi
105 .PP
106 .SS "\fBModule\fP * Event::GetSource ()"
107 .PP
108 Get the event Source. 
109 .PP
110 Definition at line 201 of file modules.cpp.
111 .PP
112 References source.
113 .PP
114 .nf
115 202 {
116 203         return this->source;
117 204 }
118 .fi
119 .PP
120 .SS "char * Event::Send ()\fC [virtual]\fP"
121 .PP
122 Send the Event. 
123 .PP
124 The return result of an \fBEvent::Send()\fP will always be NULL as no replies are expected.
125 .PP
126 Implements \fBModuleMessage\fP.
127 .PP
128 Definition at line 206 of file modules.cpp.
129 .PP
130 References FOREACH_MOD.
131 .PP
132 .nf
133 207 {
134 208         FOREACH_MOD OnEvent(this);
135 209         return NULL;
136 210 }
137 .fi
138 .PP
139 .SH "Member Data Documentation"
140 .PP 
141 .SS "char* \fBEvent::data\fP\fC [protected]\fP"
142 .PP
143 This member holds a pointer to arbitary data set by the emitter of the message. 
144 .PP
145 Definition at line 202 of file modules.h.
146 .PP
147 Referenced by GetData().
148 .SS "\fBstd::string\fP \fBEvent::id\fP\fC [protected]\fP"
149 .PP
150 The event identifier. 
151 .PP
152 This is arbitary text which should be used to distinguish one type of event from another.
153 .PP
154 Definition at line 211 of file modules.h.
155 .PP
156 Referenced by GetEventID().
157 .SS "\fBModule\fP* \fBEvent::source\fP\fC [protected]\fP"
158 .PP
159 This is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply. 
160 .PP
161 Definition at line 206 of file modules.h.
162 .PP
163 Referenced by GetSource().
164
165 .SH "Author"
166 .PP 
167 Generated automatically by Doxygen for InspIRCd from the source code.