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