CORC Project
CANOpen Robot Controller Software Documentation
Transition.h
Go to the documentation of this file.
1 
11 #ifndef TRANSITION_H
12 #define TRANSITION_H
13 
14 #include "Event.h"
15 #include "State.h"
16 #include "StateMachine.h"
17 
18 /* Forward declarations*/
19 class State;
20 class Event;
21 
27 class Transition {
28  friend class State;
29  friend class StateMachine;
30 
31  public:
32  /* Constructor: set state this arc targets (points towards) and the event which triggers it */
33  Transition(State* targ, Event* e) {
34  target = targ;
35  ev = e;
36  };
37  State* getTarget(void);
38 
39  private:
40  Event* ev; /*<! pointer to tranisitions event object - triggering a tranistion to the target state*/
41  State* target; /*<! target State of the transition*/
42 };
43 #endif //EXO_TRANSITION_H
State * getTarget(void)
Definition: Transition.cpp:8
State * target
Definition: Transition.h:41
Abstract class representing a state machine. Includes a number of State and Transition objects...
Definition: StateMachine.h:25
Abstract class representing a state in a StateMachine.
Definition: State.h:28
Transition(State *targ, Event *e)
Definition: Transition.h:33
Represents possible transitions linking two State objects with an Event.
Definition: Transition.h:27
Event * ev
Definition: Transition.h:40
Abstract class for events used as StateMachine triggers to transition between states. Events must be explicitly tied to a current State and state to transition to once the event has been triggered. This is done using a Transition object in a designed StateMachine.
Definition: Event.h:24