27 #include <type_traits>
37 template <
class StateType>
73 unsigned int getId()
const;
109 template <
typename T>
122 template <
typename T>
124 std::is_base_of_v<VariantContainerBase, T>),
139 template <
class derivedState>
157 addRemoteState(std::string stateName, std::string proxyName, std::string instanceName =
"");
181 StateIceBasePtr sourceState,
182 StateIceBasePtr destinationState,
183 ParameterMappingIceBasePtr mappingToNextStatesInput =
nullptr,
184 ParameterMappingIceBasePtr mappingToParentStatesLocal =
nullptr,
185 ParameterMappingIceBasePtr mappingToParentStatesOutput =
nullptr);
196 template <
class EventType>
199 StateIceBasePtr destinationState,
200 ParameterMappingIceBasePtr mappingToNextStatesInput =
nullptr,
201 ParameterMappingIceBasePtr mappingToParentStatesLocal =
nullptr,
202 ParameterMappingIceBasePtr mappingToParentStatesOutput =
nullptr);
209 template <
class EventType>
211 StateIceBasePtr destinationState,
212 ParameterMappingIceBasePtr mappingToNextStatesInput =
nullptr,
213 ParameterMappingIceBasePtr mappingToParentStatesLocal =
nullptr,
214 ParameterMappingIceBasePtr mappingToParentStatesOutput =
nullptr);
227 const ContainerType& type,
229 VariantContainerBasePtr defaultValue = VariantContainerBasePtr());
262 const ContainerType& type,
263 VariantContainerBasePtr defaultValue = VariantContainerBasePtr());
281 bool addToOutput(
const std::string& key,
const ContainerType& type,
bool optional);
314 template <
typename T>
316 getInput(
const std::string& key)
const;
329 template <
typename T>
331 std::is_base_of_v<VariantContainerBase, T>),
333 getInput(
const std::string& key)
const;
364 template <
typename T>
366 getLocal(
const std::string& key)
const;
377 template <
typename T>
379 std::is_base_of_v<VariantContainerBase, T>),
381 getLocal(
const std::string& key)
const;
413 void setInput(std::string
const& key,
const VariantContainerBase& valueList);
438 void setLocal(std::string
const& key,
const VariantContainerBase& valueList);
461 void setOutput(std::string
const& key,
const VariantContainerBase& valueList);
516 StatePtr operator[](std::string
const& stateName);
518 template <
class EventType,
class StateType>
520 template <
typename ContextType>
523 template <
class StateType>
528 std::unique_ptr<Impl> simpl;
536 StatePtr State::addState<State>(std::string
const& stateName);
538 template <
class derivedState>
543 static_assert(std::is_same_v<typename derivedState::Type, derivedState>,
544 "The template parameter 'derivedState' must be derived from "
545 "StateTemplate<derivedState> or the class 'State' itself! It must not "
546 "inherit from a class that inherits from StateTemplate!");
559 template <
class EventType>
562 StateIceBasePtr destinationState,
563 ParameterMappingIceBasePtr mappingToNextStatesInput,
564 ParameterMappingIceBasePtr mappingToParentStatesLocal,
565 ParameterMappingIceBasePtr mappingToParentStatesOutput)
570 mappingToNextStatesInput,
571 mappingToParentStatesLocal,
572 mappingToParentStatesOutput);
575 template <
class EventType>
578 ParameterMappingIceBasePtr mappingToNextStatesInput,
579 ParameterMappingIceBasePtr mappingToParentStatesLocal,
580 ParameterMappingIceBasePtr mappingToParentStatesOutput)
585 assert(destinationState._ptr);
587 t.destinationState = destinationState;
589 if (mappingToNextStatesInput)
591 t.mappingToNextStatesInput = PMPtr::dynamicCast(mappingToNextStatesInput)->clone();
594 if (mappingToParentStatesLocal)
596 t.mappingToParentStatesLocal = PMPtr::dynamicCast(mappingToParentStatesLocal)->clone();
599 if (mappingToParentStatesOutput)
601 t.mappingToParentStatesOutput =
602 PMPtr::dynamicCast(mappingToParentStatesOutput)->clone();
609 "Cannot insert a general transition on event '" + t.evt->eventName +
610 "' from any state to '" + destinationState->stateName +
"' into state '" +
612 "'! There already exists a transition to that state on that event.");
614 transitions.push_back(t);
615 return *transitions.rbegin();
618 template <
typename T>
623 VariantContainerBasePtr varContainer;
626 !SingleVariantPtr::dynamicCast(
639 template <
typename T>
641 std::is_base_of_v<VariantContainerBase, T>),
645 __checkPhaseMin(eDefined, __PRETTY_FUNCTION__);
647 getParameter(inputParameters, key, var);
648 return var->get<
T>();
651 template <
typename T>
656 VariantContainerBasePtr varContainer;
659 !SingleVariantPtr::dynamicCast(
672 template <
typename T>
674 std::is_base_of_v<VariantContainerBase, T>),
678 __checkPhaseMin(eDefined, __PRETTY_FUNCTION__);
680 getParameter(localParameters, key, var);
681 return var->get<
T>();
684 template <
typename T>
689 VariantContainerBasePtr varContainer;
692 !SingleVariantPtr::dynamicCast(
705 template <
typename T>
707 std::is_base_of_v<VariantContainerBase, T>),
711 __checkPhaseMin(eDefined, __PRETTY_FUNCTION__);
713 getParameter(outputParameters, key, var);
714 return var->get<
T>();