QP-nano
Data Fields
QActive Struct Reference

Active Object struct. More...

#include <qfn.h>

Data Fields

QHsm super
QTimeEvtCtr tickCtr
 Time Event tick counter for the active object.
uint8_t prio
 priority of the active object (1..QF_MAX_ACTIVE)
uint8_t head
 offset to where next event will be inserted into the buffer
uint8_t tail
 offset of where next event will be extracted from the buffer
uint8_t nUsed
 number of events currently present in the queue (events in the ring buffer + 1 event in the state machine)

Detailed Description

Active Object struct.

QActive is the base structure for derivation of active objects. Active objects in QF-nano are encapsulated tasks (each embedding a state machine and an event queue) that communicate with one another asynchronously by sending and receiving events. Within an active object, events are processed sequentially in a run-to-completion (RTC) fashion, while QF encapsulates all the details of thread-safe event exchange and queuing.

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

The following example illustrates how to derive an active object from QActive. Please note that the QActive member super_ is defined as the FIRST member of the derived struct.

typedef struct PelicanTag {
    QActive super;                                  /* derived from QActive */
    uint8_t pedFlashCtr;                        /* pedestrian flash counter */
} Pelican;

void Pelican_ctor(Pelican *me, uint8_t timeout);                /* the ctor */
See also:
::QActiveTag for the description of the data members
Encapsulation and Single Inheritance in C

Definition at line 149 of file qfn.h.


Field Documentation

derives from the QHsm base structure

Definition at line 152 of file qfn.h.

Referenced by QK_sched_().


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