1 .TH "Event" 3 "20 Apr 2005" "InspIRCd" \" -*- nroff -*-
5 Event \- The Event class is a unicast message directed at all modules.
11 \fC#include <modules.h>\fP
13 Inherits \fBModuleMessage\fP.
15 .SS "Public Member Functions"
19 .RI "\fBEvent\fP (char *anydata, \fBModule\fP *src, std::string eventid)"
21 .RI "\fICreate a new Event. \fP"
23 .RI "char * \fBGetData\fP ()"
25 .RI "\fIGet the Event data. \fP"
27 .RI "\fBModule\fP * \fBGetSource\fP ()"
29 .RI "\fIGet the event Source. \fP"
31 .RI "std::string \fBGetEventID\fP ()"
33 .RI "\fIGet the event ID. \fP"
35 .RI "char * \fBSend\fP ()"
37 .RI "\fISend the Event. \fP"
39 .SS "Protected Attributes"
43 .RI "char * \fBdata\fP"
45 .RI "\fIThis member holds a pointer to arbitary data set by the emitter of the message. \fP"
47 .RI "\fBModule\fP * \fBsource\fP"
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"
51 .RI "std::string \fBid\fP"
53 .RI "\fIThe event identifier. \fP"
55 .SH "Detailed Description"
57 The Event class is a unicast message directed at all modules.
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.
61 Definition at line 191 of file modules.h.
62 .SH "Constructor & Destructor Documentation"
64 .SS "Event::Event (char * anydata, \fBModule\fP * src, std::string eventid)"
66 Create a new Event. Definition at line 337 of file modules.cpp.
69 337 : data(anydata), source(src), id(eventid) { };
71 .SH "Member Function Documentation"
73 .SS "char * Event::GetData ()"
75 Get the Event data. Definition at line 339 of file modules.cpp.
81 341 return this->data;
84 .SS "std::string Event::GetEventID ()"
86 Get the event ID. Use this to determine the event type for safe casting of the data Definition at line 355 of file modules.cpp.
95 .SS "\fBModule\fP * Event::GetSource ()"
97 Get the event Source. Definition at line 344 of file modules.cpp.
103 346 return this->source;
106 .SS "char * Event::Send ()\fC [virtual]\fP"
108 Send the Event. The return result of an \fBEvent::Send()\fP will always be NULL as no replies are expected. Implements \fBModuleMessage\fP.
110 Definition at line 349 of file modules.cpp.
112 References FOREACH_MOD.
116 351 FOREACH_MOD OnEvent(this);
120 .SH "Member Data Documentation"
122 .SS "char* \fBEvent::data\fP\fC [protected]\fP"
124 This member holds a pointer to arbitary data set by the emitter of the message. Definition at line 196 of file modules.h.
126 Referenced by GetData().
127 .SS "std::string \fBEvent::id\fP\fC [protected]\fP"
129 The event identifier. This is arbitary text which should be used to distinguish one type of event from another. Definition at line 205 of file modules.h.
131 Referenced by GetEventID().
132 .SS "\fBModule\fP* \fBEvent::source\fP\fC [protected]\fP"
134 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 200 of file modules.h.
136 Referenced by GetSource().
140 Generated automatically by Doxygen for InspIRCd from the source code.