//Obtain the current state's super state protected QState superstate(QState s) { QEvent e = new QEvent(); e.sig = (int)HSMSignals.SUPER_SIG; return(s(e)); }
//Method members //Public public void dispatch(QEvent e) { source = state; while (source != handled) { source = (QState)source(e); } }
//Exceute entry transition event protected QState enter_state(QState s) { QEvent e = new QEvent(); e.sig = (int)HSMSignals.ENTRY_SIG; s(e); return(state = s); }
//Execute exit transition event protected QState exit_my_state() { QEvent e = new QEvent(); e.sig = (int)HSMSignals.EXIT_SIG; state(e); state = (QState)superstate(state); return(state); }
//Execute initial transition event protected void init_my_state() { QState s = state; QEvent e = new QEvent(); e.sig = (int)HSMSignals.INIT_SIG; while (s(e) == handled && s != state) { s = (QState)enter_state(state); } }
//This is a placeholder for a handled state. This method should //never execute and will throw an exception if executed. protected QState handled(QEvent e) { throw new Exception( "ERROR: Handled state placeholder was excuted. This should never " + "execute as it will generate errornous results."); }