Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Private Attributes | List of all members
orxonox::EventState Class Reference

The EventState contains information about an event state. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/Event.h>

Public Member Functions

 EventState (const FunctorPtr &statefunction, Identifier *subclass, bool bSink=false)
 
const FunctorPtrgetFunctor () const
 
void process (const Event &event, BaseObject *object)
 Processes an event (calls the set-function if the necessary conditions are met). More...
 

Private Attributes

int activeEvents_
 The number of events which affect this state and are currently active. More...
 
bool bProcessingEvent_
 This becomes true while the container processes an event (used to prevent loops) More...
 
bool bSink_
 Determines whether the EventState acts as an EventSink forwarding any Event (even if the state didn't change) or in the normal manner, only processing Events that change the state. More...
 
FunctorPtr statefunction_
 A functor to set the state. More...
 
Identifiersubclass_
 Originators must be an instance of this class (usually BaseObject, but some statefunctions allow a second argument with an originator of a specific class) More...
 

Detailed Description

The EventState contains information about an event state.

An event state is a state of an object, which can be changed by events. Event states are changed through functions. Possible functions headers for set event states are:

Note that SomeClass may be any class deriving from BaseObject. You will not receive events from originators of other classes. The actual class for SomeClass must be specified as the second argument of the XMLPortEventState() macro.

The this pointer of the affected object is hidden in the functors, because the events are processed in the BaseObject, but some statefunctions may be from child-classes.

Constructor & Destructor Documentation

orxonox::EventState::EventState ( const FunctorPtr statefunction,
Identifier subclass,
bool  bSink = false 
)
inline

Member Function Documentation

const FunctorPtr& orxonox::EventState::getFunctor ( ) const
inline
void orxonox::EventState::process ( const Event event,
BaseObject object 
)

Processes an event (calls the set-function if the necessary conditions are met).

Parameters
eventThe fired event
objectThe object whose state is affected by the event (only needed for debug output)

Member Data Documentation

int orxonox::EventState::activeEvents_
private

The number of events which affect this state and are currently active.

bool orxonox::EventState::bProcessingEvent_
private

This becomes true while the container processes an event (used to prevent loops)

bool orxonox::EventState::bSink_
private

Determines whether the EventState acts as an EventSink forwarding any Event (even if the state didn't change) or in the normal manner, only processing Events that change the state.

FunctorPtr orxonox::EventState::statefunction_
private

A functor to set the state.

Identifier* orxonox::EventState::subclass_
private

Originators must be an instance of this class (usually BaseObject, but some statefunctions allow a second argument with an originator of a specific class)


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