|
QP/C
|
Time Event structure. More...
#include <qf.h>
Data Fields | |
| QEvt | super |
| struct QTimeEvtTag * | next |
| QActive * | act |
| QTimeEvtCtr | ctr |
| QTimeEvtCtr | interval |
Time Event structure.
Time events are special QF events equipped with the notion of time passage. The basic usage model of the time events is as follows. An active object allocates one or more QTimeEvt objects (provides the storage for them). When the active object needs to arrange for a timeout, it arms one of its time events to fire either just once (one-shot) or periodically. Each time event times out independently from the others, so a QF application can make multiple parallel timeout requests (from the same or different active objects). When QF detects that the appropriate moment has arrived, it inserts the time event directly into the recipient's event queue. The recipient then processes the time event just like any other event.
Time events, as any other QF events derive from the QEvt base structure. Typically, you will use a time event as-is, but you can also further derive more specialized time events from it by adding some more data members and/or specialized functions that operate on the specialized time events.
Internally, the armed time events are organized into a bi-directional linked list. This linked list is scanned in every invocation of the QF_tick() function. Only armed (timing out) time events are in the list, so only armed time events consume CPU cycles.
the active object that receives the time events.
Definition at line 507 of file qf.h.
Referenced by QF_tick(), QTimeEvt_ctr(), and QTimeEvt_disarm().
| QTimeEvtCtr QTimeEvt::ctr |
the internal down-counter of the time event. The down-counter is decremented by 1 in every QF_tick() invocation. The time event fires (gets posted or published) when the down-counter reaches zero.
Definition at line 513 of file qf.h.
Referenced by QF_tick(), QTimeEvt_ctr(), and QTimeEvt_disarm().
| QTimeEvtCtr QTimeEvt::interval |
the interval for the periodic time event (zero for the one-shot time event). The value of the interval is re-loaded to the internal down-counter when the time event expires, so that the time event keeps timing out periodically.
Definition at line 520 of file qf.h.
Referenced by QF_tick(), QTimeEvt_ctr(), and QTimeEvt_disarm().
| struct QTimeEvtTag* QTimeEvt::next |
1.7.6.1