|
QP/C
|
QTimeEvt_ctor() implementation. More...
Go to the source code of this file.
Functions | |
| void | QTimeEvt_ctor (QTimeEvt *me, QSignal sig) |
| The "constructor" to initialize a Time Event. | |
QTimeEvt_ctor() implementation.
Definition in file qte_ctor.c.
| void QTimeEvt_ctor | ( | QTimeEvt * | me, |
| QSignal | sig | ||
| ) |
The "constructor" to initialize a Time Event.
You should call this function exactly once for every Time Event object BEFORE arming the Time Event. The most important action performed in this function is assigning a signal to the Time Event. You can reuse the Time Event any number of times, but you should not change the signal. This is because pointers to Time Events might still be held in event queues and changing signal could to hard-to-detect errors.
The following example shows the invocation of QTimeEvt_ctor() from the "constructor" of the Philosopher active object that owns the time event
void Philosopher_ctor(Philosopher *me) { QActive_ctor(&me->super, (QStateHandler)&Philosopher_initial); QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG); }
Definition at line 40 of file qte_ctor.c.
References Q_REQUIRE, Q_USER_SIG, and QF_EVT_POOL_ID_.
1.7.6.1