Orxonox
0.0.5 Codename: Arcturus
|
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 FunctorPtr & | getFunctor () 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... | |
Identifier * | subclass_ |
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... | |
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:
function()
function(bool state)
function(bool state, SomeClass originator)
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.
|
inline |
|
inline |
void orxonox::EventState::process | ( | const Event & | event, |
BaseObject * | object | ||
) |
Processes an event (calls the set-function if the necessary conditions are met).
event | The fired event |
object | The object whose state is affected by the event (only needed for debug output) |
|
private |
The number of events which affect this state and are currently active.
|
private |
This becomes true while the container processes an event (used to prevent loops)
|
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.
|
private |
A functor to set the state.
|
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)