SMACC2
Loading...
Searching...
No Matches
smacc2::introspection Namespace Reference

Classes

struct  add_type_wrapper
 
struct  AddSubState
 
struct  AddTransition
 
struct  CheckType
 
class  ClientBehaviorHandler
 
struct  ClientBehaviorInfoEntry
 
struct  EventGeneratorCallbackFunctor
 
class  EventGeneratorHandler
 
class  HasAutomaticTransitionTag
 
class  HasAutomaticTransitionType
 
class  HasEventLabel
 
class  HasOnDefinition
 
struct  SmaccEventGeneratorInfo
 
struct  SmaccEventInfo
 
class  SmaccStateInfo
 
class  SmaccStateMachineInfo
 
struct  SmaccStateReactorInfo
 
struct  SmaccTransitionInfo
 
struct  StateReactorCallbackFunctor
 
class  StateReactorHandler
 
struct  type_
 
class  TypeInfo
 
struct  typelist
 
struct  WalkStatesExecutor
 

Typedefs

typedef std::allocator< boost::statechart::none > SmaccAllocator
 
typedef boost::mpl::list< SUCCESS, ABORT, CANCEL, CONTINUELOOP, ENDLOOPDEFAULT_TRANSITION_TYPES
 

Enumerations

enum class  SmaccStateType { SUPERSTATE = 2 , STATE = 1 , SUPERSTATE_ROUTINE = 1 }
 

Functions

void transitionInfoToMsg (const SmaccTransitionInfo &transition, smacc2_msgs::msg::SmaccTransition &transitionMsg)
 
template<class T >
auto optionalNodeHandle (std::shared_ptr< T > &obj) -> T *
 
template<class T >
auto optionalNodeHandle (boost::intrusive_ptr< T > &obj) -> T *
 
template<class T >
auto optionalNodeHandle (T *obj) -> T *
 
std::string demangleSymbol (const std::string &name)
 
std::string demangleSymbol (const char *name)
 
template<typename T >
std::string demangleSymbol ()
 
template<class T >
std::string demangledTypeName ()
 
std::string demangleType (const std::type_info *tinfo)
 
std::string demangleType (const std::type_info &tinfo)
 
template<typename T >
std::enable_if< HasEventLabel< T >::value, void >::type EventLabel (std::string &label)
 
template<typename T >
std::enable_if<!HasEventLabel< T >::value, void >::type EventLabel (std::string &label)
 
template<typename T >
std::enable_if< HasAutomaticTransitionTag< T >::value, void >::type automaticTransitionTag (std::string &transition_name)
 
template<typename T >
std::enable_if<!HasAutomaticTransitionTag< T >::value, void >::type automaticTransitionTag (std::string &transition_name)
 
template<typename T >
std::enable_if< HasAutomaticTransitionType< T >::value, void >::type automaticTransitionType (std::string &transition_type)
 
template<typename T >
std::enable_if<!HasAutomaticTransitionType< T >::value, void >::type automaticTransitionType (std::string &transition_type)
 
template<typename TTransition >
static std::string getTransitionType ()
 
template<typename T >
disable_if< boost::mpl::is_sequence< T > >::type processSubState (std::shared_ptr< SmaccStateInfo > &parentState)
 
template<typename T >
enable_if< boost::mpl::is_sequence< T > >::type processSubState (std::shared_ptr< SmaccStateInfo > &parentState)
 
template<typename T >
enable_if< boost::mpl::is_sequence< T > >::type processTransitions (std::shared_ptr< SmaccStateInfo > &sourceState)
 
template<typename Ev , typename Dst , typename Tag >
void processTransition (smacc2::Transition< Ev, boost::statechart::deep_history< Dst >, Tag > *, std::shared_ptr< SmaccStateInfo > &sourceState)
 
template<typename Ev , typename Dst , typename Tag >
void processTransition (smacc2::Transition< Ev, Dst, Tag > *t, std::shared_ptr< SmaccStateInfo > &sourceState)
 
template<typename Ev , typename Dst , typename Tag >
void processTransitionAux (smacc2::Transition< Ev, Dst, Tag > *, std::shared_ptr< SmaccStateInfo > &sourceState, bool history, TypeInfo::Ptr &transitionTypeInfo)
 
template<typename Ev , typename Dst >
void processTransition (statechart::transition< Ev, Dst > *, std::shared_ptr< SmaccStateInfo > &sourceState)
 
template<typename Ev >
void processTransition (statechart::custom_reaction< Ev > *, std::shared_ptr< SmaccStateInfo > &sourceState)
 
template<typename T >
disable_if< boost::mpl::is_sequence< T > >::type processTransitions (std::shared_ptr< SmaccStateInfo > &sourceState)
 
template<typename T >
std::enable_if< HasOnDefinition< T >::value, void >::type CallOnDefinition ()
 
template<typename T >
std::enable_if<!HasOnDefinition< T >::value, void >::type CallOnDefinition ()
 
bool replace (std::string &str, const std::string &from, const std::string &to)
 
std::string replace_back (std::string roottype, std::vector< std::pair< std::string, std::string > > &orderedtypesdict)
 

Variables

rclcpp::Node::SharedPtr globalNh_
 

Typedef Documentation

◆ DEFAULT_TRANSITION_TYPES

◆ SmaccAllocator

typedef std::allocator<boost::statechart::none> smacc2::introspection::SmaccAllocator

Definition at line 52 of file introspection.hpp.

Enumeration Type Documentation

◆ SmaccStateType

Enumerator
SUPERSTATE 
STATE 
SUPERSTATE_ROUTINE 

Definition at line 164 of file smacc_state_info.hpp.

Function Documentation

◆ automaticTransitionTag() [1/2]

template<typename T >
std::enable_if< HasAutomaticTransitionTag< T >::value, void >::type smacc2::introspection::automaticTransitionTag ( std::string & transition_name)

Definition at line 174 of file introspection.hpp.

176{
177 transition_name = T::getDefaultTransitionTag();
178}

Referenced by processTransitionAux().

Here is the caller graph for this function:

◆ automaticTransitionTag() [2/2]

template<typename T >
std::enable_if<!HasAutomaticTransitionTag< T >::value, void >::type smacc2::introspection::automaticTransitionTag ( std::string & transition_name)

Definition at line 181 of file introspection.hpp.

183{
184 transition_name = "";
185}

◆ automaticTransitionType() [1/2]

template<typename T >
std::enable_if< HasAutomaticTransitionType< T >::value, void >::type smacc2::introspection::automaticTransitionType ( std::string & transition_type)

Definition at line 208 of file introspection.hpp.

210{
211 transition_type = T::getDefaultTransitionType();
212}

Referenced by processTransitionAux().

Here is the caller graph for this function:

◆ automaticTransitionType() [2/2]

template<typename T >
std::enable_if<!HasAutomaticTransitionType< T >::value, void >::type smacc2::introspection::automaticTransitionType ( std::string & transition_type)

Definition at line 215 of file introspection.hpp.

217{
218 transition_type = demangledTypeName<DEFAULT>();
219}

References demangledTypeName().

Here is the call graph for this function:

◆ CallOnDefinition() [1/2]

template<typename T >
std::enable_if< HasOnDefinition< T >::value, void >::type smacc2::introspection::CallOnDefinition ( )

Definition at line 370 of file smacc_state_machine_info.hpp.

371{
372 /* something when T has toString ... */
373 RCLCPP_INFO_STREAM(
374 globalNh_->get_logger(), "EXECUTING ONDEFINITION: " << demangleSymbol(typeid(T).name()));
375 T::staticConfigure();
376}
rclcpp::Node::SharedPtr globalNh_
std::string demangleSymbol(const std::string &name)

References demangleSymbol(), and globalNh_.

Referenced by smacc2::introspection::WalkStatesExecutor< InitialStateType >::walkStates().

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

◆ CallOnDefinition() [2/2]

template<typename T >
std::enable_if<!HasOnDefinition< T >::value, void >::type smacc2::introspection::CallOnDefinition ( )

Definition at line 379 of file smacc_state_machine_info.hpp.

380{
381 RCLCPP_INFO_STREAM(
382 globalNh_->get_logger(),
383 "static OnDefinition: dont exist for " << demangleSymbol(typeid(T).name()));
384 /* something when T has toString ... */
385}

References demangleSymbol(), and globalNh_.

Here is the call graph for this function:

◆ demangledTypeName()

template<class T >
std::string smacc2::introspection::demangledTypeName ( )
inline

Definition at line 101 of file introspection.hpp.

102{
103 return demangleSymbol(typeid(T).name());
104}

References demangleSymbol().

Referenced by smacc2::introspection::StateReactorHandler::addInputEvent(), automaticTransitionType(), smacc2::ISmaccState::configure(), smacc2::Orthogonal< TOrthogonal >::createClient(), smacc2::ISmaccClient::createNamedComponent(), smacc2::ISmaccStateMachine::createOrthogonal(), smacc2::ISmaccStateMachine::createSignalConnection(), smacc2::introspection::SmaccStateMachineInfo::createState(), smacc2::introspection::SmaccStateInfo::declareTransition(), smacc2::default_events::EvActionAborted< TSource, TOrthogonal >::getDefaultTransitionTag(), smacc2::default_events::EvActionCancelled< TSource, TOrthogonal >::getDefaultTransitionTag(), smacc2::default_events::EvActionSucceeded< TSource, TOrthogonal >::getDefaultTransitionTag(), smacc2::default_events::EvLoopContinue< TSource >::getDefaultTransitionTag(), smacc2::default_events::EvLoopEnd< TSource >::getDefaultTransitionTag(), smacc2::default_events::EvServiceFailure< TSource, TOrthogonal >::getDefaultTransitionTag(), smacc2::default_events::EvServiceResponse< TSource, TOrthogonal, TResponse >::getDefaultTransitionTag(), smacc2::default_events::EvActionAborted< TSource, TOrthogonal >::getDefaultTransitionType(), smacc2::default_events::EvActionCancelled< TSource, TOrthogonal >::getDefaultTransitionType(), smacc2::default_events::EvActionSucceeded< TSource, TOrthogonal >::getDefaultTransitionType(), smacc2::default_events::EvLoopContinue< TSource >::getDefaultTransitionType(), smacc2::default_events::EvLoopEnd< TSource >::getDefaultTransitionType(), smacc2::default_events::EvServiceFailure< TSource, TOrthogonal >::getDefaultTransitionType(), smacc2::default_events::EvServiceResponse< TSource, TOrthogonal, TResponse >::getDefaultTransitionType(), smacc2::ISmaccStateMachine::getOrthogonal(), smacc2::client_behaviors::CbWaitTopicMessage< TMessage >::onEntry(), smacc2::introspection::CheckType< TTransition >::operator()(), smacc2::ISmaccOrthogonal::requiresClient(), smacc2::introspection::StateReactorHandler::setOutputEvent(), smacc2::client_bases::SmaccActionClientBase< ActionType >::waitForServer(), and smacc2::introspection::WalkStatesExecutor< InitialStateType >::walkStates().

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

◆ demangleSymbol() [1/3]

template<typename T >
std::string smacc2::introspection::demangleSymbol ( )
inline

Definition at line 95 of file introspection.hpp.

96{
97 return demangleSymbol(typeid(T).name());
98}

References demangleSymbol().

Referenced by smacc2::introspection::SmaccStateMachineInfo::assembleSMStructureMessage(), CallOnDefinition(), smacc2::introspection::SmaccStateInfo::createChildState(), smacc2::ISmaccStateMachine::createSignalConnection(), demangledTypeName(), demangleSymbol(), demangleSymbol(), demangleType(), demangleType(), smacc2::SmaccState< MostDerived, Context, InnerInitial, historyMode >::entryStateInternal(), smacc2::ISmaccState::getClassName(), smacc2::introspection::SmaccStateInfo::getDemangledFullName(), cl_generic_sensor::CbDefaultGenericSensorBehavior< ClientType >::getEventLabel(), smacc2::introspection::SmaccEventInfo::getEventSourceName(), smacc2::introspection::SmaccEventInfo::getEventTypeName(), smacc2::introspection::TypeInfo::getFromStdTypeInfo(), smacc2::SmaccState< MostDerived, Context, InnerInitial, historyMode >::getFullName(), smacc2::ISmaccClient::getName(), smacc2::ISmaccClientBehavior::getName(), smacc2::ISmaccComponent::getName(), smacc2::ISmaccOrthogonal::getName(), smacc2::introspection::SmaccEventInfo::getOrthogonalName(), smacc2::ISmaccStateMachine::getStateMachineName(), smacc2::ISmaccStateMachine::notifyOnStateEntryEnd(), smacc2::ISmaccStateMachine::notifyOnStateEntryStart(), smacc2::ISmaccStateMachine::notifyOnStateExited(), smacc2::ISmaccStateMachine::notifyOnStateExitting(), cl_generic_sensor::CbDefaultGenericSensorBehavior< ClientType >::onEntry(), cl_moveit2z::CbMoveEndEffectorTrajectory::onEntry(), smacc2::state_reactors::SrAllEventsGo::onEventNotified(), smacc2::state_reactors::SrEventCountdown::onEventNotified(), smacc2::client_bases::SmaccActionClientBase< ActionType >::onInitialize(), cl_generic_sensor::CbDefaultGenericSensorBehavior< ClientType >::onStateOrthogonalAllocation(), smacc2::ISmaccStateMachine::postEvent(), cl_keyboard::CbDefaultKeyboardBehavior::postKeyEvent(), cl_keyboard::components::CpKeyboardListener1::postKeyEvent(), smacc2::client_bases::SmaccActionClientBase< ActionType >::postResultEvent(), smacc2::client_core_components::CpActionClient< ActionType >::postResultEvent(), processTransition(), processTransitionAux(), smacc2::ISmaccStateMachine::propagateEventToStateReactors(), cl_generic_sensor::CbDefaultGenericSensorBehavior< ClientType >::propagateMessageEvent(), cl_generic_sensor::CbDefaultGenericSensorBehavior< ClientType >::propagateTimeoutEvent(), smacc2::ISmaccState::requiresClient(), smacc2::ISmaccComponent::requiresComponent(), smacc2::ISmaccComponent::requiresComponent(), smacc2::ISmaccStateMachine::requiresComponent(), smacc2::client_bases::SmaccActionClientBase< ActionType >::sendGoal(), smacc2::StateReactor::setOutputEvent(), and smacc2::client_behaviors::CbSequence::then().

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

◆ demangleSymbol() [2/3]

std::string smacc2::introspection::demangleSymbol ( const char * name)
inline

Definition at line 76 of file introspection.hpp.

77{
78#if (__GNUC__ && __cplusplus && __GNUC__ >= 3)
79 int status;
80 char * res = abi::__cxa_demangle(name, 0, 0, &status);
81 if (res)
82 {
83 const std::string demangled_name(res);
84 std::free(res);
85 return demangled_name;
86 }
87 // Demangling failed, fallback to mangled name
88 return std::string(name);
89#else
90 return std::string(name);
91#endif
92}

◆ demangleSymbol() [3/3]

std::string smacc2::introspection::demangleSymbol ( const std::string & name)
inline

Definition at line 74 of file introspection.hpp.

74{ return demangleSymbol(name.c_str()); }

References demangleSymbol().

Here is the call graph for this function:

◆ demangleType() [1/2]

std::string smacc2::introspection::demangleType ( const std::type_info & tinfo)
inline

Definition at line 111 of file introspection.hpp.

112{
113 return demangleSymbol(tinfo.name());
114}

References demangleSymbol().

Here is the call graph for this function:

◆ demangleType() [2/2]

std::string smacc2::introspection::demangleType ( const std::type_info * tinfo)
inline

◆ EventLabel() [1/2]

◆ EventLabel() [2/2]

template<typename T >
std::enable_if<!HasEventLabel< T >::value, void >::type smacc2::introspection::EventLabel ( std::string & label)

Definition at line 148 of file introspection.hpp.

149{
150 label = "";
151}

◆ getTransitionType()

template<typename TTransition >
static std::string smacc2::introspection::getTransitionType ( )
static

Definition at line 259 of file introspection.hpp.

260{
261 std::string output;
262 CheckType<TTransition> op(&output);
263 using boost::mpl::_1;
264 using wrappedList = typename boost::mpl::transform<DEFAULT_TRANSITION_TYPES, _1>::type;
265
266 boost::mpl::for_each<wrappedList>(op);
267 return output;
268}

Referenced by processTransitionAux().

Here is the caller graph for this function:

◆ optionalNodeHandle() [1/3]

template<class T >
auto smacc2::introspection::optionalNodeHandle ( boost::intrusive_ptr< T > & obj) -> T *

Definition at line 62 of file introspection.hpp.

63{
64 //return obj->getNode();
65 return obj.get();
66}

◆ optionalNodeHandle() [2/3]

template<class T >
auto smacc2::introspection::optionalNodeHandle ( std::shared_ptr< T > & obj) -> T *

Definition at line 55 of file introspection.hpp.

56{
57 //return obj->getNode();
58 return obj.get;
59}

◆ optionalNodeHandle() [3/3]

template<class T >
auto smacc2::introspection::optionalNodeHandle ( T * obj) -> T *

Definition at line 69 of file introspection.hpp.

70{
71 return obj;
72}

◆ processSubState() [1/2]

template<typename T >
disable_if< boost::mpl::is_sequence< T > >::type smacc2::introspection::processSubState ( std::shared_ptr< SmaccStateInfo > & parentState)

Definition at line 141 of file smacc_state_machine_info.hpp.

References smacc2::introspection::WalkStatesExecutor< InitialStateType >::walkStates().

Referenced by smacc2::introspection::WalkStatesExecutor< InitialStateType >::walkStates().

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

◆ processSubState() [2/2]

template<typename T >
enable_if< boost::mpl::is_sequence< T > >::type smacc2::introspection::processSubState ( std::shared_ptr< SmaccStateInfo > & parentState)

Definition at line 149 of file smacc_state_machine_info.hpp.

151{
152 using boost::mpl::_1;
153 using wrappedList = typename boost::mpl::transform<T, add_type_wrapper<_1>>::type;
154 boost::mpl::for_each<wrappedList>(AddSubState(parentState));
155}

◆ processTransition() [1/4]

template<typename Ev , typename Dst , typename Tag >
void smacc2::introspection::processTransition ( smacc2::Transition< Ev, boost::statechart::deep_history< Dst >, Tag > * ,
std::shared_ptr< SmaccStateInfo > & sourceState )

Definition at line 178 of file smacc_state_machine_info.hpp.

181{
182 RCLCPP_INFO(
183 globalNh_->get_logger(), "[DIAG] processTransition [deep_history] START for state %s",
184 sourceState->toShortName().c_str());
185 auto transitionTypeInfo = TypeInfo::getTypeInfoFromType<
187 RCLCPP_INFO(
188 globalNh_->get_logger(), "[DIAG] processTransition [deep_history] got TypeInfo for state %s",
189 sourceState->toShortName().c_str());
190 smacc2::Transition<Ev, Dst, Tag> * mock = nullptr;
191 processTransitionAux(mock, sourceState, true, transitionTypeInfo);
192}
void processTransitionAux(smacc2::Transition< Ev, Dst, Tag > *, std::shared_ptr< SmaccStateInfo > &sourceState, bool history, TypeInfo::Ptr &transitionTypeInfo)

References smacc2::introspection::TypeInfo::getTypeInfoFromType(), globalNh_, and processTransitionAux().

Referenced by processTransitions().

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

◆ processTransition() [2/4]

template<typename Ev , typename Dst , typename Tag >
void smacc2::introspection::processTransition ( smacc2::Transition< Ev, Dst, Tag > * t,
std::shared_ptr< SmaccStateInfo > & sourceState )

Definition at line 195 of file smacc_state_machine_info.hpp.

197{
198 RCLCPP_INFO(
199 globalNh_->get_logger(), "[DIAG] processTransition START for state %s",
200 sourceState->toShortName().c_str());
201 auto transitionTypeInfo = TypeInfo::getTypeInfoFromType<smacc2::Transition<Ev, Dst, Tag>>();
202 RCLCPP_INFO(
203 globalNh_->get_logger(), "[DIAG] processTransition got TypeInfo for state %s",
204 sourceState->toShortName().c_str());
205 RCLCPP_INFO(
206 globalNh_->get_logger(), "State %s Walker transition: %s", sourceState->toShortName().c_str(),
207 demangleSymbol(typeid(Ev).name()).c_str());
208 processTransitionAux(t, sourceState, false, transitionTypeInfo);
209}

References demangleSymbol(), smacc2::introspection::TypeInfo::getTypeInfoFromType(), globalNh_, and processTransitionAux().

Here is the call graph for this function:

◆ processTransition() [3/4]

template<typename Ev >
void smacc2::introspection::processTransition ( statechart::custom_reaction< Ev > * ,
std::shared_ptr< SmaccStateInfo > & sourceState )

Definition at line 346 of file smacc_state_machine_info.hpp.

348{
349 // RCLCPP_INFO_STREAM(getLogger(),"GOTCHA");
350}

◆ processTransition() [4/4]

template<typename Ev , typename Dst >
void smacc2::introspection::processTransition ( statechart::transition< Ev, Dst > * ,
std::shared_ptr< SmaccStateInfo > & sourceState )

Definition at line 339 of file smacc_state_machine_info.hpp.

341{
342 // RCLCPP_INFO_STREAM(getLogger(),"GOTCHA");
343}

◆ processTransitionAux()

template<typename Ev , typename Dst , typename Tag >
void smacc2::introspection::processTransitionAux ( smacc2::Transition< Ev, Dst, Tag > * ,
std::shared_ptr< SmaccStateInfo > & sourceState,
bool history,
TypeInfo::Ptr & transitionTypeInfo )

Definition at line 212 of file smacc_state_machine_info.hpp.

215{
216 RCLCPP_INFO(
217 globalNh_->get_logger(), "State %s Walker transition: %s", sourceState->toShortName().c_str(),
218 demangleSymbol(typeid(Ev).name()).c_str());
219 std::string transitionTag;
220 std::string transitionType;
221
222 if (typeid(Tag) != typeid(default_transition_name))
223 {
224 transitionTag = demangleSymbol<Tag>();
225 transitionType = getTransitionType<Tag>();
226 RCLCPP_DEBUG_STREAM(globalNh_->get_logger(), "TRANSITION TYPE:" << transitionType);
227 }
228 else
229 {
230 transitionTag = "";
231 automaticTransitionTag<Ev>(transitionTag);
232 automaticTransitionType<Ev>(transitionType);
233 }
234
235 RCLCPP_INFO_STREAM(globalNh_->get_logger(), "Transition tag: " << transitionTag);
236
237 if (!sourceState->stateMachine_->containsState<Dst>())
238 {
239 auto realparentState = sourceState->stateMachine_->getState<typename Dst::TContext>();
240 auto siblingnode = sourceState->stateMachine_->createState<Dst>(realparentState);
241
242 // auto siblingnode = sourceState->stateMachine_->createState<Dst>(sourceState->parentState_);
243 WalkStatesExecutor<Dst>::walkStates(siblingnode, true);
244 sourceState->declareTransition<Ev>(
245 siblingnode, transitionTag, transitionType, history, transitionTypeInfo);
246 }
247 else
248 {
249 // auto realparentState = sourceState->stateMachine_->getState<typename Dst::TContext>();
250 // auto siblingnode = sourceState->stateMachine_->createState<Dst>(realparentState);
251
252 auto siblingnode = sourceState->stateMachine_->getState<Dst>();
253 sourceState->declareTransition<Ev>(
254 siblingnode, transitionTag, transitionType, history, transitionTypeInfo);
255 }
256}

References automaticTransitionTag(), automaticTransitionType(), demangleSymbol(), getTransitionType(), globalNh_, and smacc2::introspection::WalkStatesExecutor< InitialStateType >::walkStates().

Referenced by processTransition(), and processTransition().

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

◆ processTransitions() [1/2]

template<typename T >
enable_if< boost::mpl::is_sequence< T > >::type smacc2::introspection::processTransitions ( std::shared_ptr< SmaccStateInfo > & sourceState)

Definition at line 160 of file smacc_state_machine_info.hpp.

162{
163 RCLCPP_INFO(
164 globalNh_->get_logger(), "State %s Walker has transition list",
165 sourceState->fullStateName.c_str());
166 using boost::mpl::_1;
167 using wrappedList = typename boost::mpl::transform<T, add_type_wrapper<_1>>::type;
168 RCLCPP_INFO(
169 globalNh_->get_logger(), "[DIAG] About to call boost::mpl::for_each for state %s",
170 sourceState->fullStateName.c_str());
171 boost::mpl::for_each<wrappedList>(AddTransition(sourceState));
172 RCLCPP_INFO(
173 globalNh_->get_logger(), "[DIAG] Completed boost::mpl::for_each for state %s",
174 sourceState->fullStateName.c_str());
175}

References globalNh_.

Referenced by smacc2::introspection::AddTransition::operator()(), smacc2::introspection::AddTransition::operator()(), smacc2::introspection::AddTransition::operator()(), and smacc2::introspection::WalkStatesExecutor< InitialStateType >::walkStates().

Here is the caller graph for this function:

◆ processTransitions() [2/2]

template<typename T >
disable_if< boost::mpl::is_sequence< T > >::type smacc2::introspection::processTransitions ( std::shared_ptr< SmaccStateInfo > & sourceState)

Definition at line 356 of file smacc_state_machine_info.hpp.

358{
359 RCLCPP_INFO(
360 globalNh_->get_logger(), "[DIAG] processTransitions [single/leaf] called for state %s",
361 sourceState->fullStateName.c_str());
362 T * dummy = nullptr;
363 processTransition(dummy, sourceState);
364 RCLCPP_INFO(
365 globalNh_->get_logger(), "[DIAG] processTransitions [single/leaf] completed for state %s",
366 sourceState->fullStateName.c_str());
367}
void processTransition(smacc2::Transition< Ev, boost::statechart::deep_history< Dst >, Tag > *, std::shared_ptr< SmaccStateInfo > &sourceState)

References globalNh_, and processTransition().

Here is the call graph for this function:

◆ replace()

bool smacc2::introspection::replace ( std::string & str,
const std::string & from,
const std::string & to )

Definition at line 39 of file string_type_walker.cpp.

40{
41 size_t start_pos = str.find(from);
42 if (start_pos == std::string::npos) return false;
43 str.replace(start_pos, from.length(), to);
44 return true;
45}

Referenced by smacc2::introspection::TypeInfo::getTypeInfoFromString(), and replace_back().

Here is the caller graph for this function:

◆ replace_back()

std::string smacc2::introspection::replace_back ( std::string roottype,
std::vector< std::pair< std::string, std::string > > & orderedtypesdict )

Definition at line 47 of file string_type_walker.cpp.

49{
50 while (roottype.find("$") != std::string::npos)
51 {
52 for (auto & t : orderedtypesdict)
53 {
54 auto & tkey = t.first;
55 auto & tval = t.second;
56
57 replace(roottype, tkey, tval);
58 }
59 }
60
61 return roottype;
62
63 // def replace_back(roottype, typesdict):
64 // # replace back
65 // while "$" in roottype:
66 // #print roottype
67 // for tkey in typesdict:
68 // tval = typesdict[tkey]
69 // roottype = roottype.replace(tkey, tval)
70
71 // return roottype
72}
bool replace(std::string &str, const std::string &from, const std::string &to)

References replace().

Referenced by smacc2::introspection::TypeInfo::getTypeInfoFromString().

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

◆ transitionInfoToMsg()

void smacc2::introspection::transitionInfoToMsg ( const SmaccTransitionInfo & transition,
smacc2_msgs::msg::SmaccTransition & transitionMsg )

Definition at line 30 of file reflection.cpp.

32{
33 transitionMsg.index = transition.index;
34
35 if (transition.sourceState != nullptr)
36 {
37 transitionMsg.source_state_name = transition.sourceState->demangledStateName;
38 }
39
40 transitionMsg.transition_name = transition.transitionTag;
41 transitionMsg.transition_type = transition.transitionType;
42
43 if (transition.eventInfo != nullptr)
44 {
45 transitionMsg.event.event_type = transition.eventInfo->getEventTypeName();
46 transitionMsg.event.event_source = transition.eventInfo->getEventSourceName();
47 transitionMsg.event.event_object_tag = transition.eventInfo->getOrthogonalName();
48 transitionMsg.event.label = transition.eventInfo->label;
49 }
50
51 transitionMsg.history_node = transition.historyNode;
52
53 if (transition.historyNode)
54 {
55 if (transition.destinyState->parentState_ != nullptr)
56 {
57 transitionMsg.destiny_state_name = transition.destinyState->parentState_->demangledStateName;
58 }
59 else
60 {
61 transitionMsg.destiny_state_name = "";
62 }
63 }
64 else
65 {
66 transitionMsg.destiny_state_name = transition.destinyState->demangledStateName;
67 }
68}
std::shared_ptr< const SmaccStateInfo > destinyState
std::shared_ptr< SmaccEventInfo > eventInfo
std::shared_ptr< const SmaccStateInfo > sourceState

References smacc2::introspection::SmaccTransitionInfo::destinyState, smacc2::introspection::SmaccTransitionInfo::eventInfo, smacc2::introspection::SmaccTransitionInfo::historyNode, smacc2::introspection::SmaccTransitionInfo::index, smacc2::introspection::SmaccTransitionInfo::sourceState, smacc2::introspection::SmaccTransitionInfo::transitionTag, and smacc2::introspection::SmaccTransitionInfo::transitionType.

Referenced by smacc2::introspection::SmaccStateMachineInfo::assembleSMStructureMessage(), and smacc2::ISmaccStateMachine::publishTransition().

Here is the caller graph for this function:

Variable Documentation

◆ globalNh_