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.

Collaboration diagram for Event:

List of all members.


Public Member Functions

 Event ()
 Event (unsigned srcModuleId, unsigned dstModuleId, std::string eventName)
 empty constructor, for network deserialization
virtual ~Event ()
NetMessagecompleteEncode ()
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.

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  ) 

Force a specific sequence number for the Event. Normally, each Event automatically gets a sequence number on creation. You can override that sequence number with this method. Note: The sequence number is not neccessarily unique.


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:
  • src/inVRs/SystemCore/EventManager/Event.h
  • src/inVRs/SystemCore/EventManager/Event.cpp

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