Alex exoskeleton
ALEX SoftwareDocumentation
Event.h
Go to the documentation of this file.
1 
11 #ifndef EXO_EVENT_H
12 #define EXO_EVENT_H
13 //#include <cstddef>
14 
15 #include "StateMachine.h"
16 
23 class Event {
24  public:
25  StateMachine *owner; /*<!Pointer to the owner state machine for this event*/
26  /* constructor */
27  Event(StateMachine *p, const char n[] = NULL) {
28  owner = p;
29  name = n;
30  };
37  virtual bool check(void) = 0;
38  const char *getName(void);
39 
40  private:
41  const char *name; /*<! Pointer to the name of this event*/
42 };
43 
44 #endif //EXO_EVENT_H
Abstract class representing a state machine. Includes a number of State and Transition objects...
Definition: StateMachine.h:26
virtual bool check(void)=0
Virtual check function Must be implemented for each event. The check function is called each event lo...
Event(StateMachine *p, const char n[]=NULL)
Definition: Event.h:27
const char * name
Definition: Event.h:41
const char * getName(void)
Definition: Event.cpp:8
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
StateMachine * owner
Definition: Event.h:25