23#include <boost/statechart/event.hpp>
24#include <boost/statechart/simple_state.hpp>
25#include <boost/statechart/state.hpp>
27#include <boost/mpl/for_each.hpp>
28#include <boost/mpl/list.hpp>
29#include <boost/mpl/transform.hpp>
30#include <rclcpp/rclcpp.hpp>
38#include "smacc2_msgs/msg/smacc_transition.hpp"
40namespace sc = boost::statechart;
44namespace introspection
76#if (__GNUC__ && __cplusplus && __GNUC__ >= 3)
78 char * res = abi::__cxa_demangle(name, 0, 0, &status);
81 const std::string demangled_name(res);
83 return demangled_name;
86 return std::string(name);
88 return std::string(name);
114template <
typename...>
124 typedef char YesType[1];
125 typedef char NoType[2];
127 template <
typename C>
128 static YesType &
test(
decltype(&C::getEventLabel));
129 template <
typename C>
135 value =
sizeof(test<T>(0)) ==
sizeof(YesType)
140typename std::enable_if<HasEventLabel<T>::value,
void>::type
EventLabel(std::string & label)
142 label = T::getEventLabel();
146typename std::enable_if<!HasEventLabel<T>::value,
void>::type
EventLabel(std::string & label)
159 template <
typename C>
161 template <
typename C>
173 std::string & transition_name)
175 transition_name = T::getDefaultTransitionTag();
180 std::string & transition_name)
182 transition_name =
"";
193 template <
typename C>
195 template <
typename C>
207 std::string & transition_type)
209 transition_type = T::getDefaultTransitionType();
214 std::string & transition_type)
238template <
typename TTransition>
244 template <
typename T>
248 if (std::is_base_of<T, TTransition>::value || std::is_same<T, TTransition>::value)
256template <
typename TTransition>
261 using boost::mpl::_1;
262 using wrappedList =
typename boost::mpl::transform<DEFAULT_TRANSITION_TYPES, _1>::type;
264 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)