#include <qep.h>
Public Member Functions | |
QStateHandler | QHsm_childState (QHsm *const me, QStateHandler const parent) |
bool | QHsm_isIn (QHsm *const me, QStateHandler const state) |
Static Public Member Functions | |
static QStateHandler | QHsm_state (QHsm *const me) |
Protected Member Functions | |
void | QHsm_ctor (QHsm *const me, QStateHandler initial) |
QState | QHsm_top (void const *const me, QEvt const *const e) |
Private Member Functions | |
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) |
QStateHandler | QHsm_getStateHandler_ (QHsm *const me) |
Static Private Member Functions | |
static int_fast8_t | QHsm_tran_ (QHsm *const me, QStateHandler path[QHSM_MAX_NEST_DEPTH_], uint_fast8_t const qs_id) |
Private Attributes | |
struct QHsmVtable const * | vptr |
union QHsmAttr | state |
union QHsmAttr | temp |
Hierarchical State Machine class
QHsm represents a Hierarchical State Machine (HSM) with full support for hierarchical nesting of states, entry/exit actions, initial transitions, and transitions to history in any composite state. This class is designed for ease of manual coding of HSMs in C, but it is also supported by the QM modeling tool.
QHsm is also the base class for the QMsm state machine, which provides a superior efficiency, but requires the use of the QM modeling tool to generate code.
traces to: RQP103
traces to: AQP211
|
private |
Implementation of the top-most initial tran. in QHsm subclass.
Executes the top-most initial transition in a HSM.
[in,out] | me | 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) |
traces to: RQP103
traces to: RQP120I
traces to: RQP120D
Implementation of dispatching events to a QHsm subclass
Dispatches an event for processing to a hierarchical state machine (HSM). The processing of an event represents one run-to-completion (RTC) step.
[in,out] | me | pointer (see oop) |
[in] | e | pointer to the event to be dispatched to the HSM |
[in] | qs_id | QS-id of this state machine (for QS local filter) |
traces to: RQP103
traces to: RQP120A
traces to: RQP120B
traces to: RQP120C
traces to: RQP120D
traces to: RQP120E
|
private |
|
inlinestatic |
QStateHandler QHsm_childState | ( | QHsm *const | me, |
QStateHandler const | parent | ||
) |
Obtain the current active child state of a given parent in QHsm
[in] | me | pointer (see oop) |
[in] | parent | pointer to the parent state-handler |
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 QHsm.
[in] | me | pointer (see oop) |
[in] | parent | pointer to the state-handler function |
parent
state, which is an ancestor of the current active state. For the corner case when the currently active state is the given parent
state, function returns the parent
state.traces to: RQP103
traces to: RQP120H
bool QHsm_isIn | ( | QHsm *const | me, |
QStateHandler const | state | ||
) |
Tests if a given state is part of the current active state configuration in QHsm subclasses.
Tests if a state machine derived from QHsm is-in a given state.
[in] | me | pointer (see oop) |
[in] | state | pointer to the state-handler function to be tested |
state
and 'false' otherwisetraces to: RQP103
traces to: RQP120S
|
protected |
Protected "constructor" of QHsm
Performs the first step of HSM initialization by assigning the initial pseudostate to the currently active state of the state machine.
[in,out] | me | pointer (see oop) |
[in] | initial | pointer to the top-most initial state-handler function in the derived state machine |
the top-state.
QHsm_top() is the ultimate root of state hierarchy in all HSMs derived from QHsm.
[in] | me | pointer (see oop) |
[in] | e | pointer to the event to be dispatched to the FSM |
traces to: RQP103
traces to: RQP120T
|
staticprivate |
Static helper function to execute transition sequence in a hierarchical state machine (HSM).
[in,out] | me | pointer (see oop) |
[in,out] | path | array of pointers to state-handler functions to execute the entry actions |
[in] | qs_id | QS-id of this state machine (for QS local filter) |
path
parameter.traces to: RQP103
traces to: RQP120E
traces to: RQP120F
|
private |