QFsm Struct Reference

Finite State Machine. More...

#include <qepn.h>


Data Fields

QStateHandler state
QEvent evt


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 184 of file qepn.h.


Field Documentation

QStateHandler QFsm::state

current active state (private)

Definition at line 185 of file qepn.h.

Referenced by QFsm_dispatch(), and QFsm_init().

QEvent QFsm::evt

currently processed event in the FSM (protected)

Definition at line 186 of file qepn.h.


The documentation for this struct was generated from the following file:
Generated on Sat Dec 27 22:01:48 2008 for QP-nano by  doxygen 1.5.4