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