Пример #1
0
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
0
/* @(/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);
}
Пример #3
0
/*..........................................................................*/
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);
}
Пример #4
0
//............................................................................
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);
}