|
QP/C
|
QHsm_init() implementation. More...
Go to the source code of this file.
Functions | |
| void | QHsm_init (QHsm *me, QEvent const *e) |
| Performs the second step of HSM initialization by triggering the top-most initial transition. | |
QHsm_init() implementation.
Definition in file qhsm_ini.c.
Performs the second step of HSM initialization by triggering the top-most initial transition.
| me | pointer the state machine structure derived from QHsm |
| e | constant pointer the QEvent or a structure derived from QEvent |
The following example illustrates how to initialize a HSM, and dispatch events to it:
#include "qep.h" /* QEP/C public interface */ #include "qcalc.h" /* QCalc HSM derived from QHsm */ static QCalc l_qcalc; /* an instance of QCalc HSM */ int main() { QCalc_ctor(&l_qcalc); /* QCalc HSM "constructor" invokes QHsm_ctor_() */ QHsm_init((QHsm *)&l_qcalc, (QEvent *)0); /* trigger initial transition */ for (;;) { /* event loop */ QEvent e; . . . /* wait for the next event and assign it to the event object e */ . . . QHsm_dispatch((QHsm *)&l_qcalc, (QEvent *)&e); /* dispatch e */ } return 0; }
Definition at line 40 of file qhsm_ini.c.
References Q_ALLEGE, Q_ASSERT, Q_INIT_SIG, Q_RET_TRAN, QEP_EMPTY_SIG_, QEP_ENTER_, QEP_MAX_NEST_DEPTH_, QEP_TRIG_, QHsm_top(), QS_BEGIN_, QS_CRIT_STAT_, QS_END_, QS_FUN_, QS_OBJ_, QS_QEP_INIT_TRAN, QS_QEP_STATE_INIT, QS_smObj_, and QS_TIME_.
1.7.6.1