Alex exoskeleton
ALEX SoftwareDocumentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
State.cpp
Go to the documentation of this file.
1 
2 //
3 // Created by William Campbell on 2019-09-24.
4 //
5 
6 #include "State.h"
7 
9  int i = 0;
10  while (i < numarcs) {
11  if (arclist[i]->ev->check())
12  return arclist[i];
13  i++;
14  }
15  return NULL;
16 }
17 
19  if (numarcs < MAXARCS) {
20  arclist[numarcs++] = t;
21  return true;
22  } else
23  return false;
24 };
25 
26 const char *State::getName(void) {
27  return name;
28 };
29 
30 void State::printName(void) {
31  std::cout << name << std::endl;
32 };
33 
35  std::cout << "State Deleted" << std::endl;
36 }
Transition * arclist[MAXARCS]
List of possible transitions.
Definition: State.h:92
int numarcs
Definition: State.h:94
void printName(void)
Prints the name of the state.
Definition: State.cpp:30
const char * name
Definition: State.h:93
const char * getName(void)
Returns the name of the state - Note that this.
Definition: State.cpp:26
bool addArc(Transition *t)
Definition: State.cpp:18
Transition * getActiveArc(void)
Definition: State.cpp:8
Represents possible transitions linking two State objects with an Event.
Definition: Transition.h:26
~State()
Definition: State.cpp:34
#define MAXARCS
Definition: State.h:22