57Q_DEFINE_THIS_MODULE(
"qep_msm")
60static struct
QMState const l_msm_top_s = {
84#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
85#error qpc version 7.3.0 or higher required
94void QMsm_ctor(
QMsm *
const me,
102 ,&QMsm_getStateHandler_
115 void const *
const e,
116 uint_fast8_t
const qsId)
126 && (me->
state.
obj == &l_msm_top_s));
153 r = QMsm_execTatbl_(me, me->
temp.
tatbl, qsId);
179 QEvt const *
const e,
180 uint_fast8_t
const qsId)
242 }
while ((t != (
QMState *)0) && (lbound > 0));
266 QMsm_exitToTranSource_(me, s, t, qsId);
267 r = QMsm_execTatbl_(me,
tatbl, qsId);
274 QMsm_exitToTranSource_(me, s, t, qsId);
275 (void)QMsm_execTatbl_(me,
tatbl, qsId);
276 r = QMsm_enterHistory_(me, tmp.
obj, qsId);
292 QMsm_exitToTranSource_(me, s, t, qsId);
294 (void)QMsm_execTatbl_(me,
tatbl, qsId);
304 QMsm_exitToTranSource_(me, me->
state.
obj, t, qsId);
306 (void)QMsm_execTatbl_(me,
tatbl, qsId);
391 bool inState =
false;
395 for (; (s != (
QMState *)0) && (lbound > 0); --lbound) {
415bool QMsm_isInState(
QMsm const *
const me,
416 QMState const *
const stateObj)
418 bool inState =
false;
422 for (; (s != (
QMState *)0) && (lbound > 0); --lbound) {
446 bool isFound =
false;
451 (s != (
QMState *)0) && (lbound > 0);
471 (s != (
QMState *)0) && (lbound > 0);
499 uint_fast8_t
const qsId)
575void QMsm_exitToTranSource_(
579 uint_fast8_t
const qsId)
590 for (; (s != ts) && (lbound > 0); --lbound) {
594 (void)(*s->exitAction)(me);
600 QS_FUN_PRE_(s->stateHandler);
625 uint_fast8_t
const qsId)
665 (void)(*epath[i]->entryAction)(me);
671 QS_FUN_PRE_(epath[i]->stateHandler);
@ Q_RET_ENTRY
state entry action executed
@ Q_RET_HANDLED
event handled (internal transition)
@ Q_RET_TRAN_XP
exit-point transition out of a submachine
@ Q_RET_TRAN_INIT
initial transition in a state or submachine
@ Q_RET_TRAN
regular transition
@ Q_RET_UNHANDLED
event unhandled due to a guard
@ Q_RET_SUPER
event passed to superstate to handle
@ Q_RET_NULL
return value without any effect
@ Q_RET_TRAN_HIST
transition to history of a given state
@ Q_RET_SUPER_SUB
event passed to submachine superstate
@ Q_RET_TRAN_EP
entry-point transition into a submachine
@ Q_RET_EXIT
state exit action executed
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
#define Q_STATE_CAST(handler_)
Perform cast to QStateHandler.
QState(* QStateHandler)(void *const me, QEvt const *const e)
Pointer to a state-handler function.
#define Q_ACTION_CAST(action_)
Perform cast to QActionHandler.
enum QStateRet QState
Type returned from state-handler functions.
#define Q_EVT_CAST(class_)
Perform downcast of an event onto a subclass of QEvt class_
QState(* QActionHandler)(void *const me)
Pointer to an action-handler function.
Internal (package scope) QP/C interface.
@ QS_QEP_STATE_INIT
an initial transition was taken in a state
@ QS_QEP_TRAN_HIST
a tran. to history was taken
@ QS_QEP_TRAN_EP
a tran. to entry point into a submachine
@ QS_QEP_STATE_EXIT
a state was exited
@ QS_QEP_INIT_TRAN
the top-most initial transition was taken
@ QS_QEP_INTERN_TRAN
an internal transition was taken
@ QS_QEP_TRAN_XP
a tran. to exit point out of a submachine
@ QS_QEP_STATE_ENTRY
a state was entered
@ QS_QEP_UNHANDLED
an event was un-handled due to a guard
@ QS_QEP_TRAN
a regular transition was taken
@ QS_QEP_DISPATCH
an event was dispatched (begin of RTC step)
@ QS_QEP_IGNORED
an event was ignored (silently discarded)
QS/C package-scope interface.
QP Functional Safety (FuSa) Subsystem.
#define Q_ASSERT_INCRIT(id_, expr_)
#define Q_INVARIANT_INCRIT(id_, expr_)
#define Q_ENSURE_INCRIT(id_, expr_)
#define Q_REQUIRE_INCRIT(id_, expr_)
Abstract State Machine class (state machine interface)
struct QAsmVtable const * vptr
Virtual pointer inherited by all QAsm subclasses (see also Object Orientation)
union QAsmAttr state
Current state (pointer to the current state-handler function)
union QAsmAttr temp
Temporary storage for target/act-table etc.
Virtual table for the QAsm class.
QSignal sig
Signal of the event (see Event Signal)
State object for the QMsm class (QM State Machine)
struct QMState const * superstate
QActionHandler const entryAction
QActionHandler const initAction
QStateHandler const stateHandler
Transition-Action Table for the QMsm State Machine.
QActionHandler const act[1]
Hierarchical State Machine class (QMsm-style state machine implementation strategy)
Attribute of for the QAsm class (Abstract State Machine)
QMTranActTable const * tatbl
struct QMState const * obj