SMACC2
|
#include <smacc_state_reactor.hpp>
Public Member Functions | |
StateReactor () | |
virtual | ~StateReactor () |
virtual void | onInitialized () |
virtual void | onEntry () |
virtual void | onExit () |
virtual void | onEventNotified (const std::type_info *eventType) |
template<typename EventType > | |
void | postEvent (const EventType &ev) |
template<typename EventType > | |
void | postEvent () |
template<typename T , typename TClass > | |
void | createEventCallback (void(TClass::*callback)(T *), TClass *object) |
template<typename T > | |
void | createEventCallback (std::function< void(T *)> callback) |
void | update () |
virtual bool | triggers ()=0 |
template<typename TEv > | |
void | addInputEvent () |
template<typename TEv > | |
void | setOutputEvent () |
void | initialize (ISmaccState *ownerState) |
rclcpp::Node::SharedPtr & | getNode () |
rclcpp::Logger | getLogger () |
Public Attributes | |
ISmaccState * | ownerState |
std::function< void()> | postEventFn |
std::vector< const std::type_info * > | eventTypes |
std::map< const std::type_info *, std::function< void(void *)> > | eventCallbacks_ |
Private Member Functions | |
template<typename TEvent > | |
void | notifyEvent (TEvent *ev) |
Private Attributes | |
friend | ISmaccStateMachine |
Definition at line 43 of file smacc_state_reactor.hpp.
smacc2::StateReactor::StateReactor | ( | ) |
Definition at line 29 of file state_reactor.cpp.
|
virtual |
Definition at line 31 of file state_reactor.cpp.
void smacc2::StateReactor::addInputEvent |
Definition at line 51 of file smacc_state_reactor_impl.hpp.
References eventTypes.
Referenced by smacc2::AddTEventTypeStateReactor< TEventList >::operator()().
void smacc2::StateReactor::createEventCallback | ( | std::function< void(T *)> | callback | ) |
Definition at line 67 of file smacc_state_reactor_impl.hpp.
References callback(), and eventCallbacks_.
void smacc2::StateReactor::createEventCallback | ( | void(TClass::*)(T *) | callback, |
TClass * | object | ||
) |
Definition at line 57 of file smacc_state_reactor_impl.hpp.
References callback(), and eventCallbacks_.
Referenced by smacc2::state_reactors::SrConditional< TEv >::SrConditional().
rclcpp::Logger smacc2::StateReactor::getLogger | ( | ) |
Definition at line 58 of file state_reactor.cpp.
References smacc2::ISmaccState::getLogger(), and ownerState.
Referenced by smacc2::state_reactors::SrAllEventsGo::onEventNotified(), smacc2::state_reactors::SrEventCountdown::onEventNotified(), setOutputEvent(), smacc2::state_reactors::SrAllEventsGo::triggers(), smacc2::state_reactors::SrEventCountdown::triggers(), and update().
rclcpp::Node::SharedPtr & smacc2::StateReactor::getNode | ( | ) |
Definition at line 56 of file state_reactor.cpp.
References smacc2::ISmaccState::getNode(), and ownerState.
void smacc2::StateReactor::initialize | ( | smacc2::ISmaccState * | ownerState | ) |
Definition at line 33 of file state_reactor.cpp.
References onInitialized(), and ownerState.
|
inlineprivate |
Definition at line 97 of file smacc_state_reactor.hpp.
References eventCallbacks_, eventTypes, onEventNotified(), and update().
|
virtual |
Definition at line 43 of file state_reactor.cpp.
|
virtual |
Reimplemented in smacc2::state_reactors::SrAllEventsGo, and smacc2::state_reactors::SrEventCountdown.
Definition at line 41 of file state_reactor.cpp.
Referenced by notifyEvent().
|
virtual |
Definition at line 45 of file state_reactor.cpp.
|
virtual |
Reimplemented in smacc2::state_reactors::SrAllEventsGo, and smacc2::state_reactors::SrEventCountdown.
Definition at line 39 of file state_reactor.cpp.
Referenced by initialize().
void smacc2::StateReactor::postEvent |
Definition at line 34 of file smacc_state_reactor_impl.hpp.
References ownerState, and smacc2::ISmaccState::postEvent().
void smacc2::StateReactor::postEvent | ( | const EventType & | ev | ) |
Definition at line 28 of file smacc_state_reactor_impl.hpp.
References ownerState, and smacc2::ISmaccState::postEvent().
void smacc2::StateReactor::setOutputEvent |
Definition at line 40 of file smacc_state_reactor_impl.hpp.
References getLogger(), smacc2::ISmaccState::getStateMachine(), ownerState, smacc2::ISmaccStateMachine::postEvent(), and postEventFn.
|
pure virtual |
Implemented in smacc2::state_reactors::SrConditional< TEv >, smacc2::state_reactors::SrAllEventsGo, and smacc2::state_reactors::SrEventCountdown.
Referenced by update().
void smacc2::StateReactor::update | ( | ) |
Definition at line 47 of file state_reactor.cpp.
References getLogger(), postEventFn, and triggers().
Referenced by notifyEvent().
std::map<const std::type_info *, std::function<void(void *)> > smacc2::StateReactor::eventCallbacks_ |
Definition at line 49 of file smacc_state_reactor.hpp.
Referenced by createEventCallback(), and notifyEvent().
std::vector<const std::type_info *> smacc2::StateReactor::eventTypes |
Definition at line 48 of file smacc_state_reactor.hpp.
Referenced by addInputEvent(), notifyEvent(), smacc2::state_reactors::SrAllEventsGo::onInitialized(), and smacc2::state_reactors::SrEventCountdown::onInitialized().
|
private |
Definition at line 94 of file smacc_state_reactor.hpp.
ISmaccState* smacc2::StateReactor::ownerState |
Definition at line 46 of file smacc_state_reactor.hpp.
Referenced by getLogger(), getNode(), initialize(), postEvent(), and setOutputEvent().
std::function<void()> smacc2::StateReactor::postEventFn |
Definition at line 47 of file smacc_state_reactor.hpp.
Referenced by setOutputEvent(), and update().