26 lines
358 B
C++
26 lines
358 B
C++
#ifndef CONTEXT_H
|
|
#define CONTEXT_H
|
|
|
|
#include <state.h>
|
|
|
|
class Context
|
|
{
|
|
public:
|
|
Context(State& initialState);
|
|
|
|
void transition_to(State& newState);
|
|
|
|
void do_work();
|
|
|
|
void reset();
|
|
void set_operational();
|
|
void set_pre_operational();
|
|
void fault();
|
|
|
|
const char* current_state_name() const;
|
|
|
|
private:
|
|
State* state;
|
|
};
|
|
|
|
#endif |