SMACC
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
smacc::introspection::StateReactorHandler Class Reference

#include <smacc_state_info.h>

Collaboration diagram for smacc::introspection::StateReactorHandler:
Collaboration graph

Public Member Functions

void configureStateReactor (std::shared_ptr< smacc::StateReactor > sr)
 
template<typename TEv >
void addInputEvent ()
 
template<typename TEv >
void setOutputEvent ()
 

Public Attributes

std::shared_ptr< smacc::introspection::SmaccStateReactorInfosrInfo_
 

Private Attributes

std::vector< StateReactorCallbackFunctorcallbacks_
 

Detailed Description

Definition at line 68 of file smacc_state_info.h.

Member Function Documentation

◆ addInputEvent()

template<typename TEv >
void smacc::introspection::StateReactorHandler::addInputEvent

Definition at line 66 of file smacc_state_reactor_impl.h.

67{
68 StateReactorCallbackFunctor functor;
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>();
72 };
73
74 this->callbacks_.push_back(functor);
75
76 auto evtype = TypeInfo::getFromStdTypeInfo(typeid(TEv));
77 auto evinfo = std::make_shared<SmaccEventInfo>(evtype);
78 EventLabel<TEv>(evinfo->label);
79
80 srInfo_->sourceEventTypes.push_back(evinfo);
81}
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)
Definition: introspection.h:86

References callbacks_, smacc::introspection::demangleType(), smacc::introspection::StateReactorCallbackFunctor::fn, smacc::introspection::TypeInfo::getFromStdTypeInfo(), and srInfo_.

Here is the call graph for this function:

◆ configureStateReactor()

void smacc::introspection::StateReactorHandler::configureStateReactor ( std::shared_ptr< smacc::StateReactor sr)

Definition at line 46 of file state_reactor.cpp.

47{
48 for (auto callback : this->callbacks_)
49 {
50 callback.fn(sb);
51 }
52}

References callbacks_.

◆ setOutputEvent()

template<typename TEv >
void smacc::introspection::StateReactorHandler::setOutputEvent

Definition at line 84 of file smacc_state_reactor_impl.h.

85{
86 StateReactorCallbackFunctor functor;
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>();
90 };
91
92 this->callbacks_.push_back(functor);
93}

References callbacks_, smacc::introspection::demangleType(), smacc::introspection::StateReactorCallbackFunctor::fn, and srInfo_.

Here is the call graph for this function:

Member Data Documentation

◆ callbacks_

std::vector<StateReactorCallbackFunctor> smacc::introspection::StateReactorHandler::callbacks_
private

Definition at line 71 of file smacc_state_info.h.

Referenced by addInputEvent(), configureStateReactor(), and setOutputEvent().

◆ srInfo_

std::shared_ptr<smacc::introspection::SmaccStateReactorInfo> smacc::introspection::StateReactorHandler::srInfo_

Definition at line 82 of file smacc_state_info.h.

Referenced by addInputEvent(), and setOutputEvent().


The documentation for this class was generated from the following files: