#include "qf_pkg.h"
#include "qassert.h"
Go to the source code of this file.
Functions | |
| void | QActive_postFIFO (QActive *me, QEvent const *e) |
| Posts an event e directly to the event queue of the acitve object me using the First-In-First-Out (FIFO) policy. | |
Definition in file qa_fifo.c.
Posts an event e directly to the event queue of the acitve object me using the First-In-First-Out (FIFO) policy.
Direct event posting is the simplest asynchronous communication method available in QF. The following example illustrates how the Philosopher active object posts directly the HUNGRY event to the Table active object.
extern QActive *AO_Table; QState Philosopher_hungry(Philosopher *me, QEvent const *e) { TableEvt *pe; switch (e->sig) { case Q_ENTRY_SIG: { pe = Q_NEW(TableEvt, HUNGRY_SIG); /* dynamically allocate event */ pe->philNum = me->num; QActive_postFIFO(AO_Table, (QEvent *)pe); /* direct posting */ return Q_HANDLED(); } . . . } return Q_SUPER(&QHsm_top); }
Direct event posting should not be confused with direct event dispatching. In contrast to asynchronous event posting through event queues, direct event dispatching is synchronous. Direct event dispatching occurs when you call QHsm_dispatch(), or QFsm_dispatch() function.
Definition at line 43 of file qa_fifo.c.
References Q_ASSERT, QACTIVE_EQUEUE_SIGNAL_, QS_aoObj_, QS_BEGIN_NOLOCK_, QS_END_NOLOCK_, QS_EQC_, QS_OBJ_, QS_QF_ACTIVE_POST_FIFO, QS_SIG_, QS_TIME_, and QS_U8_.
Referenced by QF_publish(), and QF_tick().
1.5.4