-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTuringMachineState.h
51 lines (43 loc) · 1.37 KB
/
TuringMachineState.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef TURINGMACHINESTATE_H_
#define TURINGMACHINESTATE_H_
#include<string>
using namespace std;
/*
current state
current content
next state
next content
move direction
*/
class TuringMachineState{
public:
TuringMachineState();
TuringMachineState(int currentState, int currentContent, int nextState, int nextContent, string moveDirection);
int getCurrentState() const;
int getCurrentContent() const;
int getNextState() const;
int getNextContent() const;
string getMoveDirection() const;
void setCurrentState(int newCurrentState);
void setCurrentContent(int newCurrentContent);
void setNextState(int newNextState);
void setNextContent(int newNextContent);
void setMoveDirection(string newMoveDirection);
//输出操作符重载
friend ostream& operator<<(ostream& os, TuringMachineState& state);
//输入操作符号重载
friend istream& operator>>(istream& is, TuringMachineState& state);
//小于号重载
friend bool operator<(TuringMachineState& prev, TuringMachineState& next);
//大于号重载
friend bool operator>(TuringMachineState& prev, TuringMachineState& next);
//等于号重载
friend bool operator==(TuringMachineState& prev, TuringMachineState& next);
private:
int currentState;
int currentContent;
int nextState;
int nextContent;
string moveDirection;
};
#endif