29#define STATE_NAME (demangleSymbol(typeid(MostDerived).name()).c_str())
38 sc::history_mode
historyMode = sc::has_deep_history>
68 std::is_base_of<ISmaccState, Context>::value ||
69 std::is_base_of<ISmaccStateMachine, Context>::value,
70 "The context class must be a SmaccState or a SmaccStateMachine");
72 !std::is_same<MostDerived, Context>::value,
73 "The context must be a different state or state machine "
74 "than the current state");
76 logger_.reset(
new rclcpp::Logger(
157 template <
typename T>
160 return base_type::outermost_context().getGlobalSMData(name,
ret);
164 template <
typename T>
167 base_type::outermost_context().setGlobalSMData(name, value);
170 template <
typename SmaccComponentType>
173 base_type::outermost_context().requiresComponent(
storage);
178 template <
typename TOrthogonal,
typename TBehavior>
191 template <
typename TOrthogonal,
typename TBehavior>
220 auto srh = std::make_shared<smacc2::introspection::StateReactorHandler>(
globalNh_);
221 auto srinfo = std::make_shared<SmaccStateReactorInfo>();
223 srinfo->stateReactorType = TypeInfo::getTypeInfoFromType<TStateReactor>();
224 srinfo->outputEventType = TypeInfo::getTypeInfoFromType<TOutputEvent>();
226 if (
srinfo->outputEventType->templateParameters.size() == 2)
228 srinfo->objectTagType =
srinfo->outputEventType->templateParameters[1];
230 else if (
srinfo->outputEventType->templateParameters.size() == 1)
232 srinfo->objectTagType = TypeInfo::getTypeInfoFromType<state_reactors::EmptyObjectTag>();
238 "state reactor output events should have one or two parameters (SourceType, ObjectTag)");
242 using boost::mpl::_1;
243 using wrappedList =
typename boost::mpl::transform<TInputEventList, _1>::type;
245 boost::mpl::for_each<wrappedList>(
op);
254 std::vector<std::shared_ptr<SmaccStateReactorInfo>>();
260 srh->configureStateReactor(
sr);
274 auto egh = std::make_shared<smacc2::introspection::EventGeneratorHandler>();
275 auto eginfo = std::make_shared<SmaccEventGeneratorInfo>();
276 eginfo->eventGeneratorType = TypeInfo::getTypeInfoFromType<TEventGenerator>();
285 std::vector<std::shared_ptr<SmaccEventGeneratorInfo>>();
290 egh->configureEventGenerator(
eg);
304 auto srh = std::make_shared<smacc2::introspection::StateReactorHandler>(
globalNh_);
305 auto srinfo = std::make_shared<SmaccStateReactorInfo>();
307 srinfo->stateReactorType = TypeInfo::getTypeInfoFromType<TStateReactor>();
315 std::vector<std::shared_ptr<SmaccStateReactorInfo>>();
320 srh->configureStateReactor(
sr);
383 state->entryStateInternal();
391 template <
typename TOrthogonal,
typename TBehavior>
407 rclcpp::get_logger(
"static"),
"[states walking] State "
409 <<
"client behavior count: "
422 <<
"] creating ros subnode");
451 ortho.second->initState(
this);
455 getLogger(),
"finding static client behaviors. State Database: "
464 bhinfo.factoryFunction(
this);
471 sr->stateReactorType->getFullName().c_str());
472 sr->factoryFunction(
this);
479 eg->eventGeneratorType->getFullName().c_str());
480 eg->factoryFunction(
this);
std::shared_ptr< rclcpp::Logger > logger_
rclcpp::Logger getLogger()
rclcpp::Node::SharedPtr node_
ISmaccState * parentState_
const smacc2::introspection::SmaccStateInfo * stateInfo_
sc::simple_state< MostDerived, Context, InnerInitial, historyMode > base_type
static inner_context_ptr_type shallow_construct(const context_ptr_type &pContext, outermost_context_base_type &outermostContextBase)
static std::shared_ptr< smacc2::introspection::StateReactorHandler > static_createStateReactor(TArgs... args)
base_type::context_ptr_type context_ptr_type
static void initial_deep_construct(outermost_context_base_type &outermostContextBase)
InnerInitial * smacc_inner_type
base_type::inner_context_ptr_type inner_context_ptr_type
void checkWhileLoopConditionAndThrowEvent(bool(MostDerived::*conditionFn)())
static void configure_orthogonal_internal(std::function< void(ISmaccState *state)> initializationFunction)
base_type::inner_initial_list inner_initial_list
static std::shared_ptr< smacc2::introspection::EventGeneratorHandler > static_createEventGenerator(TUArgs... args)
virtual ISmaccStateMachine & getStateMachine()
static std::shared_ptr< smacc2::introspection::StateReactorHandler > static_createStateReactor_aux(TUArgs... args)
const smacc2::introspection::SmaccStateInfo * getStateInfo()
bool getGlobalSMData(std::string name, T &ret)
std::string getFullName()
static void deep_construct(const context_ptr_type &pContext, outermost_context_base_type &outermostContextBase)
base_type::outermost_context_base_type outermost_context_base_type
InnerInitial LastDeepState
virtual ISmaccState * getParentState()
SmaccState(my_context ctx)
context_type::state_iterator state_iterator
std::string getName() override
void setGlobalSMData(std::string name, T value)
Context::inner_context_type context_type
static void configure_orthogonal_runtime(std::function< void(TBehavior &bh)> initializationFunction)
void throwSequenceFinishedEvent()
void requiresComponent(SmaccComponentType *&storage)
std::string getShortName()
static void configure_orthogonal_runtime(std::function< void(TBehavior &bh, MostDerived &)> initializationFunction)
static void configure_orthogonal(Args &&... args)
void entryStateInternal()
static std::map< const std::type_info *, std::vector< std::shared_ptr< SmaccStateReactorInfo > > > stateReactorsInfo
static std::map< const std::type_info *, std::vector< std::shared_ptr< SmaccEventGeneratorInfo > > > eventGeneratorsInfo
static std::map< const std::type_info *, std::vector< ClientBehaviorInfoEntry > > staticBehaviorInfo
rclcpp::Node::SharedPtr globalNh_
std::string demangleSymbol()
std::string cleanShortTypeName()
void standardOnExit(TState &st, std::true_type)
void TRACEPOINT(spinOnce)
my_context(typename base_type::context_ptr_type pContext)
base_type::context_ptr_type pContext_
smacc2_state_onRuntimeConfigure_start
smacc2_state_onRuntimeConfigure_end
smacc2_state_onEntry_start
smacc2_state_onExit_start