9#include <boost/statechart/state.hpp>
10#include <boost/statechart/simple_state.hpp>
11#include <boost/statechart/event.hpp>
15#include <boost/mpl/list.hpp>
16#include <boost/mpl/for_each.hpp>
17#include <boost/mpl/transform.hpp>
23#include <smacc_msgs/SmaccTransition.h>
25namespace sc = boost::statechart;
29namespace introspection
42 return obj->getROSNode();
48 return ros::NodeHandle(
"");
58#if (__GNUC__ && __cplusplus && __GNUC__ >= 3)
60 char *res = abi::__cxa_demangle(name, 0, 0, &status);
63 const std::string demangled_name(res);
65 return demangled_name;
68 return std::string(name);
70 return std::string(name);
106 typedef char YesType[1];
107 typedef char NoType[2];
109 template <
typename C>
110 static YesType &
test(
decltype(&C::getEventLabel));
111 template <
typename C>
117 value =
sizeof(test<T>(0)) ==
sizeof(YesType)
122typename std::enable_if<HasEventLabel<T>::value,
void>::type
125 label = T::getEventLabel();
129typename std::enable_if<!HasEventLabel<T>::value,
void>::type
143 template <
typename C>
145 template <
typename C>
156typename std::enable_if<HasAutomaticTransitionTag<T>::value,
void>::type
159 transition_name = T::getDefaultTransitionTag();
163typename std::enable_if<!HasAutomaticTransitionTag<T>::value,
void>::type
166 transition_name =
"";
177 template <
typename C>
179 template <
typename C>
190typename std::enable_if<HasAutomaticTransitionType<T>::value,
void>::type
193 transition_type = T::getDefaultTransitionType();
197typename std::enable_if<!HasAutomaticTransitionType<T>::value,
void>::type
200 transition_type = demangledTypeName<DEFAULT>();
221template <
typename TTransition>
230 template <
typename T>
234 if (std::is_base_of<T, TTransition>::value || std::is_same<T, TTransition>::value)
242template <
typename TTransition>
247 using boost::mpl::_1;
248 using wrappedList =
typename boost::mpl::transform<DEFAULT_TRANSITION_TYPES, _1>::type;
250 boost::mpl::for_each<wrappedList>(op);
static NoType & test(...)
static YesType & test(decltype(&C::getDefaultTransitionTag))
static YesType & test(decltype(&C::getDefaultTransitionType))
static NoType & test(...)
static NoType & test(...)
static YesType & test(decltype(&C::getEventLabel))
std::enable_if< HasAutomaticTransitionType< T >::value, void >::type automaticTransitionType(std::string &transition_type)
static std::string getTransitionType()
std::string demangleType(const std::type_info *tinfo)
void transitionInfoToMsg(const SmaccTransitionInfo &transition, smacc_msgs::SmaccTransition &transitionMsg)
std::enable_if< HasAutomaticTransitionTag< T >::value, void >::type automaticTransitionTag(std::string &transition_name)
auto optionalNodeHandle(boost::intrusive_ptr< T > &obj) -> ros::NodeHandle
std::allocator< void > SmaccAllocator
std::string demangleSymbol()
std::enable_if< HasEventLabel< T >::value, void >::type EventLabel(std::string &label)
boost::mpl::list< SUCCESS, ABORT, PREEMPT, CONTINUELOOP, ENDLOOP > DEFAULT_TRANSITION_TYPES
std::string demangledTypeName()
std::string * transitionTypeName
CheckType(std::string *transitionTypeName)