QP/C
Data Fields
QFsm Struct Reference

Finite State Machine. More...

#include <qep.h>

Data Fields

QStateHandler state

Detailed Description

Finite State Machine.

QFsm represents a traditional non-hierarchical Finite State Machine (FSM) without state hierarchy, but with entry/exit actions.

Note:
QFsm is not intended to be instantiated directly, but rather serves as the base structure for derivation of state machines in the application code.

The following example illustrates how to derive a state machine structure from QFsm. Please note that the QFsm member super is defined as the FIRST member of the derived struct.

typedef struct QBombTag {
    QFsm super;                                        /* derives from QFsm */
    uint8_t timeout;                    /* number of seconds till explosion */
    uint8_t defuse;                               /* the secret defuse code */
    uint8_t code;                          /* the current defuse code entry */
} QBomb;
See also:
Encapsulation and Single Inheritance in C

Definition at line 84 of file qep.h.


Field Documentation

current active state (state-variable)

Definition at line 85 of file qep.h.

Referenced by QFsm_dispatch().


The documentation for this struct was generated from the following file: