EventManager Class Reference

#include <EventManager.h>

Collaboration diagram for EventManager:

List of all members.


Public Types

enum  EXECUTION_MODE { EXECUTE_LOCAL = 0, EXECUTE_REMOTE = 1, EXECUTE_GLOBAL = 2 }

Static Public Member Functions

static void init ()
static bool loadConfig (std::string configFile)
static void cleanup ()
static void registerNetwork (NetworkInterface *netInt)
static void registerEventFactory (std::string name, AbstractEventFactory *evtFact)
static void start ()
static void stop ()
static void sendEvent (Event *event, EXECUTION_MODE mode)
static void sendEventTo (Event *event, unsigned userId)
static void activateLogging (std::string logFile, bool append=false)
static void deactivateLogging ()
static void dump ()
static EventPipegetPipe (OSG::UInt8 id)

Static Private Member Functions

static void putEventInPipe (Event *event)
static Eventdecode (NetMessage *msg)
static void generateHashValues ()
static void run (void *dummy)

Static Private Attributes

static bool initialized = false
static bool shutdown = false
static bool isRunning = false
static unsigned sequenceNumber = 0
static OSG::Thread * eventRecvThread = NULL
static std::map< std::string,
AbstractEventFactory * > 
eventFactoryMap
static std::map< unsigned,
AbstractEventFactory * > 
hashEventFactoryMap
static std::map< std::string,
unsigned > 
eventHashMap
static std::map< unsigned,
std::string > 
idToEventName
static EventPipepipes [256]
static NetworkInterfacenetworkController
static OSG::Lock * loggingLock
static std::vector< std::string > eventLogList
static bool isLogging = false
static bool createNewLogFile = true
static std::string logFile
static XmlConfigurationLoader xmlConfigLoader

Member Enumeration Documentation

Enumerator:
EXECUTE_LOCAL 
EXECUTE_REMOTE  Only execute Event locally.
EXECUTE_GLOBAL  Send Event to remote Users, but don't execute it locally.


Member Function Documentation

void EventManager::activateLogging ( std::string  logFile,
bool  append = false 
) [static]

Activate logging for all sent and received Events. The logfile will only be written, when one of the methods cleanup(), deactivateLogging(), or dump() is called.

Parameters:
logFile path to the logfile
append sets append or overwrite mode.

void EventManager::cleanup (  )  [static]

Free all EventFactories and Pipes, and flush the logfile.

void EventManager::deactivateLogging (  )  [static]

Deactivate logging and flush the logfile.

Event * EventManager::decode ( NetMessage msg  )  [static, private]

void EventManager::dump (  )  [static]

Flush the logfile.

void EventManager::generateHashValues (  )  [static, private]

static EventPipe* EventManager::getPipe ( OSG::UInt8  id  )  [static]

Get the EventPipe for incoming Events for the given module.

Parameters:
id numerical module id (as defined in ModuleIds.h)

void EventManager::init (  )  [static]

Initialise the EventManager. Must be called before any other EventManager method is used.

bool EventManager::loadConfig ( std::string  configFile  )  [static]

Loads the configuration of the EventManager

void EventManager::putEventInPipe ( Event event  )  [static, private]

void EventManager::registerEventFactory ( std::string  name,
AbstractEventFactory evtFact 
) [static]

Register an EventFactory with a given name. There can only be one factory per name, so calling this method twice with the same name (and Factories != NULL will not accomplish anything. To deregister a Factory, call registerEventFactory with the desired name and NULL as Factory.

Parameters:
name Specifies the name of the Event type the factory produces.
evtFact A Factory for Events of the given name, or null.

void EventManager::registerNetwork ( NetworkInterface netInt  )  [static]

Register a NetworkInterface for sending remote Events. A NetworkInterface can only be set before calling EventManager::start().

void EventManager::run ( void *  dummy  )  [static, private]

Internal function to be called by the ThreadManager. Process events until EventManager::stop() is called.

void EventManager::sendEvent ( Event event,
EXECUTION_MODE  mode 
) [static]

Send an Event to the recipients indecated by the mode parameter. Note: Events are always deleted by the receiver, not the sender.

void EventManager::sendEventTo ( Event event,
unsigned  userId 
) [static]

Send an Event to the User with the specified userId. Note: Events are always deleted by the receiver, not the sender.

void EventManager::start (  )  [static]

Start the EventManager. This method creates and starts a new Thread for the EventManager.

void EventManager::stop (  )  [static]

Stop the EventManager.


Member Data Documentation

bool EventManager::createNewLogFile = true [static, private]

std::map< std::string, AbstractEventFactory * > EventManager::eventFactoryMap [static, private]

std::map< std::string, unsigned > EventManager::eventHashMap [static, private]

std::vector< std::string > EventManager::eventLogList [static, private]

Thread * EventManager::eventRecvThread = NULL [static, private]

std::map< unsigned, AbstractEventFactory * > EventManager::hashEventFactoryMap [static, private]

std::map< unsigned, std::string > EventManager::idToEventName [static, private]

OSG_USING_NAMESPACE bool EventManager::initialized = false [static, private]

bool EventManager::isLogging = false [static, private]

bool EventManager::isRunning = false [static, private]

std::string EventManager::logFile [static, private]

Lock * EventManager::loggingLock [static, private]

EventPipe * EventManager::pipes [static, private]

unsigned EventManager::sequenceNumber = 0 [static, private]

bool EventManager::shutdown = false [static, private]


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

Generated on Wed Oct 20 16:11:56 2010 for inVRs by doxygen 1.5.8