Hierarchical State Machine class (QHsm-style state machine implementation strategy)
More...
Hierarchical State Machine class (QHsm-style state machine implementation strategy)
- Details
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.
- Note
- QHsm is not intended to be instantiated directly, but rather serves as the abstract base class for derivation of state machines in the QP Application.
- Backward Traceability
- SRS_QP_SM_00: QP Framework shall provide support for hierarchical state machines both for Active Objects and for passive event-driven objects in the Application
- SRS_QP_SM_10: QP Framework shall support multiple and interchangeable State Machine Implementation Strategies
- SDS_QP_QEP: QEP Event Processor
- SDS_QP_QHsm: QHsm State machine class.
- Usage
The following example illustrates how to derive a state machine class from QHsm. Please note that the QHsm member super
is defined as the FIRST member of the derived class.
typedef struct {
double operand1;
double operand2;
char display[DISP_WIDTH + 1];
uint8_t len;
uint8_t opKey;
} Calc;
void Calc_ctor(void) {
. . .
}
#define Q_STATE_CAST(handler_)
Perform cast to QStateHandler.
Hierarchical State Machine class (QHsm-style state machine implementation strategy)
void QHsm_ctor(QHsm *const me, QStateHandler const initial)
Definition at line 254 of file qp.h.