From 91a0bbc1736f1888ef851aa055d8df27ad59f55d Mon Sep 17 00:00:00 2001 From: Yimura Date: Tue, 5 Jul 2022 09:58:25 +0200 Subject: [PATCH] feat(HashTable): Added Hash storage class --- HashTable.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 HashTable.hpp diff --git a/HashTable.hpp b/HashTable.hpp new file mode 100644 index 0000000..787e431 --- /dev/null +++ b/HashTable.hpp @@ -0,0 +1,28 @@ +#pragma once +#include + +#pragma pack(push, 1) +class HashNode +{ +public: + int32_t m_hash; //0x0000 + uint16_t m_idx; //0x0004 + char pad_0006[2]; //0x0006 + HashNode* m_next; //0x0008 +}; //Size: 0x0010 +static_assert(sizeof(HashNode) == 0x10); + +template +class HashTable +{ +public: + T** m_data; //0x0000 + uint16_t m_size; //0x0008 + char pad_000A[14]; //0x000A + uint64_t m_item_size; //0x0018 + char pad_0020[64]; //0x0020 + HashNode** m_lookup_table; //0x0060 + uint16_t m_lookup_key; //0x0068 +}; //Size: 0x006A +// static_assert(sizeof(HashTable) == 0x6A); // compiler gives assert error without telling me what the problem is, the class is correct though. +#pragma pack(pop)