QP/C  7.3.0
Real-Time Embedded Framework
Loading...
Searching...
No Matches
QMsm Class Reference

Hierarchical State Machine class (QMsm-style state machine implementation strategy) More...

#include "qp.h"

Inheritance diagram for QMsm:
QAsm

Public Member Functions

bool QMsm_isInState (QMsm const *const me, QMState const *const stateObj)
 
QMState const * QMsm_childStateObj (QMsm const *const me, QMState const *const parent)
 

Static Public Member Functions

static QStateHandler QMsm_getStateHandler_ (QAsm *const me)
 
static QMState const * QMsm_stateObj (QMsm *const me)
 

Public Attributes

QAsm super
 

Protected Member Functions

void QMsm_ctor (QMsm *const me, QStateHandler const initial)
 
- Protected Member Functions inherited from QAsm
void QAsm_ctor (QAsm *const me)
 
QState QHsm_top (QHsm const *const me, QEvt const *const e)
 

Private Member Functions

void QMsm_init_ (QAsm *const me, void const *const e, uint_fast8_t const qs_id)
 
void QMsm_dispatch_ (QAsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
 
QState QMsm_execTatbl_ (QAsm *const me, QMTranActTable const *const tatbl, uint_fast8_t const qs_id)
 
void QMsm_exitToTranSource_ (QAsm *const me, QMState const *const cs, QMState const *const ts, uint_fast8_t const qs_id)
 
QState QMsm_enterHistory_ (QAsm *const me, QMState const *const hist, uint_fast8_t const qs_id)
 

Additional Inherited Members

- Protected Attributes inherited from QAsm
struct QAsmVtable const * vptr
 
union QAsmAttr state
 
union QAsmAttr temp
 

Detailed Description

Hierarchical State Machine class (QMsm-style state machine implementation strategy)

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).

Note
QMsm is not intended to be instantiated directly, but rather serves as the abstract base class for derivation of state machines in the application code.
Traceability
Usage
The following example illustrates how to derive a state machine class from QMsm. Please note that the QMsm member super is defined as the first member of the derived struct.
typedef struct {
QMsm super; // <=== inherit QMsm
double operand1;
double operand2;
char display[DISP_WIDTH + 1];
uint8_t len;
uint8_t opKey;
} Calc;
Hierarchical State Machine class (QMsm-style state machine implementation strategy)
Definition qp.h:373
QAsm super
Definition qp.h:375

Definition at line 373 of file qp.h.

Member Function Documentation

◆ QMsm_ctor()

void QMsm_ctor ( QMsm *const  me,
QStateHandler const  initial 
)
protected

Definition at line 89 of file qep_msm.c.

◆ QMsm_init_()

void QMsm_init_ ( QAsm *const  me,
void const *const  e,
uint_fast8_t const  qs_id 
)
private

Definition at line 107 of file qep_msm.c.

◆ QMsm_dispatch_()

void QMsm_dispatch_ ( QAsm *const  me,
QEvt const *const  e,
uint_fast8_t const  qs_id 
)
private

Definition at line 166 of file qep_msm.c.

◆ QMsm_getStateHandler_()

static QStateHandler QMsm_getStateHandler_ ( QAsm *const  me)
inlinestatic

Definition at line 404 of file qp.h.

◆ QMsm_isInState()

bool QMsm_isInState ( QMsm const *const  me,
QMState const *const  stateObj 
)

Definition at line 364 of file qep_msm.c.

◆ QMsm_stateObj()

static QMState const * QMsm_stateObj ( QMsm *const  me)
inlinestatic

Definition at line 414 of file qp.h.

◆ QMsm_childStateObj()

QMState const * QMsm_childStateObj ( QMsm const *const  me,
QMState const *const  parent 
)

Definition at line 383 of file qep_msm.c.

◆ QMsm_execTatbl_()

QState QMsm_execTatbl_ ( QAsm *const  me,
QMTranActTable const *const  tatbl,
uint_fast8_t const  qs_id 
)
private

Definition at line 421 of file qep_msm.c.

◆ QMsm_exitToTranSource_()

void QMsm_exitToTranSource_ ( QAsm *const  me,
QMState const *const  cs,
QMState const *const  ts,
uint_fast8_t const  qs_id 
)
private

Definition at line 495 of file qep_msm.c.

◆ QMsm_enterHistory_()

QState QMsm_enterHistory_ ( QAsm *const  me,
QMState const *const  hist,
uint_fast8_t const  qs_id 
)
private

Definition at line 538 of file qep_msm.c.

Member Data Documentation

◆ super

QAsm QMsm::super

Definition at line 375 of file qp.h.


The documentation for this class was generated from the following files: