14template <
typename EventType>
20template <
typename EventType>
26template <
typename TEv>
30 ROS_INFO_STREAM(
"[State Reactor Base] postingfn posting event: " << demangleSymbol<TEv>());
36template <
typename TEv>
42template <
typename T,
typename TClass>
45 const auto *eventtype = &
typeid(T);
48 (
object->*callback)(evptr);
55 const auto *eventtype = &
typeid(T);
62namespace introspection
65template <
typename TEv>
69 functor.
fn = [=](std::shared_ptr<smacc::StateReactor> sr) {
70 ROS_INFO(
"[%s] State Reactor adding input event: %s",
demangleType(
srInfo_->stateReactorType).c_str(), demangledTypeName<TEv>().c_str());
71 sr->addInputEvent<TEv>();
77 auto evinfo = std::make_shared<SmaccEventInfo>(evtype);
78 EventLabel<TEv>(evinfo->label);
80 srInfo_->sourceEventTypes.push_back(evinfo);
83template <
typename TEv>
87 functor.
fn = [=](std::shared_ptr<smacc::StateReactor> sr) {
88 ROS_INFO(
"[%s] State Reactor setting output event: %s",
demangleType(
srInfo_->stateReactorType).c_str(), demangledTypeName<TEv>().c_str());
89 sr->setOutputEvent<TEv>();
void postEvent(EventType *ev, EventLifeTime evlifetime=EventLifeTime::ABSOLUTE)
virtual ISmaccStateMachine & getStateMachine()=0
void postEvent(const EventType &ev)
std::function< void()> postEventFn
std::map< const std::type_info *, std::function< void(void *)> > eventCallbacks_
std::vector< const std::type_info * > eventTypes
void createEventCallback(void(TClass::*callback)(T *), TClass *object)
std::vector< StateReactorCallbackFunctor > callbacks_
std::shared_ptr< smacc::introspection::SmaccStateReactorInfo > srInfo_
static TypeInfo::Ptr getFromStdTypeInfo(const std::type_info &tid)
std::string demangleType(const std::type_info *tinfo)
std::function< void(std::shared_ptr< smacc::StateReactor >)> fn