CommonLibSSE NG
NiTPointerMap.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/N/NiTMapBase.h"
5 
6 namespace RE
7 {
8  template <class Key, class T>
9  class NiTPointerMap : public NiTMapBase<NiTPointerAllocator<std::uintptr_t>, Key, T>
10  {
11  private:
13 
14  public:
15  using key_type = typename Base::key_type;
16  using mapped_type = typename Base::mapped_type;
17  using value_type = typename Base::value_type;
18  using size_type = typename Base::size_type;
19 
20  NiTPointerMap(std::uint32_t a_hashSize = 37) :
21  Base(a_hashSize)
22  {}
23 
24  ~NiTPointerMap() override // 00
25  {}
26 
27  protected:
28  using Base::_allocator;
29 
30  // override (NiTMapBase)
31  value_type* malloc_value() override // 05
32  {
33  return static_cast<value_type*>(_allocator.Allocate());
34  }
35 
36  void free_value(value_type* a_value) override // 06
37  {
38  a_value->~value_type();
39  _allocator.Deallocate(a_value);
40  }
41  };
42  static_assert(sizeof(NiTPointerMap<std::uint32_t, std::uint64_t>) == 0x20);
43 }
Definition: NiTMapBase.h:24
std::uint32_t size_type
Definition: NiTMapBase.h:33
AntiBloatAllocator _allocator
Definition: NiTMapBase.h:370
NiTMapItem< Key, T > value_type
Definition: NiTMapBase.h:32
Definition: NiTPointerMap.h:10
typename Base::key_type key_type
Definition: NiTPointerMap.h:15
typename Base::value_type value_type
Definition: NiTPointerMap.h:17
value_type * malloc_value() override
Definition: NiTPointerMap.h:31
typename Base::mapped_type mapped_type
Definition: NiTPointerMap.h:16
void free_value(value_type *a_value) override
Definition: NiTPointerMap.h:36
NiTPointerMap(std::uint32_t a_hashSize=37)
Definition: NiTPointerMap.h:20
typename Base::size_type size_type
Definition: NiTPointerMap.h:18
~NiTPointerMap() override
Definition: NiTPointerMap.h:24
Definition: AbsorbEffect.h:6