4#include "Containers/HashTable.h"
10 template<
typename TIDType,
typename TElementType>
48 template<
typename TIDType,
typename TElementType,
typename TTraits = THashMappedArrayTraits<TIDType, TElementType>>
76 if (
Find(ID) ==
nullptr)
89 if (
Find(ID) ==
nullptr)
103 const FHashType Key = FTraits::GetIDHash(ID);
117 const FHashType Key = FTraits::GetIDHash(ID);
124 const FHashType Key = FTraits::GetIDHash(ID);
127 if (FTraits::GetElementID(Elements[
Index]) == ID)
138 Elements.RemoveAt(
Index);
152 Elements.RemoveAtSwap(
Index);
166 return const_cast<FType*
>(
this)->
Find(ID);
172 const FHashType Key = FTraits::GetIDHash(ID);
175 if (FTraits::GetElementID(Elements[
Index]) == ID)
177 return &Elements[
Index];
186 return Elements.Num();
192 return Elements[ElementIndex];
198 return Elements[ElementIndex];
#define checkSlow(expr)
Definition AssertionMacros.h:332
uint32 MurmurFinalize32(uint32 Hash)
Definition HashTable.h:23
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition HashMappedArray.h:50
const FElementType * Find(const FIDType ID) const
Definition HashMappedArray.h:164
FORCEINLINE void Emplace(const FIDType ID, ArgsType &&... Args)
Definition HashMappedArray.h:112
uint32 FHashType
Definition HashMappedArray.h:55
THashMappedArray(const int32 InHashSize)
Definition HashMappedArray.h:59
TIDType FIDType
Definition HashMappedArray.h:52
TTraits FTraits
Definition HashMappedArray.h:54
int32 Num() const
Definition HashMappedArray.h:184
FORCEINLINE bool TryAdd(const FIDType ID, const FElementType &Element)
Definition HashMappedArray.h:74
const FElementType & At(const int32 ElementIndex) const
Definition HashMappedArray.h:196
void Remove(const FIDType ID)
Definition HashMappedArray.h:122
FElementType & At(const int32 ElementIndex)
Definition HashMappedArray.h:190
FORCEINLINE bool TryEmplace(const FIDType ID, ArgsType &&... Args)
Definition HashMappedArray.h:87
void Reset(const int32 InReserveElements)
Definition HashMappedArray.h:65
FORCEINLINE void Add(const FIDType ID, const FElementType &Element)
Definition HashMappedArray.h:98
TArray< FElementType > ExtractElements()
Definition HashMappedArray.h:202
FElementType * Find(const FIDType ID)
Definition HashMappedArray.h:170
Definition HashTable.h:210
bool IsValid(uint32 Index) const
Definition HashTable.h:409
void Clear()
Definition HashTable.h:350
CORE_API void Resize(uint32 NewIndexSize)
Definition HashTable.cpp:7
void Remove(uint32 Key, uint32 Index)
Definition HashTable.h:437
void Add(uint32 Key, uint32 Index)
Definition HashTable.h:414
uint32 First(uint32 Key) const
Definition HashTable.h:395
uint32 Next(uint32 Index) const
Definition HashTable.h:402
Definition BodyInstance.h:90
@ Add
Definition PendingSpatialData.h:18
U16 Index
Definition radfft.cpp:71
Definition HashMappedArray.h:12
static uint32 GetIDHash(const FIDType &ID)
Definition HashMappedArray.h:17
static FIDType GetElementID(const FElementType &Element)
Definition HashMappedArray.h:22
TIDType FIDType
Definition HashMappedArray.h:13
Definition ElementType.h:30