StateBaseImpl.h
Go to the documentation of this file.
1#pragma once
2
4
5#include "StateBase.h"
6
7namespace armarx
8{
9
11 {
12 Impl() :
14 __eventUnbreakableBufferMutex(30000, "__eventUnbreakableBufferMutex"),
15 __processEventsMutex(30000, "__processEventsMutex"),
16 __stateMutex(30000, "__stateMutex"),
17 __useRunFunction(true),
18 __parentState(nullptr)
19 {
20 }
21
24
27
28 /**
29 *Pointer to the StatechartContext to the single instance per
30 *application. Contains proxies to observers and units. Used to operate
31 *with distributed components over ice.
32 **/
35
36 //! Unique Identifier counter for this process for identifing states.
37 static int __LocalIdCounter;
38 static HiddenTimedMutex* __StateInstancesMutex; // pointer to prevent premature destruction
44
45 std::vector<std::string> inputInheritance;
47
48
50
51 /**
52 * @brief This variable contains the event of the end substate that was entered to leave this state.
53 */
55
56 using StateInstanceMap = std::map<int, StateBase*>;
57 using StateInstanceMapPtr = std::shared_ptr<StateInstanceMap>;
58 //! Static map that contains all the states that are alive in this process
61
63
64 /**
65 * An in this process unique id for the state
66 */
68
69 /**
70 * @brief This property is needed for identification at what time this
71 * state was entered the last time.
72 *
73 * The reason is, that events should only be processed by a state, if
74 * the events were installed in this visit to this state.
75 * @note not used yet.
76 */
78
79 /**
80 * @brief GetActiveStateLeafs returns the list of leaf-states that are
81 * active at the moment.
82 * @param toplevelState State from which the active substate is to be returned.
83 * @return List of active leaf-states. If no orthogonal states are used,
84 * the list has at most 1 item.
85 */
86
88 };
89
90} // namespace armarx
StatePhase
enum that specifies the phase in which the state is currently in used to control the usage of state-f...
Definition StateBase.h:296
boost::condition_variable ConditionalVariable
boost::mutex Mutex
boost::recursive_mutex RecursiveMutex
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< Event > EventPtr
Typedef of EventPtr as IceInternal::Handle<Event> for convenience.
Definition Event.h:40
std::vector< std::string > inputInheritance
RecursiveMutex __eventBufferMutex
RecursiveMutex __processEventMutex
static int __LocalIdCounter
Unique Identifier counter for this process for identifing states.
ConditionalVariable initCondition
EventPtr triggeredEndstateEvent
This variable contains the event of the end substate that was entered to leave this state.
StateInstanceMapPtr stateInstancesPtr
std::map< int, StateBase * > StateInstanceMap
HiddenTimedMutex __eventUnbreakableBufferMutex
HiddenTimedMutex __processEventsMutex
HiddenTimedMutex __stateMutex
StatechartManager * manager
long visitTimeStamp
This property is needed for identification at what time this state was entered the last time.
bool cancelEnteringSubstates
GetActiveStateLeafs returns the list of leaf-states that are active at the moment.
StatechartContextInterface * context
Pointer to the StatechartContext to the single instance per application.
std::shared_ptr< StateInstanceMap > StateInstanceMapPtr
int localUniqueId
An in this process unique id for the state.
static StateInstanceMapPtr StateInstances
Static map that contains all the states that are alive in this process.
static HiddenTimedMutex * __StateInstancesMutex