Khangai Robot Play - Naive  01
THe naive play of the Khangai Robot
state.h
Go to the documentation of this file.
1 #ifndef _STATE_H_
2 #define _STATE_H_
3 
4 void null_func(void);
5 
6 class State
7 {
8 public:
9  State(int id, void (*func)(void) = null_func) {
10  id_ = id;
11  func_ = func;
12  }
13  State() = default;
14  State(State &&) = default;
15  State(const State &) = default;
16  State &operator=(State &&) = default;
17  State &operator=(const State &) = default;
18  ~State() { }
19 
20  int get_ID() const { return id_; }
21  void call_StateFunc() const { func_(); }
22 
23 private:
24  int id_;
25  void (*func_)(void);
26 };
27 
28 #endif // !_STATE_H_
Definition: state.h:6
void call_StateFunc() const
Definition: state.h:21
int id_
Definition: state.h:24
State(int id, void(*func)(void)=null_func)
Definition: state.h:9
int get_ID() const
Definition: state.h:20
~State()
Definition: state.h:18
State & operator=(State &&)=default
State()=default
void null_func(void)
Definition: state.cpp:3
void(* func_)(void)
Definition: state.h:25