QM state machine implementation strategy. More...
#include "qep.h"
Public Member Functions | |
bool | QMsm_isInState (QMsm const *const me, QMState const *const state) |
QMState const * | QMsm_stateObj (QHsm const *const me) |
QMState const * | QMsm_childStateObj (QHsm const *const me, QMState const *const parent) |
QStateHandler | QMsm_getStateHandler_ (QHsm *const me) |
![]() | |
bool | QHsm_isIn (QHsm *const me, QStateHandler const state) |
QStateHandler | QHsm_childState (QHsm *const me, QStateHandler const parent) |
Public Attributes | |
QHsm | super |
Protected Member Functions | |
void | QMsm_ctor (QMsm *const me, QStateHandler const initial) |
![]() | |
void | QHsm_ctor (QHsm *const me, QStateHandler const initial) |
QState | QHsm_top (QHsm const *const me, QEvt const *const e) |
void | QHsm_init_ (QHsm *const me, void const *const e, uint_fast8_t const qs_id) |
void | QHsm_dispatch_ (QHsm *const me, QEvt const *const e, uint_fast8_t const qs_id) |
Private Member Functions | |
void | QMsm_init_ (QHsm *const me, void const *const e, uint_fast8_t const qs_id) |
void | QMsm_dispatch_ (QHsm *const me, QEvt const *const e, uint_fast8_t const qs_id) |
QState | QMsm_execTatbl_ (QHsm *const me, QMTranActTable const *const tatbl, uint_fast8_t const qs_id) |
void | QMsm_exitToTranSource_ (QHsm *const me, QMState const *const cs, QMState const *const ts, uint_fast8_t const qs_id) |
QState | QMsm_enterHistory_ (QHsm *const me, QMState const *const hist, uint_fast8_t const qs_id) |
Additional Inherited Members | |
![]() | |
static QStateHandler | QHsm_state (QHsm *const me) |
QMsm (QM State Machine) provides a more efficient state machine implementation strategy than QHsm, but requires the use of the QM modeling tool, but are the fastest and need the least run-time support (the smallest event-processor taking up the least code space).
Tests if a given state is part of the current active state configuration in a MSM.
Tests if a state machine derived from QMsm is-in a given state.
[in] | me | current instance pointer (see oop) |
[in] | state | pointer to the QMState object that corresponds to the tested state. |
state
and 'false' otherwise Obtain the current active child state of a given parent in QMsm
Finds the child state of the given 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] | me | current instance pointer (see oop) |
[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
|
protected |
Constructor of QMsm
Performs the first step of QMsm initialization by assigning the initial pseudostate to the currently active state of the state machine.
[in,out] | me | current instance pointer (see oop) |
[in] | initial | the top-most initial transition for the MSM. |
|
private |
Implementation of the top-most initial tran. in QMsm.
Executes the top-most initial transition in a MSM.
[in,out] | me | current instance pointer (see oop) |
[in] | e | pointer to an extra parameter (might be NULL) |
[in] | qs_id | QS-id of this state machine (for QS local filter) |
qep_msm:200
Implementation of dispatching events to a QMsm
Dispatches an event for processing to a meta state machine (MSM). The processing of an event represents one run-to-completion (RTC) step.
[in,out] | me | current instance pointer (see oop) |
[in] | e | pointer to the event to be dispatched to the MSM |
[in] | qs_id | QS-id of this state machine (for QS local filter) |
qep_msm:300
QStateHandler QMsm_getStateHandler_ | ( | QHsm *const | me | ) |
|
private |
Execute transition-action table
Helper function to execute transition sequence in a transition-action table.
[in,out] | me | current instance pointer (see oop) |
[in] | tatbl | pointer to the transition-action table |
[in] | qs_id | QS-id of this state machine (for QS local filter) |
|
private |
Exit the current state up to the explicit transition source
Static helper function to exit the current state configuration to the transition source, which in a hierarchical state machine might be a superstate of the current state.
|
private |
Enter history of a composite state
Static helper function to execute the segment of transition to history after entering the composite state and
[in,out] | me | current instance pointer (see oop) |
[in] | hist | pointer to the history substate |
[in] | qs_id | QS-id of this state machine (for QS local filter) |