Hierarchical State Machine class (QMsm-style state machine implementation strategy) More...
#include "qp.hpp"
Public Member Functions | |
void | init (void const *const e, std::uint_fast8_t const qsId) override |
Virtual function to take the top-most initial transition in the state machine. | |
void | init (std::uint_fast8_t const qsId) override |
Virtual function to take the top-most initial transition in the state machine (overloaded). | |
void | dispatch (QEvt const *const e, std::uint_fast8_t const qsId) override |
Virtual function to dispatch an event to the state machine. | |
QStateHandler | getStateHandler () noexcept override |
bool | isIn (QStateHandler const state) noexcept override |
QMState const * | childStateObj (QMState const *const parent) const noexcept |
QMState const * | topQMState () const noexcept |
Public Member Functions inherited from QP::QAsm | |
virtual | ~QAsm () noexcept |
Virtual destructor of the QP::QAsm abstract base class. | |
QStateHandler | state () const noexcept |
QMState const * | stateObj () const noexcept |
Protected Member Functions | |
QMsm (QStateHandler const initial) noexcept | |
Protected Member Functions inherited from QP::QAsm | |
QAsm () noexcept | |
Constructor of the QP::QAsm base class. | |
QState | tran (QStateHandler const target) noexcept |
Internal helper function to take a state transition in sublclasses of QP::QAsm. | |
QState | tran_hist (QStateHandler const hist) noexcept |
Internal helper function to take a state transition to history in sublclasses of QP::QAsm. | |
QState | super (QStateHandler const superstate) noexcept |
Internal helper function to indicate superstate of a given state in sublclasses of QP::QAsm. | |
QState | qm_tran (void const *const tatbl) noexcept |
Internal helper function to take a state transition in QP::QMsm. | |
QState | qm_tran_init (void const *const tatbl) noexcept |
QState | qm_tran_hist (QMState const *const hist, void const *const tatbl) noexcept |
Internal helper function to take a state transition to history in QP::QMsm. | |
QState | qm_entry (QMState const *const s) noexcept |
Internal helper function to execute state entry actions in QP::QMsm. | |
QState | qm_exit (QMState const *const s) noexcept |
Internal helper function to execute state exit actions in QP::QMsm. | |
Private Member Functions | |
QState | execTatbl_ (QMTranActTable const *const tatbl, std::uint_fast8_t const qsId) |
void | exitToTranSource_ (QMState const *const cs, QMState const *const ts, std::uint_fast8_t const qsId) |
QState | enterHistory_ (QMState const *const hist, std::uint_fast8_t const qsId) |
Additional Inherited Members | |
Public Types inherited from QP::QAsm | |
enum | QStateRet : QState { Q_RET_SUPER , Q_RET_UNHANDLED , Q_RET_HANDLED , Q_RET_IGNORED , Q_RET_ENTRY , Q_RET_EXIT , Q_RET_NULL , Q_RET_TRAN , Q_RET_TRAN_INIT , Q_RET_TRAN_HIST } |
enum | ReservedSig : QSignal { Q_EMPTY_SIG , Q_ENTRY_SIG , Q_EXIT_SIG , Q_INIT_SIG } |
Reserved signals by the QP-framework. More... | |
Static Public Member Functions inherited from QP::QAsm | |
static QState | top (void *const me, QEvt const *const e) noexcept |
Top state handler that ignores all events. | |
Protected Attributes inherited from QP::QAsm | |
QAsmAttr | m_state |
Current state (pointer to the current state-handler function) | |
QAsmAttr | m_temp |
Temporary storage for target/act-table etc. | |
Hierarchical State Machine class (QMsm-style state machine implementation strategy)
|
explicitprotectednoexcept |
Constructor of QP::QMsm
[in] | initial | the top-most initial transition for the MSM. |
Definition at line 89 of file qep_msm.cpp.
|
overridevirtual |
Virtual function to take the top-most initial transition in the state machine.
[in] | e | pointer to an initialization parameter (might be nullptr) |
[in] | qsId | QS-id of this state machine (for QS local filter) |
Implements QP::QAsm.
Definition at line 97 of file qep_msm.cpp.
|
inlineoverridevirtual |
Virtual function to take the top-most initial transition in the state machine (overloaded).
[in] | qsId | QS-id of this state machine (for QS local filter) |
Reimplemented from QP::QAsm.
|
overridevirtual |
Virtual function to dispatch an event to the state machine.
[in] | e | pointer to the event to be dispatched to the MSM |
[in] | qsId | QS-id of this state machine (for QS local filter) |
Implements QP::QAsm.
Definition at line 158 of file qep_msm.cpp.
|
inlineoverridevirtualnoexcept |
Implementation of getting the state handler in a QP::QMsm subclass
Obtain the current active state from a MSM (read only)
Reimplemented from QP::QAsm.
|
overridevirtualnoexcept |
qep_hsm:602
Reimplemented from QP::QAsm.
Definition at line 328 of file qep_msm.cpp.
Obtain the current active child state of a given parent in QP::QMsm
parent
, such that this child state is an ancestor of the currently active state. The main purpose of this function is to support **shallow history*transitions in state machines derived from QMsm.[in] | parent | pointer to the state-handler object |
parent
state, which is an ancestor of the currently active state. For the corner case when the currently active state is the given parent
state, function returns the parent
state.qep_msm:890
Definition at line 352 of file qep_msm.cpp.
|
private |
Execute transition-action table
[in] | tatbl | pointer to the transition-action table |
[in] | qsId | QS-id of this state machine (for QS local filter) |
qep_msm:400
Definition at line 403 of file qep_msm.cpp.
|
private |
Exit the current state up to the explicit transition source
[in] | cs | pointer to the current state |
[in] | ts | pointer to the transition source state |
[in] | qsId | QS-id of this state machine (for QS local filter) |
Definition at line 466 of file qep_msm.cpp.
Enter history of a composite state
[in] | hist | pointer to the history substate |
[in] | qsId | QS-id of this state machine (for QS local filter) |
Definition at line 504 of file qep_msm.cpp.
|
noexcept |
Definition at line 567 of file qep_msm.cpp.