AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
state_id.h
1#ifndef STATE_ID_H
2#define STATE_ID_H
3
4#include <iostream>
5
6// For documentation on classes relevant to storing and working with registered
7// states see the file state_registry.h.
8
9class StateID {
10 friend class StateRegistry;
11 friend std::ostream &operator<<(std::ostream &os, StateID id);
12 template<typename>
13 friend class PerStateInformation;
14 template<typename>
15 friend class PerStateArray;
16 friend class PerStateBitset;
17
18 int value;
19
20 // No implementation to prevent default construction
21 StateID();
22
23public:
24 ~StateID() {}
25
26 // HACK
27 explicit StateID(int value_)
28 : value(value_)
29 {
30 }
31
32 static const StateID no_state;
33
34 bool operator==(const StateID &other) const {
35 return value == other.value;
36 }
37
38 bool operator!=(const StateID &other) const {
39 return !(*this == other);
40 }
41
42 // HACK
43 int get_value() const { return value; }
44};
45
46
47#endif