Example #1
0
        //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));
        }
Example #2
0
        //Method members
        //Public

        public void dispatch(QEvent e)
        {
            source = state;
            while (source != handled)
            {
                source = (QState)source(e);
            }
        }
Example #3
0
        //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);
        }
Example #4
0
        //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);
        }
Example #5
0
        //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);
            }
        }
Example #6
0
 //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.");
 }