The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Event Class Reference

The Event class is a unicast message directed at all modules. More...

#include <modules.h>

Inheritance diagram for Event:

Inheritance graph
[legend]
Collaboration diagram for Event:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Event (char *anydata, Module *src, const std::string &eventid)
 Create a new Event.
char * GetData ()
 Get the Event data.
ModuleGetSource ()
 Get the event Source.
std::string GetEventID ()
 Get the event ID.
char * Send (InspIRCd *ServerInstance)
 Send the Event.

Protected Attributes

char * data
 This member holds a pointer to arbitary data set by the emitter of the message.
Modulesource
 This is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply.
std::string id
 The event identifier.

Detailed Description

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 Send() method, which will trigger the OnEvent method in all modules passing the object as its parameter.

Definition at line 346 of file modules.h.


Constructor & Destructor Documentation

Event::Event char *  anydata,
Module src,
const std::string eventid
 

Create a new Event.

Definition at line 80 of file modules.cpp.


Member Function Documentation

char * Event::GetData  ) 
 

Get the Event data.

Definition at line 82 of file modules.cpp.

References data.

Referenced by GenericCapHandler(), ModuleSSLGnuTLS::OnEvent(), ModuleSASL::OnEvent(), ModuleRPCTest::OnEvent(), ModuleRpcJson::OnEvent(), ModuleHttpStats::OnEvent(), and ModuleHTTPAccessList::OnEvent().

std::string Event::GetEventID  ) 
 

Get the event ID.

Use this to determine the event type for safe casting of the data

Definition at line 98 of file modules.cpp.

References id.

Referenced by GenericCapHandler(), ModuleSpanningTree::OnEvent(), ModuleSSLGnuTLS::OnEvent(), ModuleSASL::OnEvent(), ModuleRPCTest::OnEvent(), ModuleRpcJson::OnEvent(), ModuleHttpStats::OnEvent(), and ModuleHTTPAccessList::OnEvent().

Module * Event::GetSource  ) 
 

Get the event Source.

Definition at line 87 of file modules.cpp.

References source.

Referenced by ModuleHTTPAccessList::BlockAccess(), ModuleRpcJson::OnEvent(), and ModuleHttpStats::OnEvent().

char * Event::Send InspIRCd ServerInstance  ) 
 

Send the Event.

The return result of an Event::Send() will always be NULL as no replies are expected.

Definition at line 92 of file modules.cpp.

References FOREACH_MOD, and I_OnEvent.

Referenced by TreeSocket::Encap(), TreeServer::FinishBurst(), CommandCAP::Handle(), ModuleServicesAccount::OnDecodeMetaData(), ModuleRpcJson::OnEvent(), HttpServerSocket::ServeData(), and TreeSocket::Squit().


Member Data Documentation

char* Event::data [protected]
 

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

Definition at line 351 of file modules.h.

Referenced by GetData().

std::string Event::id [protected]
 

The event identifier.

This is arbitary text which should be used to distinguish one type of event from another.

Definition at line 360 of file modules.h.

Referenced by GetEventID().

Module* Event::source [protected]
 

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 355 of file modules.h.

Referenced by GetSource().


The documentation for this class was generated from the following files: