DynamicRemoteState Class Reference

DynamicRemoteStates can be used to connect to remote statecharts dynamically at runtime. More...

#include <ArmarXCore/statechart/DynamicRemoteState.h>

+ Inheritance diagram for DynamicRemoteState:

Public Member Functions

bool _baseOnBreak (const EventPtr evt) override
 If the call to RemoteState::_baseOnBreak() returns true the input parameters are redefined. More...
 
void _baseOnEnter () override
 Does the setup of the remote statechart and calls RemoteState::_baseOnEnter() afterwards. More...
 
void _baseOnExit () override
 Calls RemoteState::_baseOnBreak() and redefines the input parameters. More...
 
StateBasePtr clone () const override
 
StateBasePtr createEmptyCopy () const override
 
void defineParameters () override
 
 DynamicRemoteState ()
 Initialize all instance variables. More...
 
 DynamicRemoteState (const DynamicRemoteState &source)
 Create a copy of source. More...
 
std::string getDefaultName () const override
 Retrieve default name of component. More...
 
void onConnectComponent () override
 Pure virtual hook for the subclass. More...
 
void onInitComponent () override
 Pure virtual hook for the subclass. More...
 
DynamicRemoteStateoperator= (const DynamicRemoteState &source)
 Assignment operator which currently is set to fail on any invocation. More...
 
- Public Member Functions inherited from RemoteState
StateBasePtr clone () const override
 Pure virtual function to clone of the derived class type. More...
 
StateBasePtr createEmptyCopy () const override
 
std::string getDefaultName () const override
 Retrieve default name of component. More...
 
StateParameterMap getInputParameters () override
 Not const because RemoteState implementation gets the current parameters via Ice and sets them. More...
 
StateParameterMap & getOutputParameters () override
 
StateIceBasePtr getParentStateLayout (const Ice::Current &) const override
 
StateBasePtr getRemoteStatePtr ()
 Function that retrieves a copy of the remoteState. Calling functions or setting members on this instance won't have any effect. More...
 
::Ice::Int getRemoteUnbreakableBufferSize (const ::Ice::Current &=Ice::emptyCurrent) const override
 
bool getRemoteUnbreakableBufferStati (const ::Ice::Current &=Ice::emptyCurrent) const override
 
bool isInitialized () const override
 Returns the status of this state. Only if a state is initialized, it can be used. More...
 
void onConnectComponent () override
 Pure virtual hook for the subclass. More...
 
void onDisconnectComponent () override
 Hook for subclass. More...
 
void onInitComponent () override
 Pure virtual hook for the subclass. More...
 
RemoteStateoperator= (const RemoteState &source)
 
void remoteEnqueueEvent (const EventBasePtr &evt, const ::Ice::Current &c=Ice::emptyCurrent) override
 
void remoteFinalize (const StringVariantContainerBaseMap &properties, const EventBasePtr &event, const ::Ice::Current &c=Ice::emptyCurrent) override
 
void remoteProcessBufferedEvents (const ::Ice::Current &c=Ice::emptyCurrent) override
 
void remoteProcessEvent (const EventBasePtr &evt, bool buffered, const ::Ice::Current &c=Ice::emptyCurrent) override
 
void remoteRefetchSubstates (const ::Ice::Current &c=Ice::emptyCurrent)
 
 RemoteState ()
 
 RemoteState (const RemoteState &source)
 
void setOutput (const ::armarx::StringVariantContainerBaseMap &properties, const ::Ice::Current &c=Ice::emptyCurrent)
 
void setProxyName (const std::string &proxyName)
 
void setStateName (const std::string &stateName)
 
bool waitForInitialization (int timeoutMS) const override
 
 ~RemoteState () override
 
- Public Member Functions inherited from State
virtual RemoteStatePtr addDynamicRemoteState (std::string instanceName)
 Function to add a new dynamic remote substate to this state. More...
 
virtual RemoteStatePtr addRemoteState (std::string stateName, std::string proxyName, std::string instanceName="")
 Function to add a new remote substate to this state. More...
 
StateBasePtr addState (StateBasePtr pNewState)
 
template<>
StatePtr addState (std::string const &stateName)
 
template<>
StatePtr addState (std::string const &stateName)
 
template<class derivedState >
IceInternal::Handle< derivedState > addState (std::string const &stateName="")
 Function to add a new substate to this state. Should be called in the defineState()-function. More...
 
bool addToInput (const std::string &key, const ContainerType &type, bool optional, VariantContainerBasePtr defaultValue=VariantContainerBasePtr())
 Adds a key,type-pair to the input parameters. More...
 
bool addToInput (const std::string &key, VariantTypeId type, bool optional, VariantPtr defaultValue=VariantPtr())
 Adds a new parameter list to the input parameters with a specific type. More...
 
bool addToLocal (const std::string &key, const ContainerType &type, VariantContainerBasePtr defaultValue=VariantContainerBasePtr())
 Adds a new parameter list to the local parameters with a specific type. More...
 
bool addToLocal (const std::string &key, VariantTypeId type, VariantPtr defaultValue=VariantPtr())
 Adds a key,type-pair to the local parameters. More...
 
bool addToOutput (const std::string &key, const ContainerType &type, bool optional)
 Adds a new parameter list to the output parameters with a specific type. More...
 
bool addToOutput (const std::string &key, VariantTypeId type, bool optional)
 Adds a key,type-pair to the output parameters. More...
 
TransitionIceBase & addTransition (EventPtr event, StateIceBasePtr sourceState, StateIceBasePtr destinationState, ParameterMappingIceBasePtr mappingToNextStatesInput=nullptr, ParameterMappingIceBasePtr mappingToParentStatesLocal=nullptr, ParameterMappingIceBasePtr mappingToParentStatesOutput=nullptr)
 
template<class EventType >
TransitionIceBase & addTransition (StateIceBasePtr sourceState, StateIceBasePtr destinationState, ParameterMappingIceBasePtr mappingToNextStatesInput=nullptr, ParameterMappingIceBasePtr mappingToParentStatesLocal=nullptr, ParameterMappingIceBasePtr mappingToParentStatesOutput=nullptr)
 Function to add a new transition between to substates to this state. More...
 
template<class EventType >
TransitionIceBase & addTransitionFromAllStates (StateIceBasePtr destinationState, ParameterMappingIceBasePtr mappingToNextStatesInput=nullptr, ParameterMappingIceBasePtr mappingToParentStatesLocal=nullptr, ParameterMappingIceBasePtr mappingToParentStatesOutput=nullptr)
 Function to add a new transition from all substates to destinationState. More...
 
void cancelSubstates ()
 Use this function in the onEnter() function, if you want to avoid that the substates (i.e. More...
 
StateBasePtr clone () const override
 Generates a new copy of this state with the same statename, substates, transitions, overidden functions etc. More...
 
StateBasePtr createEmptyCopy () const override
 Generates a new copy of this state with the same overidden functions. stateName, substates, transition etc. are not set. More...
 
std::string getGlobalIdString () const
 Getter for the global state identifier string. More...
 
unsigned int getId () const
 Returns an id to this state, that is guaranteed to be unique in this process. More...
 
StateBasePtr getInitState () const
 Getter for the initial state. The initial state is automatically entered, when this state is entered. More...
 
template<typename T >
std::enable_if_t< std::is_base_of_v< VariantDataClass, T >, IceInternal::Handle< T > > getInput (const std::string &key) const
 getInput can be used to access a specific input parameter.
More...
 
template<typename T >
std::enable_if_t< !(std::is_base_of_v< VariantDataClass, T >||std::is_base_of_v< VariantContainerBase, T >), TgetInput (const std::string &key) const
 getInput can be used to access a specific input parameter.
More...
 
VariantPtr getInput (const std::string &key) const
 getInput can be used to access a specific input parameter. More...
 
StateParameterMap getInputParameters () override
 Returns a new copy of the inputparameters-dictionary, so that the caller cannot modify them (const won't work due to pointers). More...
 
template<typename T >
std::enable_if_t< std::is_base_of_v< VariantDataClass, T >, IceInternal::Handle< T > > getLocal (const std::string &key) const
 getLocal can be used to access a specific input parameter.
More...
 
template<typename T >
std::enable_if_t< !(std::is_base_of_v< VariantDataClass, T >||std::is_base_of_v< VariantContainerBase, T >), TgetLocal (const std::string &key) const
 getLocal can be used to access a specific input parameter.
More...
 
VariantContainerBasePtr getLocalContainer (std::string const &key)
 
StateParameterMap & getLocalParameters ()
 Getter for the local parameter map. More...
 
template<typename T >
std::enable_if_t< std::is_base_of_v< VariantDataClass, T >, IceInternal::Handle< T > > getOutput (const std::string &key) const
 getOutput can be used to access a specific input parameter.
More...
 
template<typename T >
std::enable_if_t< !(std::is_base_of_v< VariantDataClass, T >||std::is_base_of_v< VariantContainerBase, T >), TgetOutput (const std::string &key) const
 getOutput can be used to access a specific input parameter.
More...
 
StateParameterMap & getOutputParameters () override
 getter function to get the map of output parameters More...
 
void inheritInputFromSubstate (std::string stateName)
 
bool init (StatechartContextInterface *context, StatechartManager *manager)
 Function to initialize this state. Must be called in the highest level of the hierarchy - and only there. More...
 
bool isInputParameterSet (const std::string &key) const
 Checks whether a given input parameter is set or not. More...
 
bool isLocalParameterSet (const std::string &key) const
 
bool isOutputParameterSet (const std::string &key) const
 
bool isUnbreakable () const
 
StateBasePtr setInitState (StateBasePtr initState, ParameterMappingPtr initialStateMapping=ParameterMappingPtr())
 Sets the initial substate of this state. More...
 
void setInput (std::string const &key, const Variant &value)
 setInput() sets an input parameter. More...
 
void setInput (std::string const &key, const VariantContainerBase &valueList)
 setInput() sets an input parameter list. More...
 
void setLocal (std::string const &key, const Variant &value)
 setLocal() sets a local parameter. More...
 
void setLocal (std::string const &key, const VariantContainerBase &valueList)
 setLocal() sets a local parameter list. More...
 
void setOutput (std::string const &key, const Variant &value)
 setOuput() sets an output parameter of this state.
More...
 
void setOutput (std::string const &key, const VariantContainerBase &valueList)
 setOuput() sets an output parameter LIST of this state.
More...
 
void setStateClassNameFromTypeName (const std::string &typeName)
 
void setStateName (const std::string &newName)
 
void setUnbreakable (bool setUnbreakable=true)
 With this function the state can be made unbreakable. More...
 
void setUseRunFunction (bool useRunFuntion)
 setUseRunFunction can be used to configurate whether the thread with the async. More...
 
- Public Member Functions inherited from StateUtility
template<class EventClass >
EventPtr createEvent ()
 Utility function to create a new Event. More...
 
EventPtr createEvent (const std::string &eventName, const StringVariantContainerBaseMap &properties=StringVariantContainerBaseMap())
 Utility function to create a new Event. More...
 
- Public Member Functions inherited from StateController
bool __applyMappings (const StateControllerPtr &srcState, const TransitionIceBase &t, const EventPtr &event, TransitionError &error)
 Apply the mappings during a transitions. More...
 
bool __checkExistenceOfTransition (const TransitionIceBase &transition)
 
virtual void __enqueueEvent (const EventPtr event)
 
virtual void __finalize (const EventPtr event)
 Function that gets called, when a state enters a FinalSubstate. Virtual function, so that RemoteStateWrapper can override it. More...
 
bool __findValidTransition (const EventPtr &event, const StateIceBasePtr &sourceState, TransitionIceBase &resultTransition, TransitionError &error) const
 
StateControllerPtr __getParentState () const
 Getter function that automatically casts the parentState member of StateBase into StateControllerPtr. More...
 
virtual unsigned int __getUnbreakableBufferSize () const
 
virtual bool __getUnbreakableBufferStati () const
 Before:Function to get the unbreakable-buffer status of all parent state - recursively. More...
 
void __printTransitionError (const TransitionError &transitionError, const EventPtr &event) const
 
virtual void __processBufferedEvents ()
 Processes buffered events, that could not be processed immediately due to unbreakable substates. More...
 
virtual void __processEvent (const EventPtr event, bool buffered=false)
 Main function to control the statemachine/state. More...
 
virtual void __substatesFinished (const EventPtr ev)
 Function that gets called, when a state enters a FinalSubstate. Virtual function, so that RemoteStateWrapper can override it. More...
 
TransitionError __validateTransition (const TransitionIceBase &transition, const EventPtr event, const StateIceBasePtr &sourceState, const StateIceBasePtr &destinationState) const
 
void __waitForRemoteStates () const
 
virtual void _baseRun ()
 
virtual void _startRun ()
 
void addProfilerRecursive (Profiler::ProfilerPtr profiler, int recursiveLevels=0)
 addProfilerRecursive recursively adds a new armarx::Profiler::Profiler object as armarx::StateController::localProfiler(the default one does not do anything at all). More...
 
void addTransitionFunction (const TransitionIceBase &t, transitionFunction function)
 
void disableRunFunction ()
 disableRunFunction sets useRunFunction to false and waits (blocking) for the current StateBase::run() function to complete. More...
 
void disableStateReporting (bool disable=true)
 Disables the reporting to profilers for this states during state visits. More...
 
void enter (const StringVariantContainerBaseMap &tempInputParameters=StringVariantContainerBaseMap())
 Function to set the statemachine in the first state and call OnEnter(). More...
 
bool findTransition (const std::string &eventName, const std::string sourceStateName, TransitionIceBase &transition)
 
std::string getTransitionID (const std::string &eventName, const std::string sourceStateName) const
 
std::string getTransitionID (const TransitionIceBase &t) const
 
bool isFinished () const
 
bool isRunningTaskFinished () const
 Checks whether the run() function has already finished. More...
 
bool isRunningTaskStopped () const
 isRunningTaskStopped checks whether the RunningTask, that executes run() is requested to stop. More...
 
void removeProfilerRecursive (Profiler::ProfilerPtr profiler, int recursiveLevels=0)
 
 StateController ()
 
 StateController (const StateController &source)
 
void waitForRunningTaskToFinish () const
 Waits until the run-function has finished. More...
 
void waitForStateToFinish (int timeoutMs=-1) const
 waitForStateToFinish waits until this thread has finished (i.e. More...
 
 ~StateController () override
 
- Public Member Functions inherited from StateBase
void __checkPhase (const std::vector< StatePhase > &allowedTypes, const char *functionName) const
 
void __checkPhase (StatePhase allowedType, const char *functionName) const
 Helper function for checking if a function was called in valid position of the statechart. More...
 
void __checkPhaseMin (StatePhase allowedType, const char *functionName) const
 
void __copyDefaultValuesToInput ()
 
StringVariantContainerBaseMap __getSetInputAndLocalParameters () const
 Combines both maps to one map and returns a new map of only the set parameters. More...
 
void __setParentState (StateBase *parentState)
 
void __throwUnknownParameter (const StateParameterMap &paramMap, const std::string &key) const
 
void __updateGlobalStateId ()
 
bool addParameter (StateParameterMap &paramMap, const std::string &key, VariantTypeId type, bool optional, VariantPtr defaultValue=VariantPtr()) const
 
bool addParameterContainer (StateParameterMap &paramMap, const std::string &key, const ContainerType &containerType, bool optional, VariantContainerBasePtr defaultValue=VariantContainerBasePtr()) const
 
void clearSelfPointer ()
 
virtual void deepCopy (const StateBase &sourceState, bool reset=true)
 Function to copy the states with all it substates and transitions. More...
 
virtual void defineState ()
 Virtual function, in which this state can be configured. More...
 
virtual void defineSubstates ()
 Virtual function, in which substates, transition and mappings can be added. More...
 
StateBasePtr findSubstateByName (const std::string &substateName)
 Utility function to find a substate of this state by the name. More...
 
template<typename ContextType >
ContextType * getContext () const
 
StatechartContextInterfacegetContext (bool checkNULL=true) const
 
std::string getGlobalHierarchyString () const
 
std::string getLocalHierarchyString () const
 Function to get a string that contains als parent states and this state. (e.g. "Robot->Functional->Idling") More...
 
Ice::Int getLocalUniqueId () const
 
void getParameter (const StateParameterMap &paramMap, const std::string &key, VariantPtr &value) const
 
void getParameterContainer (const StateParameterMap &paramMap, const std::string &key, VariantContainerBasePtr &valueContainer) const
 
const std::string & getStateClassName () const
 
std::string getStateName () const
 getStateName More...
 
StatePhase getStatePhase () const
 
EventPtr getTriggeredEndstateEvent () const
 This function returns the event that was triggered by entering an endstate. More...
 
void inheritInputParameters ()
 
bool init (StatechartContextInterface *context, StatechartManager *manager)
 Function to initialize this state. Must be called in the highest level of the hierarchy - and only there. More...
 
bool isParameterSet (const StateParameterMap &paramMap, const std::string &key) const
 
virtual void onBreak ()
 Virtual function, in which the behaviour of state is defined, when it is abnormally exited. Can be overridden, but it is optional.
An abnormal exit only occurs in hierarchy-levels greater 1.
When a parent state is left before the substates are finished, the OnBreak()-function is called in the active substate and in all it's active substates.
If this function is not implemented, the normal OnExit()-function is called.
More...
 
virtual void onEnter ()
 Virtual function, in which the behaviour of state is defined, when it is entered.
Can be overridden, but it is optional. More...
 
virtual void onExit ()
 Virtual function, in which the behaviour of state is defined, when it is exited. Can be overridden, but it is optional. More...
 
StateBaseoperator= (const StateBase &source)
 
void reset ()
 Function to reset the state: clear name, clear substatesList, clear transition etc. More...
 
virtual void run ()
 Virtual function, that can be reimplemented to calculate complex operations. More...
 
void setContext (StatechartContextInterface *context)
 
void setInitialized (bool enable)
 
void setParameter (StateParameterMap &paramMap, const std::string &key, const Variant &variant)
 
void setParameterContainer (StateParameterMap &paramMap, const std::string &key, const VariantContainerBase &valueContainer)
 
void setParameterContainer (StateParameterMap &paramMap, const std::string &key, const VariantContainerBasePtr &valueContainer)
 
void setStateClassName (std::string className)
 setStateClassName() sets the string, that contains a stringrepresentation of this class. Should not be called usually. The classname gets automatically set in the constructor of the derived class StateTemplate<T>. More...
 
void setStatePhase (StatePhase newPhase)
 
 StateBase ()
 
 StateBase (const StateBase &source)
 
 ~StateBase () override
 
- Public Member Functions inherited from Logging
SpamFilterDataPtr deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
 disables the logging for the current line for the given amount of seconds. More...
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More...
 
void setTag (const LogTag &tag)
 
void setTag (const std::string &tagName)
 
virtual ~Logging ()
 
- Public Member Functions inherited from ManagedIceObject
void enableProfiler (bool enable)
 setProfiler allows setting ManagedIceObject::profiler to a new instance (if the new instance is actually not a null pointer) More...
 
std::string generateSubObjectName (const std::string &subObjectName)
 Generates a unique name for a sub object from a general name. More...
 
ArmarXManagerPtr getArmarXManager () const
 Returns the ArmarX manager used to add and remove components. More...
 
ManagedIceObjectConnectivity getConnectivity () const
 Retrieve connectivity of the object (topcis as well as proxies) More...
 
IceManagerPtr getIceManager () const
 Returns the IceManager. More...
 
VariantBasePtr getMetaInfo (const std::string &id)
 
StringVariantBaseMap getMetaInfoMap () const
 
std::string getName () const
 Retrieve name of object. More...
 
Ice::ObjectAdapterPtr getObjectAdapter () const
 Returns object's Ice adapter. More...
 
ArmarXObjectSchedulerPtr getObjectScheduler () const
 
PeriodicTaskPtr getPeriodicTask (const std::string &name)
 
Profiler::ProfilerPtr getProfiler () const
 getProfiler returns an instance of armarx::Profiler More...
 
template<class ProxyTarg , class... Args>
void getProxy (const char *name, IceInternal::ProxyHandle< ProxyTarg > &proxy, Args &&...args)
 
template<class ProxyType >
ProxyType getProxy (const std::string &name, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true)
 Retrieves a proxy object. More...
 
template<class ProxyTarg , class... Args>
void getProxy (const std::string &name, IceInternal::ProxyHandle< ProxyTarg > &proxy, Args &&...args)
 
template<class ProxyTarg , class... Args>
void getProxy (IceInternal::ProxyHandle< ProxyTarg > &proxy, const char *name, Args &&...args)
 
template<class ProxyTarg , class... Args>
void getProxy (IceInternal::ProxyHandle< ProxyTarg > &proxy, const std::string &name, Args &&...args)
 Assigns a proxy to proxy. More...
 
Ice::ObjectPrx getProxy (long timeoutMs=0, bool waitForScheduler=true) const
 Returns the proxy of this object (optionally it waits for the proxy) More...
 
template<class Prx >
Prx getProxy (long timeoutMs=0, bool waitForScheduler=true) const
 
template<class ProxyType >
void getProxy (ProxyType &proxy, const char *name, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true)
 Overload to allow using string literals as name (solve ambiguous overload). More...
 
template<class Prx >
void getProxy (Prx &prx, long timeoutMs=0, bool waitForScheduler=true) const
 
int getState () const
 Retrieve current state of the ManagedIceObject. More...
 
template<class TopicProxyType >
TopicProxyType getTopic (const std::string &name)
 Returns a proxy of the specified topic. More...
 
template<class TopicProxyType >
void getTopic (TopicProxyType &topicProxy, const std::string &name)
 Assigns a proxy of the specified topic to topicProxy. More...
 
std::vector< std::string > getUnresolvedDependencies () const
 returns the names of all unresolved dependencies More...
 
 ManagedIceObject (ManagedIceObject const &other)
 
void offeringTopic (const std::string &name)
 Registers a topic for retrival after initialization. More...
 
void preambleGetTopic (std::string const &name)
 
void setMetaInfo (const std::string &id, const VariantBasePtr &value)
 Allows to set meta information that can be queried live via Ice interface on the ArmarXManager. More...
 
void startPeriodicTask (const std::string &uniqueName, std::function< void(void)> f, int periodMs, bool assureMeanInterval=false, bool forceSystemTime=true)
 
bool stopPeriodicTask (const std::string &name)
 
bool unsubscribeFromTopic (const std::string &name)
 Unsubscribe from a topic. More...
 
bool usingProxy (const std::string &name, const std::string &endpoints="")
 Registers a proxy for retrieval after initialization and adds it to the dependency list. More...
 
void usingTopic (const std::string &name, bool orderedPublishing=false)
 Registers a proxy for subscription after initialization. More...
 
void waitForObjectScheduler ()
 Waits until the ObjectScheduler could resolve all dependencies. More...
 
void waitForProxy (std::string const &name, bool addToDependencies)
 

Additional Inherited Members

- Public Types inherited from StateController
using transitionFunction = std::function< void(StateController *state, const StateIceBasePtr &nextState, const StateIceBasePtr &previousState)>
 
using TransitionFunctionMap = std::map< std::string, transitionFunction >
 
- Public Types inherited from StateBase
enum  StatePhase {
  ePreDefined, eStatechartDefinitions, eSubstatesDefinitions, eParametersDefinitions,
  eDefined, eEntering, eEntered, eBreaking,
  eExiting, eExited
}
 enum that specifies the phase in which the state is currently in used to control the usage of state-functions in the correct context More...
 
- Public Types inherited from ManagedIceObject
using PeriodicTaskPtr = IceUtil::Handle< SimplePeriodicTask< std::function< void(void)> >>
 
- Static Public Member Functions inherited from StateBase
static std::vector< StateBasePtrGetActiveStateLeafs (StateBasePtr toplevelState)
 
- Static Public Member Functions inherited from ManagedIceObject
static std::string generateSubObjectName (const std::string &superObjectName, const std::string &subObjectName)
 Generates a unique name for a sub object from a general name and unique name. More...
 
static std::string GetObjectStateAsString (int state)
 
- Public Attributes inherited from StateController
std::unique_ptr< Implcimpl
 
- Public Attributes inherited from StateBase
std::unique_ptr< Implimpl
 
- Static Public Attributes inherited from ManagedIceObject
static const ManagedIceObjectPtr NullPtr
 A nullptr to be used when a const ref to a nullptr is required. More...
 
- Protected Member Functions inherited from RemoteState
bool __breakActiveSubstate (const EventPtr event) override
 Overridden function to redirect this call to the real state in the other application. More...
 
bool __hasActiveSubstate () override
 Overridden function to redirect this call to the real state in the other application. More...
 
bool __hasSubstates () override
 not used at the moment More...
 
void __notifyEventBufferedDueToUnbreakableState (bool eventBuffered) override
 Overridden function to redirect this call to the real state in the other application. More...
 
void __updateGlobalStateIdRecursive () override
 
bool _baseOnBreak (const EventPtr evt) override
 Called by processEvent()-function or parentstate. Must NOT be called by user. More...
 
void _baseOnEnter () override
 Overridden function to redirect this call to the real state in the other application. More...
 
void _baseOnExit () override
 Overridden function to redirect this call to the real state in the other application. More...
 
void refetchSubstates () override
 This functions updates the substates. More...
 
- Protected Member Functions inherited from State
Stateoperator= (const State &source)
 
 State ()
 
 State (const State &source)
 
 ~State () override
 
- Protected Member Functions inherited from StateUtility
ConditionIdentifier installCondition (const Term &condition, const EventPtr evt, const std::string &desc="")
 Utility function to install a condition on the distributed conditionhandler. More...
 
template<class Eventclass >
ConditionIdentifier installCondition (const Term &condition, const std::string &desc="")
 Utility function to install a condition on the distributed conditionhandler. More...
 
void removeCondition (ConditionIdentifier conditionId)
 Utility function to remove an installed condition on the distributed conditionhandler. More...
 
void removeCounterEvent (const ActionEventIdentifier &id)
 
void removeTimeoutEvent (const ActionEventIdentifier &id)
 
void sendEvent (const EventPtr event, StateBasePtr eventProcessor=nullptr)
 Function to send an event to a specific state from an onEnter()-function. Must not be called anywhere else. The event is processed after the onEnter()-function of this and all initial substates have returned.
Use of this function should be avoided since this statemachine is blocked until this event and all subsequent sendEvents() are processed. More...
 
template<class Event >
void sendEvent (StateBasePtr eventProcessor=nullptr)
 
ActionEventIdentifier setCounterEvent (int counterThreshold, const EventPtr &evt, int initialValue=0)
 
template<class Eventclass >
ActionEventIdentifier setCounterEvent (int counterThreshold, int initialValue=0)
 
template<class Eventclass >
ActionEventIdentifier setTimeoutEvent (int timeoutDurationMs)
 
ActionEventIdentifier setTimeoutEvent (int timeoutDurationMs, const EventPtr &evt)
 Utility function to start a timer on the systemObserver and register an event on the conditionHandler. The condition is automatically removed, when the state is left. More...
 
- Protected Member Functions inherited from Logging
bool checkLogLevel (MessageTypeT level) const
 
const LogSenderPtrgetLogSender () const
 Retrieve log sender. More...
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 
- Protected Member Functions inherited from ManagedIceObject
template<class PluginT , class... ParamsT>
PluginT * addPlugin (const std::string prefix="", ParamsT &&...params)
 
template<class PluginT , class... ParamsT>
void addPlugin (PluginT *&targ, const std::string prefix="", ParamsT &&...params)
 
template<class PluginT , class... ParamsT>
void addPlugin (std::experimental::observer_ptr< PluginT > &targ, const std::string prefix="", ParamsT &&...params)
 
Ice::CommunicatorPtr getCommunicator () const
 
std::unique_ptr< ManagedIceObjectPlugin > & getPluginPointer (std::type_info const &type, std::string const &prefix)
 
 ManagedIceObject ()
 Protected default constructor. More...
 
virtual void onExitComponent ()
 Hook for subclass. More...
 
virtual void postOnConnectComponent ()
 
virtual void postOnDisconnectComponent ()
 
virtual void postOnExitComponent ()
 
virtual void postOnInitComponent ()
 
virtual void preOnConnectComponent ()
 
virtual void preOnDisconnectComponent ()
 
virtual void preOnExitComponent ()
 
virtual void preOnInitComponent ()
 
bool removeProxyDependency (const std::string &name)
 This function removes the dependency of this object on the in parameter name specified object. More...
 
void setName (std::string name)
 Override name of well-known object. More...
 
void terminate ()
 Initiates termination of this IceManagedObject. More...
 
 ~ManagedIceObject () override
 
- Protected Attributes inherited from Logging
MessageTypeT minimumLoggingLevel
 
SpamFilterDataPtr spamFilter
 
LogTag tag
 

Detailed Description

DynamicRemoteStates can be used to connect to remote statecharts dynamically at runtime.

A DynamicRemoteState behaves like its parent class RemoteState with the exception that the both proxy and statename of the remote statechart are not known at compile time. Instead, both parameters are passed to the DynamicRemoteState instance at runtime via input parameters defined on the event leading to a transition to this instance.

To create a DynamicRemoteState instance in a statechart call the State::addDynamicRemoteState() function in StateBase::defineSubstates().

At runtime add the following input parameters to the transition event:

Definition at line 52 of file DynamicRemoteState.h.

Constructor & Destructor Documentation

◆ DynamicRemoteState() [1/2]

Initialize all instance variables.

Definition at line 37 of file DynamicRemoteState.cpp.

+ Here is the caller graph for this function:

◆ DynamicRemoteState() [2/2]

Create a copy of source.

Definition at line 45 of file DynamicRemoteState.cpp.

Member Function Documentation

◆ _baseOnBreak()

bool _baseOnBreak ( const EventPtr  evt)
overridevirtual

If the call to RemoteState::_baseOnBreak() returns true the input parameters are redefined.

See also
StateBase::_baseOnBreak()

Reimplemented from StateController.

Definition at line 258 of file DynamicRemoteState.cpp.

+ Here is the call graph for this function:

◆ _baseOnEnter()

void _baseOnEnter ( )
overridevirtual

Does the setup of the remote statechart and calls RemoteState::_baseOnEnter() afterwards.

The Event LoadingFailed is emitted if connecting to the remote statechart failed.

See also
StateBase::_baseOnEnter()

Reimplemented from StateController.

Definition at line 224 of file DynamicRemoteState.cpp.

+ Here is the call graph for this function:

◆ _baseOnExit()

void _baseOnExit ( )
overridevirtual

Calls RemoteState::_baseOnBreak() and redefines the input parameters.

See also
StateBase::_baseOnBreak()

Reimplemented from StateController.

Definition at line 249 of file DynamicRemoteState.cpp.

+ Here is the call graph for this function:

◆ clone()

StateBasePtr clone ( ) const
overridevirtual
See also
StateBase::clone()

Implements StateBase.

Definition at line 280 of file DynamicRemoteState.cpp.

+ Here is the call graph for this function:

◆ createEmptyCopy()

StateBasePtr createEmptyCopy ( ) const
overridevirtual
See also
StateBase::createEmptyCopy()

Implements StateBase.

Definition at line 273 of file DynamicRemoteState.cpp.

+ Here is the call graph for this function:

◆ defineParameters()

void defineParameters ( )
overridevirtual
See also
StateBase::defineParameters()

Reimplemented from StateBase.

Definition at line 289 of file DynamicRemoteState.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultName()

std::string getDefaultName ( ) const
overridevirtual

Retrieve default name of component.

Implement this method in each IceManagedObject. The default name of a is used if no name is specified in the factory method.

Returns
default name of the component (e.g. "KinematicUnit")

Implements ManagedIceObject.

Definition at line 74 of file DynamicRemoteState.cpp.

+ Here is the call graph for this function:

◆ onConnectComponent()

void onConnectComponent ( )
overridevirtual

Pure virtual hook for the subclass.

Is called once all dependencies of the object have been resolved and Ice connection is established. This hook is called whenever the dependencies are found. That means if the a depedency crashes or shuts down, the ManagedIceObject goes into disconnected state. When the dependencies are found again, this hook is called again.

See also
onDisconnectComponent()

Implements ManagedIceObject.

Definition at line 86 of file DynamicRemoteState.cpp.

+ Here is the call graph for this function:

◆ onInitComponent()

void onInitComponent ( )
overridevirtual

Pure virtual hook for the subclass.

Is called once initialization of the ManagedIceObject is done. This hook is called in the implenting class once and never again during the lifecyle of the object. This function is called as soon as the ManagedIceObject was added to the ArmarXManager. Called in an own thread and not the thread it was created in.

Implements ManagedIceObject.

Definition at line 81 of file DynamicRemoteState.cpp.

◆ operator=()

DynamicRemoteState & operator= ( const DynamicRemoteState source)

Assignment operator which currently is set to fail on any invocation.

Definition at line 64 of file DynamicRemoteState.cpp.


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