QP/C
Data Fields
QActive Struct Reference

Active Object structure. More...

#include <qf.h>

Data Fields

QF_ACTIVE_SUPER_ super
uint8_t prio
 QF priority associated with the active object.

Detailed Description

Active Object structure.

QActive is the base structure for derivation of active objects. Active objects in QF 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 PhilosopherTag {
    QActive super;                                  /* derives from QActive */
    uint8_t num;                              /* number of this philosopher */
    QTimeEvt timeEvt;                       /* to timeout thining or eating */
} Philosopher;
See also:
::QActiveTag for the description of the data members
Encapsulation and Single Inheritance in C

Definition at line 147 of file qf.h.


Field Documentation

uint8_t QActive::prio

QF priority associated with the active object.

See also:
QActive_start()

Definition at line 191 of file qf.h.

Referenced by QActive_start(), QF_add_(), and QF_remove_().

QF_ACTIVE_SUPER_ QActive::super

base structure of QActive.

See also:
::QF_ACTIVE_SUPER_
Encapsulation and Single Inheritance in C

Definition at line 151 of file qf.h.

Referenced by QActive_start(), QF_run(), QK_sched_(), and QK_schedExt_().


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