QP::QState Mine1::used_x(Mine1 * const me) { // tell the Tunnel that this mine is becoming disabled MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG); mev->id = MINE_ID(me); AO_Tunnel->POST(mev, me); return QM_EXIT(&used_s); }
/* @(/2/4/3/2) .............................................................*/ static QState Mine2_used_x(Mine2 * const me) { /* tell the Tunnel that this mine is becoming disabled */ MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG); mev->id = MINE_ID(me); QACTIVE_POST(AO_Tunnel, (QEvt *)mev, me); return QM_EXIT(&Mine2_used_s); }
/*..........................................................................*/ QState Mine2_used(Mine2 *me, QEvt const *e) { switch (e->sig) { case Q_EXIT_SIG: { /* tell the Tunnel that this mine is becoming disabled */ MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG); mev->id = MINE_ID(me); QACTIVE_POST(AO_Tunnel, (QEvt *)mev, me); return Q_HANDLED(); } case MINE_RECYCLE_SIG: { return Q_TRAN(&Mine2_unused); } } return Q_SUPER(&QHsm_top); }
//............................................................................ QState Mine1::used(Mine1 *me, QEvent const *e) { switch (e->sig) { case Q_EXIT_SIG: { // tell the Tunnel that this mine is becoming disabled MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG); mev->id = MINE_ID(me); AO_Tunnel->postFIFO(mev); return Q_HANDLED(); } case MINE_RECYCLE_SIG: { return Q_TRAN(&Mine1::unused); } } return Q_SUPER(&QHsm::top); }