QP/C++
Classes | Defines | Typedefs | Enumerations
qep.h File Reference

QEP/C++ platform-independent public interface. More...

#include "qevent.h"
#include "qs_port.h"

Go to the source code of this file.

Classes

class  QEP
 Provides miscellaneous QEP services. More...
class  QFsm
 Finite State Machine base class. More...
class  QHsm
 Hierarchical State Machine base class. More...

Defines

#define Q_RET_IGNORED   ((QState)1)
 Value returned by a non-hierarchical state-handler function when it ignores (does not handle) the event.
#define Q_IGNORED()   (Q_RET_IGNORED)
 The macro returned from a non-hierarchical state-handler function when it ignores (does not handle) the event.
#define Q_RET_HANDLED   ((QState)0)
 Value returned by a state-handler function when it handles the event.
#define Q_HANDLED()   (Q_RET_HANDLED)
 Value returned by a state-handler function when it handles the event.
#define Q_RET_TRAN   ((QState)2)
 Value returned by a state-handler function when it takes a regular state transition.
#define Q_TRAN(target_)   (me->m_state = (QStateHandler)(target_), Q_RET_TRAN)
 Designates a target for an initial or regular transition. Q_TRAN() can be used both in the FSMs and HSMs.
#define Q_RET_SUPER   ((QState)3)
 Value returned by a state-handler function when it cannot handle the event.
#define Q_SUPER(super_)   (me->m_state = (QStateHandler)(super_), Q_RET_SUPER)
 Designates the superstate of a given state in an HSM.

Typedefs

typedef uint8_t QState
 Type returned from a state-handler function.
typedef QState(* QStateHandler )(void *me, QEvent const *e)
 pointer to state-handler function

Enumerations

enum  QReservedSignals { Q_ENTRY_SIG = 1, Q_EXIT_SIG, Q_INIT_SIG, Q_USER_SIG }
 QEP reserved signals. More...

Detailed Description

QEP/C++ platform-independent public interface.

This header file must be included directly or indirectly in all modules (*.cpp files) that use QEP/C++.

Definition in file qep.h.


Define Documentation

#define Q_HANDLED ( )    (Q_RET_HANDLED)

Value returned by a state-handler function when it handles the event.

You call that macro after the return statement (return Q_HANDLED();) Q_HANDLED() can be used both in the FSMs and HSMs.

Definition at line 228 of file qep.h.

#define Q_IGNORED ( )    (Q_RET_IGNORED)

The macro returned from a non-hierarchical state-handler function when it ignores (does not handle) the event.

You call that macro after the return statement (return Q_IGNORED();)

Definition at line 215 of file qep.h.

Referenced by QHsm::top().

#define Q_SUPER (   super_)    (me->m_state = (QStateHandler)(super_), Q_RET_SUPER)

Designates the superstate of a given state in an HSM.

Definition at line 250 of file qep.h.

#define Q_TRAN (   target_)    (me->m_state = (QStateHandler)(target_), Q_RET_TRAN)

Designates a target for an initial or regular transition. Q_TRAN() can be used both in the FSMs and HSMs.

Definition at line 239 of file qep.h.


Enumeration Type Documentation

QEP reserved signals.

Enumerator:
Q_ENTRY_SIG 

signal for entry actions

Q_EXIT_SIG 

signal for exit actions

Q_INIT_SIG 

signal for nested initial transitions

Q_USER_SIG 

signal to offset user signals

Definition at line 256 of file qep.h.