-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedge.h
51 lines (41 loc) · 862 Bytes
/
edge.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
#include <string>
#include <utility>
#include <map>
#ifndef COURSEWORK_EDGE_H
#define COURSEWORK_EDGE_H
using namespace std;
class Node;
class MemoryNode;
class Edge {
public:
string by;
Node* to;
bool drawn = false;
Edge() {
this->drawn = false;
};
Edge(string by, Node* to) {
this->drawn = false;
this->by = std::move(by);
this->to = to;
}
};
enum MemoryAction {
open,
close
};
class MemoryEdge: public Edge {
public:
map<string, MemoryAction> memoryActions;
MemoryNode* to;
MemoryEdge() = default;
MemoryEdge(string by, MemoryNode* to) {
this->drawn = false;
this->by = std::move(by);
this->to = to;
};
void addAction(const string& var, MemoryAction action) {
memoryActions[var] = action;
}
};
#endif //COURSEWORK_EDGE_H