Alex exoskeleton
ALEX SoftwareDocumentation
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 
26 class Transition {
27  friend class State;
28  friend class StateMachine;
29 
30  public:
31  /* Constructor: set state this arc targets (points towards) and the event which triggers it */
32  Transition(State* targ, Event* e) {
33  target = targ;
34  ev = e;
35  };
36  State* getTarget(void);
37 
38  private:
39  Event* ev; /*<! pointer to tranisitions event object - triggering a tranistion to the target state*/
40  State* target; /*<! target State of the transition*/
41 };
42 #endif //EXO_TRANSITION_H
State * getTarget(void)
Definition: Transition.cpp:8
State * target
Definition: Transition.h:40
Abstract class representing a state machine. Includes a number of State and Transition objects...
Definition: StateMachine.h:26
Abstract class representing a state in a StateMachine.
Definition: State.h:30
Transition(State *targ, Event *e)
Definition: Transition.h:32
Represents possible transitions linking two State objects with an Event.
Definition: Transition.h:26
Event * ev
Definition: Transition.h:39
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:23