QP/C++  5.9.8
QMActive Class Reference

QMActive active object (based on QP::QMsm implementation) More...

#include <qf.h>

Inheritance diagram for QMActive:
QActive QHsm

Public Member Functions

virtual void init (QEvt const *const e)
 
virtual void init (void)
 Executes the top-most initial transition in QP::QHsm.
 
virtual void dispatch (QEvt const *const e)
 Dispatches an event to QHsm. More...
 
bool isInState (QMState const *const st) const
 Tests if a given state is part of the active state configuration.
 
QMState const * stateObj (void) const
 Return the current active state object (read only)
 
QMState const * childStateObj (QMState const *const parent) const
 Obtain the current active child state of a given parent (read only)
 
- Public Member Functions inherited from QActive
virtual void start (uint_fast8_t const prio, QEvt const *qSto[], uint_fast16_t const qLen, void *const stkSto, uint_fast16_t const stkSize, QEvt const *const ie)
 Starts execution of an active object and registers the object with the framework. More...
 
virtual void start (uint_fast8_t const prio, QEvt const *qSto[], uint_fast16_t const qLen, void *const stkSto, uint_fast16_t const stkSize)
 Overloaded start function (no initialization event)
 
virtual bool post_ (QEvt const *const e, uint_fast16_t const margin, void const *const sender)
 
virtual void postLIFO (QEvt const *const e)
 Posts an event directly to the event queue of the active object using the Last-In-First-Out (LIFO) policy. More...
 
void unsubscribeAll (void) const
 Un-subscribes from the delivery of all signals to the active object. More...
 
void stop (void)
 Stops execution of an active object and removes it from the framework's supervision. More...
 
void subscribe (enum_t const sig) const
 Subscribes for delivery of signal sig to the active object. More...
 
void unsubscribe (enum_t const sig) const
 Un-subscribes from the delivery of signal sig to the active object. More...
 
bool defer (QEQueue *const eq, QEvt const *const e) const
 Defer an event to a given separate event queue. More...
 
bool recall (QEQueue *const eq)
 Recall a deferred event from a given event queue. More...
 
uint_fast16_t flushDeferred (QEQueue *const eq) const
 Flush the specified deferred queue 'eq'. More...
 
uint_fast8_t getPrio (void) const
 Get the priority of the active object.
 
void setPrio (uint_fast8_t const prio)
 Set the priority of the active object.
 
QEvt const * get_ (void)
 Get an event from the event queue of an active object. More...
 
- Public Member Functions inherited from QHsm
virtual ~QHsm ()
 virtual destructor More...
 
bool isIn (QStateHandler const s)
 Tests if a given state is part of the current active state configuration. More...
 
QStateHandler state (void) const
 Obtain the current state (state handler function) More...
 
QStateHandler childState (QStateHandler const parent)
 Obtain the current active child state of a given parent. More...
 
QState tran_ (QStateHandler const target)
 internal helper function to record a state transition
 
QState tran_hist_ (QStateHandler const hist)
 internal helper function to record a transition to history
 
QState super_ (QStateHandler const superstate)
 internal helper function to record the superstate
 
QState qm_tran_ (QMTranActTable const *const tatbl)
 internal helper function to record a regular state transition
 
QState qm_tran_hist_ (QMState const *const hist, QMTranActTable const *const tatbl)
 Internal helper function to record a regular state transition.
 
QState qm_tran_init_ (QMTranActTable const *const tatbl)
 Internal helper function to record an initial state transition.
 
QState qm_tran_ep_ (QMTranActTable const *const tatbl)
 Internal helper function to record an transition to an entry point to a submachine state.
 
QState qm_tran_xp_ (QActionHandler const xp, QMTranActTable const *const tatbl)
 Internal helper function to record an transition to an exit point from a submachine state.
 
QState qm_entry_ (QMState const *const s)
 Internal helper function to record a state entry.
 
QState qm_exit_ (QMState const *const s)
 Internal helper function to record a state exit.
 
QState qm_super_sub_ (QMState const *const s)
 Internal helper function to call in a QM action-handler when it passes the event to the host submachine state to handle an event.
 

Protected Member Functions

 QMActive (QStateHandler const initial)
 protected constructor (abstract class)
 
- Protected Member Functions inherited from QActive
 QActive (QStateHandler const initial)
 protected constructor (abstract class)
 
- Protected Member Functions inherited from QHsm
 QHsm (QStateHandler const initial)
 Protected constructor of QHsm. More...
 

Additional Inherited Members

- Public Types inherited from QHsm
enum  ReservedHsmSignals { Q_ENTRY_SIG = 1, Q_EXIT_SIG, Q_INIT_SIG }
 
- Static Public Member Functions inherited from QHsm
static QState top (void *const me, QEvt const *const e)
 the top-state. More...
 
static QState Q_HANDLED (void)
 internal helper function to specify the return of a state-handler when it handles the event.
 
static QState Q_UNHANDLED (void)
 internal helper function to specify the return of a state-handler function when it attempts to handle the event but a guard condition evaluates to false and there is no other explicit way of handling the event.
 
static QState QM_HANDLED (void)
 Internal helper function to call in a QM action-handler when it handles an event.
 
static QState QM_UNHANDLED (void)
 Macro to call in a QM action-handler when it does not handle an event due to a guard condition evaluating to false.
 
static QState QM_SUPER (void)
 Internal helper function to call in a QM action-handler when it passes the event to the superstate for processing.
 
- Public Attributes inherited from QActive
uint_fast8_t m_prio
 QF priority (1..QF_MAX_ACTIVE) of this active object.
 

Detailed Description

QMActive active object (based on QP::QMsm implementation)

Description
QP::QMActive represents an active object that uses the QP::QMsm-style state machine implementation strategy. This strategy requires the use of the QM modeling tool to generate state machine code automatically, but the code is faster than in the QP::QHsm-style implementation strategy and needs less run-time support (smaller event-processor).
Note
QP::QMActive is not intended to be instantiated directly, but rather serves as the base class for derivation of active objects in the applications.
See also
QP::QActive
Usage
The following example illustrates how to derive an active object from QP::QMActive.

Definition at line 301 of file qf.h.

Member Function Documentation

◆ init()

void init ( QEvt const *const  e)
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Description
Executes the top-most initial transition in a HSM.
Parameters
[in]epointer to the initialization event (might be NULL)
Note
Must be called exactly once before the QP::QHsm::dispatch().
Precondition
ctor must have been executed and initial tran NOT taken

Reimplemented from QHsm.

Definition at line 66 of file qf_qmact.cpp.

◆ dispatch()

void dispatch ( QEvt const *const  e)
virtual

Dispatches an event to QHsm.

Description
Dispatches an event for processing to a hierarchical state machine (HSM). The processing of an event represents one run-to-completion (RTC) step.
Parameters
[in]epointer to the event to be dispatched to the HSM
Note
This state machine must be initialized by calling QP::QHsm::init() exactly once before calling QP::QHsm::dispatch().
Precondition
the current state must be initialized and the state configuration must be stable

Reimplemented from QHsm.

Definition at line 74 of file qf_qmact.cpp.


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