23#include <boost/core/demangle.hpp>
24#include <boost/statechart/event.hpp>
25#include <boost/statechart/simple_state.hpp>
26#include <boost/statechart/state.hpp>
28#include <boost/mpl/for_each.hpp>
29#include <boost/mpl/list.hpp>
30#include <boost/mpl/transform.hpp>
32#include <rclcpp/rclcpp.hpp>
40#include "smacc2_msgs/msg/smacc_transition.hpp"
42namespace sc = boost::statechart;
46namespace introspection
77 return boost::core::demangle(name);
105template <
typename...>
115 typedef char YesType[1];
116 typedef char NoType[2];
118 template <
typename C>
119 static YesType &
test(
decltype(&C::getEventLabel));
120 template <
typename C>
126 value =
sizeof(test<T>(0)) ==
sizeof(YesType)
131typename std::enable_if<HasEventLabel<T>::value,
void>::type
EventLabel(std::string & label)
133 label = T::getEventLabel();
137typename std::enable_if<!HasEventLabel<T>::value,
void>::type
EventLabel(std::string & label)
150 template <
typename C>
152 template <
typename C>
164 std::string & transition_name)
166 transition_name = T::getDefaultTransitionTag();
171 std::string & transition_name)
173 transition_name =
"";
184 template <
typename C>
186 template <
typename C>
198 std::string & transition_type)
200 transition_type = T::getDefaultTransitionType();
205 std::string & transition_type)
230template <
typename TTransition>
236 template <
typename T>
240 if (std::is_base_of<T, TTransition>::value || std::is_same<T, TTransition>::value)
248template <
typename TTransition>
253 using boost::mpl::_1;
254 using wrappedList =
typename boost::mpl::transform<DEFAULT_TRANSITION_TYPES, _1>::type;
256 boost::mpl::for_each<wrappedList>(op);
static NoType & test(...)
static YesType & test(decltype(&C::getDefaultTransitionTag))
static NoType & test(...)
static YesType & test(decltype(&C::getDefaultTransitionType))
static YesType & test(decltype(&C::getEventLabel))
static NoType & test(...)
boost::mpl::list< SUCCESS, ABORT, CANCEL, CONTINUELOOP, ENDLOOP > DEFAULT_TRANSITION_TYPES
std::enable_if< HasAutomaticTransitionType< T >::value, void >::type automaticTransitionType(std::string &transition_type)
auto optionalNodeHandle(std::shared_ptr< T > &obj) -> T *
std::enable_if< HasEventLabel< T >::value, void >::type EventLabel(std::string &label)
static std::string getTransitionType()
std::allocator< boost::statechart::none > SmaccAllocator
std::string demangleSymbol()
std::enable_if< HasAutomaticTransitionTag< T >::value, void >::type automaticTransitionTag(std::string &transition_name)
std::string demangledTypeName()
std::string demangleType(const std::type_info *tinfo)
void transitionInfoToMsg(const SmaccTransitionInfo &transition, smacc2_msgs::msg::SmaccTransition &transitionMsg)
std::string * transitionTypeName
CheckType(std::string *transitionTypeName)