OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/tondenhei/et2013
[tondenhei/et2013.git] / context.h
1 #ifndef CONTEXT_H\r
2 #define CONTEXT_H\r
3 \r
4 #include "systemstate.h"\r
5 #include "exceptionstate.h"\r
6 #include "runstate.h"\r
7 \r
8 class ETLineTracer;\r
9 namespace ContextStuff{\r
10         class Context\r
11         {\r
12                 int current_state;\r
13                 SystemStateStuff::ExceptionState exception_state;\r
14                 SystemStateStuff::RunState run_state;\r
15                 SystemStateStuff::SystemState* state_array[2];\r
16         public:\r
17                 enum{EXCEPTION_STATE,RUN_STATE};\r
18                 Context():current_state(RUN_STATE),exception_state(),run_state()\r
19                         {state_array[EXCEPTION_STATE] = &exception_state;state_array[RUN_STATE] = &run_state;}\r
20                 ~Context(){;}\r
21                 void ChangeState(const int value){current_state = value;}\r
22                 void CyclicExcute();\r
23                 void Display(ecrobot::Lcd& lcd);\r
24         void SetETLineTracer(ETLineTracer* value);\r
25         };\r
26 }\r
27 \r
28 #endif  /* CONTEXT_H */\r