blob: 1f24c87efa1ff45bca8e7f57a7332d677861a817 (
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
|
.TH "Event" 3 "12 May 2005" "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, std::string 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 "std::string \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 "std::string \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 194 of file modules.h.
.SH "Constructor & Destructor Documentation"
.PP
.SS "Event::Event (char * anydata, \fBModule\fP * src, std::string eventid)"
.PP
Create a new Event. Definition at line 344 of file modules.cpp.
.PP
.nf
344 : data(anydata), source(src), id(eventid) { };
.fi
.SH "Member Function Documentation"
.PP
.SS "char * Event::GetData ()"
.PP
Get the Event data. Definition at line 346 of file modules.cpp.
.PP
References data.
.PP
.nf
347 {
348 return this->data;
349 }
.fi
.SS "std::string Event::GetEventID ()"
.PP
Get the event ID. Use this to determine the event type for safe casting of the data Definition at line 362 of file modules.cpp.
.PP
References id.
.PP
.nf
363 {
364 return this->id;
365 }
.fi
.SS "\fBModule\fP * Event::GetSource ()"
.PP
Get the event Source. Definition at line 351 of file modules.cpp.
.PP
References source.
.PP
.nf
352 {
353 return this->source;
354 }
.fi
.SS "char * Event::Send ()\fC [virtual]\fP"
.PP
Send the Event. The return result of an \fBEvent::Send()\fP will always be NULL as no replies are expected. Implements \fBModuleMessage\fP.
.PP
Definition at line 356 of file modules.cpp.
.PP
References FOREACH_MOD.
.PP
.nf
357 {
358 FOREACH_MOD OnEvent(this);
359 return NULL;
360 }
.fi
.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. Definition at line 199 of file modules.h.
.PP
Referenced by GetData().
.SS "std::string \fBEvent::id\fP\fC [protected]\fP"
.PP
The event identifier. This is arbitary text which should be used to distinguish one type of event from another. Definition at line 208 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. Definition at line 203 of file modules.h.
.PP
Referenced by GetSource().
.SH "Author"
.PP
Generated automatically by Doxygen for InspIRCd from the source code.
|