47Q_DEFINE_THIS_MODULE(
"qep_msm")
50static struct
QMState const l_msm_top_s = {
60#define QS_STATE_ACT_(rec_, state_) \
62 QS_BEGIN_PRE((rec_), qsId) \
69#define QS_TOP_INIT_(rec_, trg_) \
71 QS_BEGIN_PRE((rec_), qsId) \
79#define QS_TRAN_SEG_(rec_, src_, trg_) \
81 QS_BEGIN_PRE((rec_), qsId) \
89#define QS_TRAN0_(rec_, trg_) \
91 QS_BEGIN_PRE((rec_), qsId) \
100#define QS_TRAN_END_(rec_, src_, trg_) \
102 QS_BEGIN_PRE((rec_), qsId) \
104 QS_SIG_PRE(e->sig); \
112#define QS_STATE_ACT_(rec_, state_) ((void)0)
113#define QS_TOP_INIT_(rec_, trg_) ((void)0)
114#define QS_TRAN_SEG_(rec_, src_, trg_) ((void)0)
115#define QS_TRAN0_(rec_, trg_) ((void)0)
116#define QS_TRAN_END_(rec_, src_, trg_) ((void)0)
123static QState QMsm_execTatbl_(
126 uint_fast8_t
const qsId);
129static void QMsm_exitToTranSource_(
133 uint_fast8_t
const qsId);
136static QState QMsm_enterHistory_(
139 uint_fast8_t
const qsId);
164 void const *
const e,
165 uint_fast8_t
const qsId)
175 && (me->
state.
obj == &l_msm_top_s));
186 QS_TRAN_SEG_(QS_QEP_STATE_INIT,
205 QEvt const *
const e,
206 uint_fast8_t
const qsId)
260 QS_TRAN_SEG_(QS_QEP_TRAN_HIST,
308 bool inState =
false;
337 bool isFound =
false;
364 uint_fast8_t
const qsId)
390 QS_TRAN_SEG_(QS_QEP_STATE_INIT,
415 uint_fast8_t
const qsId)
428 (void)(*s->exitAction)(me);
441 uint_fast8_t
const qsId)
465 for (i = i - 1; i >= 0; --i) {
467 (void)(*epath[i]->entryAction)(me);
469 QS_STATE_ACT_(QS_QEP_STATE_ENTRY, epath[i]->stateHandler);
479 QS_TRAN_SEG_(QS_QEP_STATE_INIT,
#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.
#define Q_EVT_CAST(class_)
Perform downcast of an event onto a subclass of QEvt class_
uint_fast8_t QState
Type returned from state-handler functions.
QState(* QActionHandler)(void *const me)
Pointer to an action-handler function.
#define QS_BEGIN_PRE(rec_, qsId_)
#define Q_ASSERT_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)
static QState QMsm_enterHistory_(QAsm *const me, QMState const *const hist, uint_fast8_t const qsId)
static void QMsm_exitToTranSource_(QAsm *const me, QMState const *const cs, QMState const *const ts, uint_fast8_t const qsId)
void QMsm_init_(QAsm *const me, void const *const e, uint_fast8_t const qsId)
static QState QMsm_execTatbl_(QAsm *const me, QMTranActTable const *const tatbl, uint_fast8_t const qsId)
QStateHandler QMsm_getStateHandler_(QAsm *const me)
bool QMsm_isIn_(QAsm *const me, QStateHandler const state)
QMState const * QMsm_childStateObj(QMsm const *const me, QMState const *const parent)
void QMsm_dispatch_(QAsm *const me, QEvt const *const e, uint_fast8_t const qsId)
void QMsm_ctor(QMsm *const me, QStateHandler const initial)
QMTranActTable const * tatbl
struct QMState const * obj