Event Class Reference
#include <Event.h>
Inherited by ChangedUserDataEvent, ChangeSynchronisationModelEvent, CreateCursorSpringConnectorEvent, DeleteCursorSpringConnectorEvent, IdPoolListenerFinalizeAllocationEvent, InteractionChangeStateEvent, InteractionHighlightSelectionActionEvent, InteractionHomerManipulationActionEvent, InteractionVirtualHandManipulationActionEvent, JointInteractionEvent, NavigationPauseEvent, NavigationResumeEvent, Physics2DSyncEvent, PhysicsSpringManipulationActionEvent, RequestEvent, RequestResponseEvent, StartSimulationEvent, SynchronisePhysicsEvent, SystemCoreRequestSyncEvent, TransformationManagerClosePipeEvent, TransformationManagerOpenPipeEvent, UserDatabaseAddUserEvent, UserDatabaseDropEntityEvent, UserDatabasePickUpEntityEvent, UserDatabaseRemoveUserEvent, WorldDatabaseCreateEntityEvent, WorldDatabaseDestroyEntityEvent, WorldDatabaseReloadEnvironmentsEvent, and WorldDatabaseSyncEvent.

Public Member Functions | |
| Event () | |
| Event (unsigned srcModuleId, unsigned dstModuleId, std::string eventName) | |
| empty constructor, for network deserialization | |
| virtual | ~Event () |
| NetMessage * | completeEncode () |
| void | completeDecode (NetMessage *message, std::string eventName) |
| virtual void | encode (NetMessage *message) |
| virtual void | decode (NetMessage *message) |
| virtual void | execute ()=0 |
| virtual std::string | toString () |
| void | setSequenceNumber (unsigned sequenceNumber) |
| std::string | getEventName () |
| unsigned | getUserId () |
| unsigned | getSrcModuleId () |
| unsigned | getDstModuleId () |
Public Attributes | |
| ArgumentVector | visibilityLevel |
Protected Member Functions | |
| void | setEventId (unsigned id) |
| void | setEventName (std::string newName) |
Static Protected Member Functions | |
| static unsigned | generateSequenceNumber () |
| id of user who triggered the event | |
Protected Attributes | |
| std::string | evt_eventName |
| unsigned | evt_eventId |
| the type of the Event (= className) | |
| unsigned | evt_srcModuleId |
| unsigned | evt_dstModuleId |
| id of module which puts event into event pipe (as defined in ModuleIds.h) | |
| unsigned | evt_sequenceNumber |
| id of module which runs execute() (as defined in ModuleIds.h) | |
| unsigned | evt_timestamp |
| only for booking | |
| unsigned | evt_userId |
| when event has been created | |
Friends | |
| class | EventManager |
Constructor & Destructor Documentation
| Event::Event | ( | ) |
| Event::Event | ( | unsigned | srcModuleId, | |
| unsigned | dstModuleId, | |||
| std::string | eventName | |||
| ) |
empty constructor, for network deserialization
Event constructor.
- Parameters:
-
srcModuleId the id (as defined in ModuleIds.h) of the Module of origin. dstModuleId the id (as defined in ModuleIds.h) of the recipient Module, where the Event is executed. eventName the (class-) name of the Event.
| Event::~Event | ( | ) | [virtual] |
Member Function Documentation
| void Event::completeDecode | ( | NetMessage * | message, | |
| std::string | eventName | |||
| ) |
Overwrite the attributes of this Event using the values contained in a NetMessage.
- Parameters:
-
message the NetMessage used as a prototype for the Event. eventId the
| NetMessage * Event::completeEncode | ( | ) |
Encodes the Event into a NetMessage. This (and only this) method is needed by the Network module to encode the Event.
| void Event::decode | ( | NetMessage * | message | ) | [virtual] |
Reimplemented in Physics2DSyncEvent, ChangedUserDataEvent, ChangeSynchronisationModelEvent, CreateCursorSpringConnectorEvent, CreateLinkedPhysicsEntityEvent, DeleteCursorSpringConnectorEvent, PhysicsSpringManipulationActionEvent, StartSimulationEvent, SynchronisePhysicsEvent, InteractionChangeStateEvent, InteractionChangeStateToFromManipulationEvent, InteractionHighlightSelectionActionEvent, InteractionVirtualHandManipulationActionEvent, InteractionHomerManipulationActionEvent, JointInteractionEvent, JointInteractionEndEvent, IdPoolListenerFreeIndexRequestEvent, IdPoolListenerVetoRequestEvent, IdPoolListenerFinalizeAllocationEvent, RequestEvent, RequestResponseEvent, SystemCoreRequestSyncEvent, TransformationManagerOpenPipeEvent, TransformationManagerClosePipeEvent, UserDatabasePickUpEntityEvent, UserDatabaseDropEntityEvent, UserDatabaseAddUserEvent, UserDatabaseRemoveUserEvent, WorldDatabaseSyncEvent, WorldDatabaseCreateEntityEvent, WorldDatabaseDestroyEntityEvent, and WorldDatabaseReloadEnvironmentsEvent.
| void Event::encode | ( | NetMessage * | message | ) | [virtual] |
- Todo:
- should Event::decode() and Event::encode() be protected?
describe Event::decode() and Event::encode()
Reimplemented in Physics2DSyncEvent, ChangedUserDataEvent, ChangeSynchronisationModelEvent, CreateCursorSpringConnectorEvent, CreateLinkedPhysicsEntityEvent, DeleteCursorSpringConnectorEvent, PhysicsSpringManipulationActionEvent, StartSimulationEvent, SynchronisePhysicsEvent, InteractionChangeStateEvent, InteractionChangeStateToFromManipulationEvent, InteractionHighlightSelectionActionEvent, InteractionVirtualHandManipulationActionEvent, InteractionHomerManipulationActionEvent, JointInteractionEvent, JointInteractionEndEvent, IdPoolListenerFreeIndexRequestEvent, IdPoolListenerVetoRequestEvent, IdPoolListenerFinalizeAllocationEvent, RequestEvent, RequestResponseEvent, SystemCoreRequestSyncEvent, TransformationManagerOpenPipeEvent, TransformationManagerClosePipeEvent, UserDatabasePickUpEntityEvent, UserDatabaseDropEntityEvent, UserDatabaseAddUserEvent, UserDatabaseRemoveUserEvent, WorldDatabaseSyncEvent, WorldDatabaseCreateEntityEvent, WorldDatabaseDestroyEntityEvent, and WorldDatabaseReloadEnvironmentsEvent.
| virtual void Event::execute | ( | ) | [pure virtual] |
Process the Event.
- Todo:
- write more precise description
Implemented in Physics2DSyncEvent, ChangedUserDataEvent, ChangeSynchronisationModelEvent, CreateCursorSpringConnectorEvent, CreateLinkedPhysicsEntityEvent, DeleteCursorSpringConnectorEvent, PhysicsSpringManipulationActionEvent, PhysicsBeginSpringManipulationActionEvent, PhysicsEndSpringManipulationActionEvent, StartSimulationEvent, SynchronisePhysicsEvent, InteractionChangeStateEvent, InteractionChangeStateToFromManipulationEvent, InteractionHighlightSelectionActionEvent, InteractionVirtualHandManipulationActionEvent, InteractionBeginVirtualHandManipulationActionEvent, InteractionEndVirtualHandManipulationActionEvent, InteractionHomerManipulationActionEvent, InteractionBeginHomerManipulationActionEvent, InteractionEndHomerManipulationActionEvent, JointInteractionBeginEvent, JointInteractionEndEvent, NavigationPauseEvent, NavigationResumeEvent, IdPoolListenerFinalizeAllocationEvent, RequestEvent, RequestResponseEvent, SystemCoreRequestSyncEvent, TransformationManagerOpenPipeEvent, TransformationManagerClosePipeEvent, UserDatabasePickUpEntityEvent, UserDatabaseDropEntityEvent, UserDatabaseAddUserEvent, UserDatabaseRemoveUserEvent, WorldDatabaseSyncEvent, WorldDatabaseCreateEntityEvent, WorldDatabaseDestroyEntityEvent, and WorldDatabaseReloadEnvironmentsEvent.
| unsigned Event::generateSequenceNumber | ( | ) | [static, protected] |
id of user who triggered the event
Return a sequence number for an Event. Not neccessarily unique. Note: current implementation just returns 0.
| unsigned Event::getDstModuleId | ( | ) |
| std::string Event::getEventName | ( | ) |
| unsigned Event::getSrcModuleId | ( | ) |
| unsigned Event::getUserId | ( | ) |
| void Event::setEventId | ( | unsigned | id | ) | [protected] |
Method for the EventManager to set the ID of the event for network transfer. The Eventmanager calls this method when the sendEvent or sendEventTo methods are called. It passes the calculated hash code for the event's name. This code is then encoded in the completeEncode method and used for identification of the event at decode time.
- Parameters:
-
id hash code of the Event's name
| void Event::setEventName | ( | std::string | newName | ) | [protected] |
| void Event::setSequenceNumber | ( | unsigned | sequenceNumber | ) |
| std::string Event::toString | ( | ) | [virtual] |
Return a string representation of the Event, containing all attributes.
Reimplemented in ChangedUserDataEvent, ChangeSynchronisationModelEvent, CreateCursorSpringConnectorEvent, DeleteCursorSpringConnectorEvent, StartSimulationEvent, SynchronisePhysicsEvent, JointInteractionBeginEvent, JointInteractionEndEvent, SystemCoreRequestSyncEvent, TransformationManagerOpenPipeEvent, TransformationManagerClosePipeEvent, UserDatabaseAddUserEvent, and UserDatabaseRemoveUserEvent.
Friends And Related Function Documentation
friend class EventManager [friend] |
Member Data Documentation
unsigned Event::evt_dstModuleId [protected] |
id of module which puts event into event pipe (as defined in ModuleIds.h)
unsigned Event::evt_eventId [protected] |
the type of the Event (= className)
std::string Event::evt_eventName [protected] |
unsigned Event::evt_sequenceNumber [protected] |
id of module which runs execute() (as defined in ModuleIds.h)
unsigned Event::evt_srcModuleId [protected] |
unsigned Event::evt_timestamp [protected] |
only for booking
unsigned Event::evt_userId [protected] |
when event has been created
Used for visibility management. Visibilty management heavily relies on a specific network module. The content of the visibilityLevel member will not be encoded! Arguments can be set at any time before the event has been transmitted (by the Event itself, the EventManager ...)
- See also:
- Network::sendEvent()
The documentation for this class was generated from the following files:
Generated on Wed Oct 20 16:11:56 2010 for inVRs by
1.5.8