blob: 36017ae329a8c8237c2f2615e3c3d25be672dc43 (
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
|
.TH "Event" 3 "14 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Event \- The Event class is a unicast message directed at all modules.
.PP
.SH SYNOPSIS
.br
.PP
\fC#include <modules.h>\fP
.PP
Inherits \fBModuleMessage\fP.
.PP
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBEvent\fP (char *anydata, \fBModule\fP *src, \fBstd::string\fP eventid)"
.br
.RI "\fICreate a new Event. \fP"
.ti -1c
.RI "char * \fBGetData\fP ()"
.br
.RI "\fIGet the Event data. \fP"
.ti -1c
.RI "\fBModule\fP * \fBGetSource\fP ()"
.br
.RI "\fIGet the event Source. \fP"
.ti -1c
.RI "\fBstd::string\fP \fBGetEventID\fP ()"
.br
.RI "\fIGet the event ID. \fP"
.ti -1c
.RI "char * \fBSend\fP ()"
.br
.RI "\fISend the Event. \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 "\fBstd::string\fP \fBid\fP"
.br
.RI "\fIThe event identifier. \fP"
.in -1c
.SH "Detailed Description"
.PP
The Event class is a unicast message directed at all modules.
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.
.PP
Definition at line 197 of file modules.h.
.SH "Constructor & Destructor Documentation"
.PP
.SS "Event::Event (char * anydata, \fBModule\fP * src, \fBstd::string\fP eventid)"
.PP
Create a new Event.
.PP
Definition at line 194 of file modules.cpp.
.PP
.nf
194 : data(anydata), source(src), id(eventid) { };
.fi
.PP
.SH "Member Function Documentation"
.PP
.SS "char * Event::GetData ()"
.PP
Get the Event data.
.PP
Definition at line 196 of file modules.cpp.
.PP
References data.
.PP
.nf
197 {
198 return this->data;
199 }
.fi
.PP
.SS "\fBstd::string\fP Event::GetEventID ()"
.PP
Get the event ID.
.PP
Use this to determine the event type for safe casting of the data
.PP
Definition at line 212 of file modules.cpp.
.PP
References id.
.PP
.nf
213 {
214 return this->id;
215 }
.fi
.PP
.SS "\fBModule\fP * Event::GetSource ()"
.PP
Get the event Source.
.PP
Definition at line 201 of file modules.cpp.
.PP
References source.
.PP
.nf
202 {
203 return this->source;
204 }
.fi
.PP
.SS "char * Event::Send ()\fC [virtual]\fP"
.PP
Send the Event.
.PP
The return result of an \fBEvent::Send()\fP will always be NULL as no replies are expected.
.PP
Implements \fBModuleMessage\fP.
.PP
Definition at line 206 of file modules.cpp.
.PP
References FOREACH_MOD.
.PP
.nf
207 {
208 FOREACH_MOD OnEvent(this);
209 return NULL;
210 }
.fi
.PP
.SH "Member Data Documentation"
.PP
.SS "char* \fBEvent::data\fP\fC [protected]\fP"
.PP
This member holds a pointer to arbitary data set by the emitter of the message.
.PP
Definition at line 202 of file modules.h.
.PP
Referenced by GetData().
.SS "\fBstd::string\fP \fBEvent::id\fP\fC [protected]\fP"
.PP
The event identifier.
.PP
This is arbitary text which should be used to distinguish one type of event from another.
.PP
Definition at line 211 of file modules.h.
.PP
Referenced by GetEventID().
.SS "\fBModule\fP* \fBEvent::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.
.PP
Definition at line 206 of file modules.h.
.PP
Referenced by GetSource().
.SH "Author"
.PP
Generated automatically by Doxygen for InspIRCd from the source code.
|