Trippin Cyril
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | List of all members
trippingcyril::Global Class Reference

Our global class which has some key features. More...

#include <Global.h>

Public Member Functions

bool LoadModule (const String &path, const String &config="")
 Loads to module. More...
 
bool UnloadModule (const String &modName, String &retMsg)
 Unloads a previously loaded module. More...
 
ModuleFindModule (const String &module)
 Get a loaded module using it's name. More...
 
InterModuleData ModuleInternalApiCall (const String &module, int method, void *arg=NULL)
 
size_t LoadedModules () const
 
struct event_base * GetEventBase () const
 
struct evdns_base * GetDNSBase () const
 
void Loop ()
 Main application loop. More...
 
std::vector< Module * >
::const_iterator 
begin () const
 
std::vector< Module * >
::const_iterator 
end () const
 

Static Public Member Functions

static GlobalGet ()
 

Detailed Description

Our global class which has some key features.

Member Function Documentation

std::vector<Module*>::const_iterator trippingcyril::Global::begin ( ) const
inline
std::vector<Module*>::const_iterator trippingcyril::Global::end ( ) const
inline
Module* trippingcyril::Global::FindModule ( const String module)

Get a loaded module using it's name.

Parameters
moduleThe name of the module
Returns
The module if found, NULL otherwise
static Global* trippingcyril::Global::Get ( )
inlinestatic
Returns
We're a singleton, so use Get() to well get me
struct evdns_base* trippingcyril::Global::GetDNSBase ( ) const
inline
Returns
Our global evdns base
struct event_base* trippingcyril::Global::GetEventBase ( ) const
inline
Returns
Our global libevent base
size_t trippingcyril::Global::LoadedModules ( ) const
inline
Returns
The amount of loaded modules
bool trippingcyril::Global::LoadModule ( const String path,
const String config = "" 
)

Loads to module.

Parameters
pathThe path of the module to load
configPath to a config file
Returns
True if the module was succesfully loaded
void trippingcyril::Global::Loop ( )

Main application loop.

InterModuleData trippingcyril::Global::ModuleInternalApiCall ( const String module,
int  method,
void *  arg = NULL 
)

Makes a call to an internal module api

Parameters
moduleWhat module's internal api do we want to call
methodWhat method of this internal api do we want to call? Depends on your implementation of course
argCustom data, also depends on your implementation
Returns
The InterModuleData, which is basically a wrapper around void* where module can still clean it up
bool trippingcyril::Global::UnloadModule ( const String modName,
String retMsg 
)

Unloads a previously loaded module.

Parameters
modNameThe name of the module to unload
retMsgThe return message
Returns
True if the module was succesfully unloaded

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