Abstract State Machine class (state machine interface)
More...
#include "qp.hpp"
|
virtual | ~QAsm () noexcept |
| Virtual destructor of the QP::QAsm abstract base class.
|
|
virtual void | init (void const *const e, std::uint_fast8_t const qsId)=0 |
| Virtual function to take the top-most initial transition in the state machine.
|
|
virtual void | init (std::uint_fast8_t const qsId) |
| Virtual function to take the top-most initial transition in the state machine (overloaded).
|
|
virtual void | dispatch (QEvt const *const e, std::uint_fast8_t const qsId)=0 |
| Virtual function to dispatch an event to the state machine.
|
|
virtual bool | isIn (QStateHandler const stateHndl) noexcept |
| Virtual function to check whether the state machine is in a given state.
|
|
QStateHandler | state () const noexcept |
|
QMState const * | stateObj () const noexcept |
|
virtual QStateHandler | getStateHandler () noexcept |
| Virtual method for getting the state handler.
|
|
|
static QState | top (void *const me, QEvt const *const e) noexcept |
| Top state handler that ignores all events.
|
|
Abstract State Machine class (state machine interface)
- Backward Traceability
-
Definition at line 178 of file qp.hpp.
◆ QAsm()
|
inlineexplicitprotectednoexcept |
Constructor of the QP::QAsm base class.
- Details
- The constructor initializes the QAsm::vptr and clears the internal attributes. The constructor is "protected" because it is only intended to be invoked from the subclasses of the abstract base class QP::QAsm.
- Parameters
-
[in,out] | me | current instance pointer (see SAS_QP_OO) |
Definition at line 214 of file qp.hpp.
◆ ~QAsm()
virtual QP::QAsm::~QAsm |
( |
| ) |
|
|
inlinevirtualnoexcept |
Virtual destructor of the QP::QAsm abstract base class.
- Details
- Note
- This virtual destructor is not provided by default and is provided only when the macro Q_XTOR is defined. This is because a presence of virtual destructor(s) seems to pull in the
delete
operator from the C++ library. This, in turn, might be problematic for deeply embedded systems that work without the heap and any other libraries.
Definition at line 222 of file qp.hpp.
◆ init() [1/2]
virtual void QP::QAsm::init |
( |
void const *const | e, |
|
|
std::uint_fast8_t const | qsId ) |
|
pure virtual |
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).
- Parameters
-
[in] | e | pointer to an initialization parameter (might be nullptr) |
[in] | qsId | QS-id of this state machine (for QS local filter) |
Implemented in QP::QActive, QP::QHsm, QP::QMActive, QP::QMsm, and QP::QTicker.
◆ init() [2/2]
virtual void QP::QAsm::init |
( |
std::uint_fast8_t const | qsId | ) |
|
|
inlinevirtual |
Virtual function to take the top-most initial transition in the state machine (overloaded).
- Details
- Synchronously executes the top-most initial transition in a state machine. This overloaded version takes no initialization parameter.
- Parameters
-
[in] | qsId | QS-id of this state machine (for QS local filter) |
Reimplemented in QP::QActive, QP::QHsm, QP::QMActive, QP::QMsm, and QP::QTicker.
Definition at line 229 of file qp.hpp.
◆ dispatch()
virtual void QP::QAsm::dispatch |
( |
QEvt const *const | e, |
|
|
std::uint_fast8_t const | qsId ) |
|
pure virtual |
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.
- Parameters
-
[in] | e | pointer to the event to be dispatched to the MSM |
[in] | qsId | QS-id of this state machine (for QS local filter) |
Implemented in QP::QActive, QP::QHsm, QP::QMActive, QP::QMsm, and QP::QTicker.
◆ isIn()
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 of the state.
- Parameters
-
[in] | state | pointer to the state-handler function to be checked |
- Returns
- 'true' if the state machine "is in" the
state
and 'false' otherwise
- Attention
- This function must be called only on a state machine that is in the "stable state configuration". Among others, this means that the state machine cannot call it in the middle of its own transition.
- Precondition
qep_hsm:602
- internal integrity check (Software Self-Monitoring (SSM))
- Backward Traceability
- SRS_QP_SM_25: All State Machine Implementation Strategies provided by QP Framework might supply a method for checking if a state machine is in a given state
Reimplemented in QP::QActive, QP::QHsm, QP::QMActive, and QP::QMsm.
Definition at line 235 of file qp.hpp.
◆ state()
◆ stateObj()
QMState const * QP::QAsm::stateObj |
( |
| ) |
const |
|
inlinenoexcept |
◆ getStateHandler()
◆ top()
static QState QP::QAsm::top |
( |
void *const | me, |
|
|
QEvt const *const | e ) |
|
inlinestaticnoexcept |
Top state handler that ignores all events.
Definition at line 252 of file qp.hpp.
◆ tran()
Internal helper function to take a state transition in sublclasses of QP::QAsm.
Definition at line 262 of file qp.hpp.
◆ tran_hist()
Internal helper function to take a state transition to history in sublclasses of QP::QAsm.
Definition at line 266 of file qp.hpp.
◆ super()
Internal helper function to indicate superstate of a given state in sublclasses of QP::QAsm.
Definition at line 270 of file qp.hpp.
◆ qm_tran()
QState QP::QAsm::qm_tran |
( |
void const *const | tatbl | ) |
|
|
inlineprotectednoexcept |
Internal helper function to take a state transition in QP::QMsm.
Definition at line 274 of file qp.hpp.
◆ qm_tran_init()
QState QP::QAsm::qm_tran_init |
( |
void const *const | tatbl | ) |
|
|
inlineprotectednoexcept |
◆ qm_tran_hist()
QState QP::QAsm::qm_tran_hist |
( |
QMState const *const | hist, |
|
|
void const *const | tatbl ) |
|
inlineprotectednoexcept |
Internal helper function to take a state transition to history in QP::QMsm.
Definition at line 282 of file qp.hpp.
◆ qm_entry()
Internal helper function to execute state entry actions in QP::QMsm.
Definition at line 292 of file qp.hpp.
◆ qm_exit()
Internal helper function to execute state exit actions in QP::QMsm.
Definition at line 306 of file qp.hpp.
◆ m_state
Current state (pointer to the current state-handler function)
Definition at line 180 of file qp.hpp.
◆ m_temp
Temporary storage for target/act-table etc.
- Details
- The
m_temp
data member is used for passing information from the QP Application to the "event processor" of QP. The m_temp
member is also used as the Duplicate Inverse Storage of the state
attribute in between transitions (part of QP Functional Safety (FuSa) Subsystem).
Definition at line 181 of file qp.hpp.
◆ Q_RET_SUPER
QState QP::QAsm::Q_RET_SUPER {0U} |
|
staticconstexpr |
◆ Q_RET_UNHANDLED
QState QP::QAsm::Q_RET_UNHANDLED {1U} |
|
staticconstexpr |
◆ Q_RET_HANDLED
QState QP::QAsm::Q_RET_HANDLED {2U} |
|
staticconstexpr |
◆ Q_RET_IGNORED
QState QP::QAsm::Q_RET_IGNORED {3U} |
|
staticconstexpr |
◆ Q_RET_ENTRY
QState QP::QAsm::Q_RET_ENTRY {4U} |
|
staticconstexpr |
◆ Q_RET_EXIT
QState QP::QAsm::Q_RET_EXIT {5U} |
|
staticconstexpr |
◆ Q_RET_NULL
QState QP::QAsm::Q_RET_NULL {6U} |
|
staticconstexpr |
◆ Q_RET_TRAN
QState QP::QAsm::Q_RET_TRAN {7U} |
|
staticconstexpr |
◆ Q_RET_TRAN_INIT
QState QP::QAsm::Q_RET_TRAN_INIT {8U} |
|
staticconstexpr |
◆ Q_RET_TRAN_HIST
QState QP::QAsm::Q_RET_TRAN_HIST {9U} |
|
staticconstexpr |
◆ Q_EMPTY_SIG
◆ Q_ENTRY_SIG
◆ Q_EXIT_SIG
◆ Q_INIT_SIG
The documentation for this class was generated from the following files: