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 162 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 172 of file introspection.hpp.

174{
175 transition_name = T::getDefaultTransitionTag();
176}

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 179 of file introspection.hpp.

181{
182 transition_name = "";
183}

◆ automaticTransitionType() [1/2]

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

Definition at line 206 of file introspection.hpp.

208{
209 transition_type = T::getDefaultTransitionType();
210}

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 213 of file introspection.hpp.

215{
216 transition_type = demangledTypeName<DEFAULT>();
217}

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 338 of file smacc_state_machine_info.hpp.

339{
340 /* something when T has toString ... */
341 RCLCPP_INFO_STREAM(
342 globalNh_->get_logger(), "EXECUTING ONDEFINITION: " << demangleSymbol(typeid(T).name()));
343 T::staticConfigure();
344}
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 347 of file smacc_state_machine_info.hpp.

348{
349 RCLCPP_INFO_STREAM(
350 globalNh_->get_logger(),
351 "static OnDefinition: dont exist for " << demangleSymbol(typeid(T).name()));
352 /* something when T has toString ... */
353}

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 99 of file introspection.hpp.

100{
101 return demangleSymbol(typeid(T).name());
102}

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 93 of file introspection.hpp.

94{
95 return demangleSymbol(typeid(T).name());
96}

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::notifyOnStateExiting(), 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 74 of file introspection.hpp.

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

◆ demangleSymbol() [3/3]

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

Definition at line 72 of file introspection.hpp.

72{ 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 109 of file introspection.hpp.

110{
111 return demangleSymbol(tinfo.name());
112}

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 146 of file introspection.hpp.

147{
148 label = "";
149}

◆ getTransitionType()

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

Definition at line 257 of file introspection.hpp.

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

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 61 of file introspection.hpp.

62{
63 return obj.get();
64}

◆ 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.get;
58}

◆ optionalNodeHandle() [3/3]

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

Definition at line 67 of file introspection.hpp.

68{
69 return obj;
70}

◆ 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 140 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 148 of file smacc_state_machine_info.hpp.

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

◆ 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 177 of file smacc_state_machine_info.hpp.

180{
181 RCLCPP_INFO(
182 globalNh_->get_logger(), "[DIAG] processTransition [deep_history] START for state %s",
183 sourceState->toShortName().c_str());
184 auto transitionTypeInfo = TypeInfo::getTypeInfoFromType<
186 RCLCPP_INFO(
187 globalNh_->get_logger(), "[DIAG] processTransition [deep_history] got TypeInfo for state %s",
188 sourceState->toShortName().c_str());
189 smacc2::Transition<Ev, Dst, Tag> * mock = nullptr;
190 processTransitionAux(mock, sourceState, true, transitionTypeInfo);
191}
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 194 of file smacc_state_machine_info.hpp.

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

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 315 of file smacc_state_machine_info.hpp.

317{
318}

◆ processTransition() [4/4]

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

Definition at line 309 of file smacc_state_machine_info.hpp.

311{
312}

◆ 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 211 of file smacc_state_machine_info.hpp.

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

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 159 of file smacc_state_machine_info.hpp.

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

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 324 of file smacc_state_machine_info.hpp.

326{
327 RCLCPP_INFO(
328 globalNh_->get_logger(), "[DIAG] processTransitions [single/leaf] called for state %s",
329 sourceState->fullStateName.c_str());
330 T * dummy = nullptr;
331 processTransition(dummy, sourceState);
332 RCLCPP_INFO(
333 globalNh_->get_logger(), "[DIAG] processTransitions [single/leaf] completed for state %s",
334 sourceState->fullStateName.c_str());
335}
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}
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_