StateBaseImpl.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include "StateBase.h"
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 
23  mutable Mutex initMutex;
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
armarx::StateBase::Impl::__processEventsMutex
HiddenTimedMutex __processEventsMutex
Definition: StateBaseImpl.h:42
armarx::StateBase::Impl::__processEventMutex
RecursiveMutex __processEventMutex
Definition: StateBaseImpl.h:41
armarx::StateBase::Impl::__parentState
StateBase * __parentState
Definition: StateBaseImpl.h:62
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:54
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:295
armarx::StateBase::Impl::Impl
Impl()
Definition: StateBaseImpl.h:12
armarx::StateBase::Impl::manager
StatechartManager * manager
Definition: StateBaseImpl.h:34
armarx::HiddenTimedMutex
Definition: Synchronization.h:88
armarx::StatechartContextInterface
Definition: StatechartContextInterface.h:45
armarx::StateBase::Impl::statePhase
StatePhase statePhase
Definition: StateBaseImpl.h:25
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:77
armarx::StateBase::Impl::StateInstanceMap
std::map< int, StateBase * > StateInstanceMap
Definition: StateBaseImpl.h:56
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:59
armarx::ConditionalVariable
boost::condition_variable ConditionalVariable
Definition: Synchronization.h:177
armarx::StateBase::Impl::__LocalIdCounter
static int __LocalIdCounter
Unique Identifier counter for this process for identifing states.
Definition: StateBaseImpl.h:37
armarx::StateBase::Impl::initCondition
ConditionalVariable initCondition
Definition: StateBaseImpl.h:22
armarx::StateBase::Impl::initMutex
Mutex initMutex
Definition: StateBaseImpl.h:23
Synchronization.h
armarx::StateBase::Impl::stateInstancesPtr
StateInstanceMapPtr stateInstancesPtr
Definition: StateBaseImpl.h:60
armarx::StateBase::Impl::__eventUnbreakableBufferMutex
HiddenTimedMutex __eventUnbreakableBufferMutex
Definition: StateBaseImpl.h:40
armarx::StateBase
Definition: StateBase.h:59
armarx::StateBase::Impl::inputInheritance
std::vector< std::string > inputInheritance
Definition: StateBaseImpl.h:45
armarx::StateBase::ePreDefined
@ ePreDefined
Definition: StateBase.h:297
armarx::StateBase::Impl::__stateMutex
HiddenTimedMutex __stateMutex
Definition: StateBaseImpl.h:43
armarx::StateBase::Impl::StateInstanceMapPtr
std::shared_ptr< StateInstanceMap > StateInstanceMapPtr
Definition: StateBaseImpl.h:57
StateBase.h
armarx::StateBase::Impl::context
StatechartContextInterface * context
Pointer to the StatechartContext to the single instance per application.
Definition: StateBaseImpl.h:33
armarx::Mutex
boost::mutex Mutex
Definition: Synchronization.h:149
armarx::StateBase::Impl::__useRunFunction
bool __useRunFunction
Definition: StateBaseImpl.h:49
armarx::StateBase::Impl::cancelEnteringSubstates
bool cancelEnteringSubstates
GetActiveStateLeafs returns the list of leaf-states that are active at the moment.
Definition: StateBaseImpl.h:87
armarx::RecursiveMutex
boost::recursive_mutex RecursiveMutex
Definition: Synchronization.h:159
armarx::StateBase::Impl
Definition: StateBaseImpl.h:10
armarx::StateBase::Impl::__eventBufferMutex
RecursiveMutex __eventBufferMutex
Definition: StateBaseImpl.h:39
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::StatechartManager
Definition: StatechartManager.h:40
armarx::StateBase::Impl::visitCounter
long visitCounter
Definition: StateBaseImpl.h:46
armarx::StateBase::Impl::statePhaseMutex
Mutex statePhaseMutex
Definition: StateBaseImpl.h:26
armarx::StateBase::Impl::__StateInstancesMutex
static HiddenTimedMutex * __StateInstancesMutex
Definition: StateBaseImpl.h:38
armarx::StateBase::Impl::localUniqueId
int localUniqueId
An in this process unique id for the state.
Definition: StateBaseImpl.h:67