CommonLibSSE (Parapets fork)
Loading...
Searching...
No Matches
GHashsetCachedEntry.h
Go to the documentation of this file.
1#pragma once
2
3namespace RE
4{
5 template <class T, class Hash>
7 {
8 public:
10 nextInChain(-2),
11 hashValue(0),
12 value{}
13 {}
14
16 nextInChain(a_entry.nextInChain),
17 hashValue(a_entry.hashValue),
18 value(a_entry.value)
19 {}
20
21 GHashsetCachedEntry(const T& a_key, SPInt a_next) :
22 nextInChain(a_next),
23 hashValue(0),
24 value(a_key)
25 {}
26
27 [[nodiscard]] bool IsEmpty() const
28 {
29 return nextInChain == -2;
30 }
31
32 [[nodiscard]] bool IsEndOfChain() const
33 {
34 return nextInChain == -1;
35 }
36
37 [[nodiscard]] UPInt GetCachedHash(UPInt a_maskValue) const
38 {
39 return hashValue;
40 }
41
42 void SetCachedHash(UPInt a_hashValue)
43 {
44 hashValue = a_hashValue;
45 }
46
47 void Clear()
48 {
49 value.~C();
50 nextInChain = -2;
51 }
52
53 void Free()
54 {
55 Clear();
56 }
57
58 // members
61 T value; // 10
62 };
63 // size == 0x10 + sizeof(T)
64}
Definition: GHashsetCachedEntry.h:7
bool IsEndOfChain() const
Definition: GHashsetCachedEntry.h:32
void Free()
Definition: GHashsetCachedEntry.h:53
UPInt GetCachedHash(UPInt a_maskValue) const
Definition: GHashsetCachedEntry.h:37
T value
Definition: GHashsetCachedEntry.h:61
GHashsetCachedEntry(const T &a_key, SPInt a_next)
Definition: GHashsetCachedEntry.h:21
GHashsetCachedEntry()
Definition: GHashsetCachedEntry.h:9
void Clear()
Definition: GHashsetCachedEntry.h:47
void SetCachedHash(UPInt a_hashValue)
Definition: GHashsetCachedEntry.h:42
bool IsEmpty() const
Definition: GHashsetCachedEntry.h:27
GHashsetCachedEntry(const GHashsetCachedEntry &a_entry)
Definition: GHashsetCachedEntry.h:15
UPInt hashValue
Definition: GHashsetCachedEntry.h:60
SPInt nextInChain
Definition: GHashsetCachedEntry.h:59
Definition: AbsorbEffect.h:6
std::size_t UPInt
Definition: SFTypes.h:5
std::ptrdiff_t SPInt
Definition: SFTypes.h:8