EventManager Class Reference
#include <EventManager.h>

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 EventPipe * | getPipe (OSG::UInt8 id) |
Static Private Member Functions | |
| static void | putEventInPipe (Event *event) |
| static Event * | decode (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 EventPipe * | pipes [256] |
| static NetworkInterface * | networkController |
| 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
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] |
| 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] |
NetworkInterface * EventManager::networkController [static, private] |
EventPipe * EventManager::pipes [static, private] |
unsigned EventManager::sequenceNumber = 0 [static, private] |
bool EventManager::shutdown = false [static, private] |
XmlConfigurationLoader EventManager::xmlConfigLoader [static, private] |
The documentation for this class was generated from the following files:
- src/inVRs/SystemCore/EventManager/EventManager.h
- src/inVRs/SystemCore/EventManager/EventManager.cpp
Generated on Wed Oct 20 16:11:56 2010 for inVRs by
1.5.8