SMACC
|
#include <smacc_state_reactor.h>
Public Member Functions | |
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) |
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 29 of file smacc_state_reactor.h.
smacc::StateReactor::StateReactor | ( | ) |
Definition at line 7 of file state_reactor.cpp.
void smacc::StateReactor::addInputEvent |
Definition at line 37 of file smacc_state_reactor_impl.h.
References eventTypes.
Referenced by smacc::AddTEventType< TEventList >::operator()().
void smacc::StateReactor::createEventCallback | ( | std::function< void(T *)> | callback | ) |
Definition at line 53 of file smacc_state_reactor_impl.h.
References eventCallbacks_.
void smacc::StateReactor::createEventCallback | ( | void(TClass::*)(T *) | callback, |
TClass * | object | ||
) |
Definition at line 43 of file smacc_state_reactor_impl.h.
References eventCallbacks_.
Referenced by smacc::state_reactors::Srsr_conditional::Srsr_conditional().
void smacc::StateReactor::initialize | ( | smacc::ISmaccState * | ownerState | ) |
Definition at line 11 of file state_reactor.cpp.
References onInitialized(), and ownerState.
|
inlineprivate |
Definition at line 78 of file smacc_state_reactor.h.
References eventCallbacks_, eventTypes, onEventNotified(), and update().
|
virtual |
Definition at line 25 of file state_reactor.cpp.
|
virtual |
Reimplemented in smacc::state_reactors::SrAllEventsGo, and smacc::state_reactors::SrEventCountdown.
Definition at line 21 of file state_reactor.cpp.
Referenced by notifyEvent().
|
virtual |
Definition at line 30 of file state_reactor.cpp.
|
virtual |
Reimplemented in smacc::state_reactors::SrAllEventsGo, and smacc::state_reactors::SrEventCountdown.
Definition at line 17 of file state_reactor.cpp.
Referenced by initialize().
void smacc::StateReactor::postEvent |
Definition at line 21 of file smacc_state_reactor_impl.h.
References ownerState, and smacc::ISmaccState::postEvent().
void smacc::StateReactor::postEvent | ( | const EventType & | ev | ) |
Definition at line 15 of file smacc_state_reactor_impl.h.
References ownerState, and smacc::ISmaccState::postEvent().
void smacc::StateReactor::setOutputEvent |
Definition at line 27 of file smacc_state_reactor_impl.h.
References smacc::ISmaccState::getStateMachine(), ownerState, smacc::ISmaccStateMachine::postEvent(), and postEventFn.
|
pure virtual |
Implemented in smacc::state_reactors::SrAllEventsGo, smacc::state_reactors::Srsr_conditional, and smacc::state_reactors::SrEventCountdown.
Referenced by update().
void smacc::StateReactor::update | ( | ) |
Definition at line 35 of file state_reactor.cpp.
References postEventFn, and triggers().
Referenced by notifyEvent().
std::map<const std::type_info *, std::function<void(void *)> > smacc::StateReactor::eventCallbacks_ |
Definition at line 35 of file smacc_state_reactor.h.
Referenced by createEventCallback(), and notifyEvent().
std::vector<const std::type_info *> smacc::StateReactor::eventTypes |
Definition at line 34 of file smacc_state_reactor.h.
Referenced by addInputEvent(), notifyEvent(), smacc::state_reactors::SrAllEventsGo::onInitialized(), and smacc::state_reactors::SrEventCountdown::onInitialized().
|
private |
Definition at line 75 of file smacc_state_reactor.h.
ISmaccState* smacc::StateReactor::ownerState |
Definition at line 32 of file smacc_state_reactor.h.
Referenced by initialize(), postEvent(), and setOutputEvent().
std::function<void()> smacc::StateReactor::postEventFn |
Definition at line 33 of file smacc_state_reactor.h.
Referenced by setOutputEvent(), and update().