CORC Project
CANOpen Robot Controller Software Documentation
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 
24 class Event {
25  public:
26  StateMachine *owner; /*<!Pointer to the owner state machine for this event*/
27  /* constructor */
28  Event(StateMachine *p, const char n[] = NULL) {
29  owner = p;
30  name = n;
31  };
38  virtual bool check(void) = 0;
39  const char *getName(void);
40 
41  private:
42  const char *name; /*<! Pointer to the name of this event*/
43 };
44 
45 #endif //EXO_EVENT_H
Abstract class representing a state machine. Includes a number of State and Transition objects...
Definition: StateMachine.h:25
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:28
const char * name
Definition: Event.h:42
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:24
StateMachine * owner
Definition: Event.h:26