Dummy hierarchical state machine class for testing. More...
#include <qs.hpp>
Public Member Functions | |
| QHsmDummy () | |
| 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 | dispatch (QEvt const *const e, std::uint_fast8_t const qsId) override |
| Virtual function to dispatch an event to the state machine. | |
| bool | isIn (QStateHandler const stateHndl) override |
| Virtual function to check whether the state machine is in a given state. | |
| QStateHandler | getStateHandler () const noexcept override |
| Virtual method for getting the current state handler. | |
| Public Member Functions inherited from QP::QAsm | |
| virtual | ~QAsm () noexcept |
| Virtual destructor of the QP::QAsm abstract base class. | |
| virtual void | init (std::uint_fast8_t const qsId) |
| Virtual function to take the top-most initial transition in the state machine (overloaded). | |
| QStateHandler | state () const noexcept |
| QMState const * | stateObj () const noexcept |
Additional Inherited Members | |
| Static Public Member Functions inherited from QP::QAsm | |
| static constexpr QState | Q_HANDLED () |
| static constexpr QState | Q_UNHANDLED () |
| static constexpr QState | QM_HANDLED () |
| static constexpr QState | QM_UNHANDLED () |
| static constexpr QState | QM_SUPER () |
| static QState | top (void *const me, QEvt const *const e) noexcept |
| Top state handler that ignores all events. | |
| Public 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. | |
| Static Public Attributes inherited from QP::QAsm | |
| static constexpr QState | Q_RET_SUPER {0U} |
| static constexpr QState | Q_RET_UNHANDLED {1U} |
| static constexpr QState | Q_RET_HANDLED {2U} |
| static constexpr QState | Q_RET_TRAN {3U} |
| static constexpr QState | Q_RET_TRAN_HIST {4U} |
| static constexpr QState | Q_RET_IGNORED {5U} |
| static constexpr QState | Q_RET_ENTRY {6U} |
| static constexpr QState | Q_RET_EXIT {7U} |
| static constexpr QState | Q_RET_TRAN_INIT {8U} |
| static constexpr QSignal | Q_EMPTY_SIG {0U} |
| static constexpr QSignal | Q_ENTRY_SIG {1U} |
| static constexpr QSignal | Q_EXIT_SIG {2U} |
| static constexpr QSignal | Q_INIT_SIG {3U} |
| static constexpr QMState const * | QM_STATE_NULL { nullptr } |
| static constexpr QActionHandler const | Q_ACTION_NULL { nullptr } |
| 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. | |
Dummy hierarchical state machine class for testing.
Details
QP::QHsmDummy is a test double for the role of "Orthogonal Components" state machine objects in QUTest unit testing.
| QP::QHsmDummy::QHsmDummy | ( | ) |
Definition at line 395 of file qutest.cpp.
|
overridevirtual |
Virtual function to take the top-most initial transition in the state machine.
Details
Synchronously executes the top-most initial transition in a state machine (must be overridden in the subclasses).
| [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 400 of file qutest.cpp.
|
overridevirtual |
Virtual function to dispatch an event to the state machine.
Details
Synchronously dispatches an event for processing to a state machine (must be overridden in the subclasses). The processing of an event represents one run-to-completion (RTC) step.
| [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 431 of file qutest.cpp.
|
overridevirtual |
Virtual function to check whether the state machine is in a given state.
Details
Tests if a given state is part of the current active state configuration. Please note that in a hierarchical state machine, to "be in a state" means also to be in a superstate of the state.
| [in] | state | pointer to the state-handler function to be checked |
Backward Traceability
Implements QP::QAsm.
Definition at line 446 of file qutest.cpp.
|
overridevirtualnoexcept |
Virtual method for getting the current state handler.
Details
This virtual call applies to all subclasses of QP::QAsm, such as: QP::QHsm, QP::QMsm, QP::QActive, and QP::QMActive.
Backward Traceability
Usage
The following example illustrates how to obtain the current state handler of an Active Object:
Implements QP::QAsm.
Definition at line 451 of file qutest.cpp.