-
Notifications
You must be signed in to change notification settings - Fork 0
/
state-kind.h
135 lines (122 loc) · 1.59 KB
/
state-kind.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#pragma once
#include <cstdint>
#include <string>
enum class AVLTStateKind : uint32_t {
C0 = 0,
A1 = 1,
A2,
A3,
A4,
A5,
A6,
A7,
A8,
A9,
A10,
A11,
A12,
A13,
A14,
A15,
A16,
A17,
A18,
A19,
A20,
A21,
A22,
A23,
A24,
A25,
A26,
R1,
R2,
R3,
R4,
R5,
R6,
R7,
R8,
R9,
R10,
R11,
R12,
R13,
R14,
R15,
R16,
R17,
R18,
R19,
R20,
R21,
R22,
R23,
R24,
R25,
R26,
R27,
R28,
R29,
R30,
R31,
R32,
R33,
R34
};
enum class RBTStateKind : uint32_t {
C0 = 0,
A1 = 1,
A2,
A3,
A4,
A5,
A6,
A7,
A8,
A9,
A10,
A11,
A12,
A13,
A14,
R1,
R2,
R3,
R4,
R5,
R6,
R7,
R8,
R9,
R10,
R11,
R12,
R13,
R14,
R15
};
struct alignas(8) StateStructure {
uint32_t EvenOdd;
RBTStateKind State;
bool operator==(const StateStructure &Other) {
return EvenOdd == Other.EvenOdd && State == Other.State;
}
bool operator!=(const StateStructure &Other) { return not(*this == Other); }
uint64_t getAsUint64T() const;
};
struct alignas(8) AVLTStateStructure {
uint32_t EvenOdd;
AVLTStateKind State;
bool operator==(const AVLTStateStructure &Other) {
return EvenOdd == Other.EvenOdd && State == Other.State;
}
bool operator!=(const AVLTStateStructure &Other) {
return not(*this == Other);
}
uint64_t getAsUint64T() const;
};
extern StateStructure StateStructureFromUint64T(uint64_t Int);
extern AVLTStateStructure AVLTStateStructureFromUint64T(uint64_t Int);
extern std::string StateKind2String(RBTStateKind);
extern std::string StateKind2String(AVLTStateKind);