appkit  1.5.1
RoadNarrows Robotics Application Kit
StateEventASym2 Class Reference

(2,3) Turing Machine's state A, symbol 2 event. More...

Inheritance diagram for StateEventASym2:

Public Member Functions

 StateEventASym2 ()
 Constuctor.
 
virtual ~StateEventASym2 ()
 Destructor.
 
virtual bool evalGuardExpr (State *pState, int nPrevStateId, int nEventId)
 Evaluate event guard condition. More...
 
virtual int execAction (State *pState, int nPrevStateId, int nEventId)
 Execute event action. More...
 

Detailed Description

(2,3) Turing Machine's state A, symbol 2 event.

Definition at line 510 of file ut-sm.cxx.

Member Function Documentation

virtual bool StateEventASym2::evalGuardExpr ( State *  pState,
int  nPrevStateId,
int  nEventId 
)
inlinevirtual

Evaluate event guard condition.

Parameters
pStateAssociated state.
nPrevStateIdPrevious state id.
nEventIdReceived event id.
Returns
Returns true if event is accepted, otherwise returns false.

Definition at line 528 of file ut-sm.cxx.

529  {
530  return ((State2_3Turing*)pState)->Head > 0? true: false;
531  }
The (2,3) Turing state base class.
Definition: ut-sm.cxx:239
virtual int StateEventASym2::execAction ( State *  pState,
int  nPrevStateId,
int  nEventId 
)
inlinevirtual

Execute event action.

Print symbol 1, move left, stay in state A.

Parameters
pStateState owning this event.
nPrevStateIdPrevious state id.
nEventIdEvent id.
Returns
Next state id.

Definition at line 544 of file ut-sm.cxx.

References EventIdSymbol, and StateIdA.

545  {
546  ((State2_3Turing*)pState)->writeSymbol(EventIdSymbol[1]);
547  ((State2_3Turing*)pState)->moveHeadLeft();
548  ((State2_3Turing*)pState)->showTape();
549  return StateIdA;
550  }
static const int StateIdA
state A
Definition: ut-sm.cxx:81
The (2,3) Turing state base class.
Definition: ut-sm.cxx:239
static const int EventIdSymbol[]
tape symbol event ids
Definition: ut-sm.cxx:88

The documentation for this class was generated from the following file: