6#include "Containers/Map.h"
9#define RUN_HASHTABLE_CONCURENCY_CHECKS UE_BUILD_DEBUG
11#if RUN_HASHTABLE_CONCURENCY_CHECKS
12#define CHECK_CONCURRENT_ACCESS(x) check(x)
14#define CHECK_CONCURRENT_ACCESS(x)
20namespace RobinHoodHashTable_Private
22 template<
typename,
typename,
typename,
typename>
33 return Hash ==
Other.Hash;
38 return Hash !=
Other.Hash;
49 template<
typename,
typename,
typename,
typename>
57 inline bool IsOccupied()
const
59 return Hash != InvalidHash;
62 inline bool IsFree()
const
64 return Hash == InvalidHash;
96namespace RobinHoodHashTable_Private
98 template<
typename AllocatorType>
101 using IndexType =
int32;
110 int32 NumElements = 0;
118 void Push(IndexType NodeIndex)
129 const int LeftoverSize =
Size % 2;
142 if (FreeList[
Index].Start < NodeIndex)
150 if (
Index < FreeList.
Num() && FreeList[
Index].End + 1 == NodeIndex)
152 FreeList[
Index].End = NodeIndex;
155 if (FreeList[
Index - 1].Start - 1 == NodeIndex)
157 FreeList[
Index - 1].Start = FreeList[
Index].Start;
164 if (FreeList[
Index - 1].Start - 1 == NodeIndex)
166 FreeList[
Index - 1].Start = NodeIndex;
171 FreeList.
Insert(FSpan{ NodeIndex , NodeIndex },
Index);
178 FSpan& Span = FreeList.
Last();
179 IndexType
Index = Span.Start;
181 if (Span.Start == Span.End)
195 for (
int i = FreeList.
Num() - 1; i > -0; i--)
197 const FSpan& Span = FreeList[i];
229 template<
typename KeyType,
typename ValueType>
233 using FindValueTypeConst =
const ValueType *;
236 template<
typename,
typename,
typename,
typename>
237 friend class TRobinHoodHashTable;
239 template<
typename DeducedKeyType,
typename DeducedValueType>
253 inline FindValueTypeConst FindImpl()
const
258 template<
typename DeducedValueType>
274 inline const KeyType& GetKey()
const
280 template<
typename KeyType>
281 class TKeyValue<KeyType, FUnitType>
285 using ElementType =
const KeyType;
287 template<
typename,
typename,
typename,
typename>
288 friend class TRobinHoodHashTable;
290 template<
typename DeducedKeyType>
308 inline const KeyType& GetKey()
const
314 template<
typename KeyType,
typename ValueType,
typename Hasher,
typename HashMapAllocator>
319 using KeyValueType = RobinHoodHashTable_Private::TKeyValue<KeyType, ValueType>;
345 template<
typename DeducedKeyType,
typename DeducedValueType>
377#if RUN_HASHTABLE_CONCURENCY_CHECKS
430 return Index == Rhs.Index;
435 return Index != Rhs.Index;
481#if RUN_HASHTABLE_CONCURENCY_CHECKS
508 if (HashData[CurrentBucket].IsFree())
515 IndexData[CurrentBucket] = InsertIndex;
528 IndexData[CurrentBucket] = InsertIndex;
541 template<
bool UpdateValue,
typename DeducedKeyType,
typename DeducedValueType>
554 if (Hasher::Matches(Key, KeyValueData.
Get(IndexData[BucketIndex]).GetKey()))
559 if constexpr (UpdateValue)
563 return IndexData[BucketIndex];
575 SizePow2Minus1 = SizePow2Minus1 * 2 + 1;
577 IndexData.Reserve(SizePow2Minus1 + 1);
578 IndexData.AddUninitialized(SizePow2Minus1 + 1);
579 HashData.Reserve(SizePow2Minus1 + 1);
580 HashData.AddDefaulted(SizePow2Minus1 + 1);
598 return FHashElementId(InsertIndex);
602 template<
typename DeducedKeyType,
typename DeducedValueType>
608 template<
typename DeducedKeyType,
typename DeducedValueType>
615 template<
typename DeducedKeyType,
typename DeducedValueType>
619 return KeyValueData.
Get(
Id.GetIndex()).FindImpl();
622 template<
typename DeducedKeyType,
typename DeducedValueType>
628 template<
typename DeducedKeyType,
typename DeducedValueType>
635 template<
typename DeducedKeyType,
typename DeducedValueType>
639 return KeyValueData.
Get(
Id.GetIndex()).FindImpl();
644 IndexData.Reserve(1); IndexData.AddUninitialized();
645 HashData.Reserve(1); HashData.AddDefaulted();
650 SizePow2Minus1 =
Other.SizePow2Minus1;
651 MaximumDistance =
Other.MaximumDistance;
652 KeyValueData =
Other.KeyValueData;
654 IndexData.Reserve(SizePow2Minus1 + 1);
655 IndexData.AddUninitialized(SizePow2Minus1 + 1);
656 HashData.Reserve(SizePow2Minus1 + 1);
657 HashData.AddUninitialized(SizePow2Minus1 + 1);
659 for (
uint32 Idx = 0; Idx <= SizePow2Minus1; Idx++)
661 IndexData[Idx] =
Other.IndexData[Idx];
662 HashData[Idx] =
Other.HashData[Idx];
670 SizePow2Minus1 =
Other.SizePow2Minus1;
671 MaximumDistance =
Other.MaximumDistance;
672 KeyValueData =
Other.KeyValueData;
674 IndexData.Reserve(SizePow2Minus1 + 1);
675 IndexData.AddUninitialized(SizePow2Minus1 + 1);
676 HashData.Reserve(SizePow2Minus1 + 1);
677 HashData.AddUninitialized(SizePow2Minus1 + 1);
679 for (
uint32 Idx = 0; Idx <= SizePow2Minus1; Idx++)
681 IndexData[Idx] =
Other.IndexData[Idx];
682 HashData[Idx] =
Other.HashData[Idx];
691 SizePow2Minus1 =
Other.SizePow2Minus1;
692 MaximumDistance =
Other.MaximumDistance;
705 SizePow2Minus1 =
Other.SizePow2Minus1;
706 MaximumDistance =
Other.MaximumDistance;
731 template<
typename,
typename,
typename,
typename>
738 State = Data.Start();
749 return State == Rhs.State && &Data == &Rhs.Data;
754 return State != Rhs.State || &Data != &Rhs.Data;
759 return Data.Get(State.Index).GetElement();
764 State = Data.Next(State);
789 template<
typename,
typename,
typename,
typename>
796 State = Data.Start();
807 return State == Rhs.State && &Data == &Rhs.Data;
812 return State != Rhs.State || &Data != &Rhs.Data;
817 return Data.Get(State.Index).GetElement();
822 State = Data.Next(State);
844 return KeyValueData.
GetAllocatedSize() + IndexData.GetAllocatedSize() + HashData.GetAllocatedSize();
859 return KeyValueData.
Get(
Id.GetIndex()).GetElement();
864 return KeyValueData.
Get(
Id.GetIndex()).GetElement();
884 if (Hasher::Matches(
ComparableKey, KeyValueData.
Get(IndexData[BucketIndex]).GetKey()))
912 return KeyValueData.
Get(
Id.GetIndex()).FindImpl();
923 return KeyValueData.
Get(
Id.GetIndex()).FindImpl();
934 return KeyValueData.
Get(
Id.GetIndex()).FindImpl();
945 return KeyValueData.
Get(
Id.GetIndex()).FindImpl();
964 if (Hasher::Matches(
ComparableKey, KeyValueData.
Get(IndexData[BucketIndex]).GetKey()))
966 KeyValueData.
Deallocate(IndexData[BucketIndex]);
981 SizePow2Minus1 = SizePow2Minus1 / 2;
983 IndexData.Reserve(SizePow2Minus1 + 1);
984 IndexData.AddUninitialized(SizePow2Minus1 + 1);
985 HashData.Reserve(SizePow2Minus1 + 1);
986 HashData.AddDefaulted(SizePow2Minus1 + 1);
1020 if (
Id.GetIndex() == IndexData[BucketIndex])
1023 KeyValueData.
Deallocate(IndexData[BucketIndex]);
1037 SizePow2Minus1 = SizePow2Minus1 / 2;
1038 MaximumDistance = 0;
1039 IndexData.Reserve(SizePow2Minus1 + 1);
1040 IndexData.AddUninitialized(SizePow2Minus1 + 1);
1041 HashData.Reserve(SizePow2Minus1 + 1);
1042 HashData.AddDefaulted(SizePow2Minus1 + 1);
1065 IndexData.AddUninitialized();
1067 HashData.AddDefaulted();
1068 KeyValueData.
Empty();
1070 MaximumDistance = 0;
1097 MaximumDistance = 0;
1098 IndexData.Reserve(SizePow2Minus1 + 1);
1099 IndexData.AddUninitialized(SizePow2Minus1 + 1);
1100 HashData.Reserve(SizePow2Minus1 + 1);
1101 HashData.AddDefaulted(SizePow2Minus1 + 1);
1126#if RUN_HASHTABLE_CONCURENCY_CHECKS
1133template<
typename KeyType,
typename ValueType,
typename Hasher = TDefaultMapHashableKeyFuncs<KeyType, ValueType, false>,
typename HashMapAllocator = FDefaultAllocator>
1137 using IndexType =
typename Base::IndexType;
1138 using FindValueType =
typename Base::FindValueType;
1139 using FindValueTypeConst =
typename Base::FindValueTypeConst;
1144 static_assert(
sizeof(Base) ==
sizeof(
TRobinHoodHashMap),
"This class should only limit the interface and not implement anything");
1392 FindValueType
Update(
const KeyType& Key,
const ValueType&
Val)
1417template<
typename KeyType,
typename Hasher = DefaultKeyFuncs<KeyType, false>,
typename HashMapAllocator = FDefaultAllocator>
1420 using Unit = RobinHoodHashTable_Private::FUnitType;
1422 using IndexType =
typename Base::IndexType;
1423 using FindValueType =
typename Base::FindValueType;
1424 using FindValueTypeConst =
typename Base::FindValueTypeConst;
1429 static_assert(
sizeof(Base) ==
sizeof(
TRobinHoodHashSet),
"This class should only limit the interface and not implement anything");
1506#undef CHECK_CONCURRENT_ACCESS
1507#undef RUN_HASHTABLE_CONCURENCY_CHECKS
#define checkSlow(expr)
Definition AssertionMacros.h:332
@ INDEX_NONE
Definition CoreMiscDefines.h:150
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define CHECK_CONCURRENT_ACCESS(x)
Definition RobinHoodHashTable.h:14
float Val(const FString &Value)
Definition UnrealMath.cpp:3163
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32 Size
Definition VulkanMemory.cpp:4034
Definition RobinHoodHashTable.h:72
FHashElementId()
Definition RobinHoodHashTable.h:74
FHashElementId(int32 InIndex)
Definition RobinHoodHashTable.h:75
bool IsValid() const
Definition RobinHoodHashTable.h:82
bool operator==(FHashElementId InHashElementId) const
Definition RobinHoodHashTable.h:87
int32 GetIndex() const
Definition RobinHoodHashTable.h:77
Definition RobinHoodHashTable.h:27
FHashType()
Definition RobinHoodHashTable.h:29
uint32 IntType
Definition RobinHoodHashTable.h:41
IntType AsUInt() const
Definition RobinHoodHashTable.h:43
bool operator!=(FHashType Other) const
Definition RobinHoodHashTable.h:36
bool operator==(FHashType Other) const
Definition RobinHoodHashTable.h:31
Definition RobinHoodHashTable.h:785
FConstIteratorType & operator++()
Definition RobinHoodHashTable.h:820
const ElementType & operator*() const
Definition RobinHoodHashTable.h:815
FHashElementId GetElementId() const
Definition RobinHoodHashTable.h:826
bool operator!=(const FConstIteratorType &Rhs) const
Definition RobinHoodHashTable.h:810
bool operator==(const FConstIteratorType &Rhs) const
Definition RobinHoodHashTable.h:805
Definition RobinHoodHashTable.h:727
bool operator!=(const FIteratorType &Rhs) const
Definition RobinHoodHashTable.h:752
FIteratorType & operator++()
Definition RobinHoodHashTable.h:762
bool operator==(const FIteratorType &Rhs) const
Definition RobinHoodHashTable.h:747
ElementType & operator*() const
Definition RobinHoodHashTable.h:757
FHashElementId GetElementId() const
Definition RobinHoodHashTable.h:768
Definition RobinHoodHashTable.h:316
FindValueType Find(const KeyType &Key)
Definition RobinHoodHashTable.h:918
typename KeyValueType::FindValueType FindValueType
Definition RobinHoodHashTable.h:320
SIZE_T SizeType
Definition RobinHoodHashTable.h:324
FindValueType FindByHash(const FHashType HashValue, const KeyType &Key)
Definition RobinHoodHashTable.h:907
typename KeyValueType::ElementType ElementType
Definition RobinHoodHashTable.h:322
FIteratorType begin()
Definition RobinHoodHashTable.h:774
int32 Num() const
Definition RobinHoodHashTable.h:847
FHashElementId UpdateId(DeducedKeyType &&Key, DeducedValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:629
TRobinHoodHashTable()
Definition RobinHoodHashTable.h:642
SizeType GetAllocatedSize() const
Definition RobinHoodHashTable.h:842
FIteratorType end()
Definition RobinHoodHashTable.h:779
FindValueTypeConst Find(const KeyType &Key) const
Definition RobinHoodHashTable.h:940
FHashElementId FindIdByHash(const FHashType HashValue, const KeyType &ComparableKey) const
Definition RobinHoodHashTable.h:872
bool RemoveByElementId(FHashElementId Id)
Definition RobinHoodHashTable.h:1009
FHashElementId FindId(const KeyType &Key) const
Definition RobinHoodHashTable.h:901
FHashElementId FindOrAddIdByHash(FHashType HashValue, DeducedKeyType &&Key, DeducedValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:603
void InsertIntoTable(IndexType Index, FHashType Hash)
Definition RobinHoodHashTable.h:495
typename KeyValueType::FindValueTypeConst FindValueTypeConst
Definition RobinHoodHashTable.h:321
static constexpr const IndexType InvalidIndex
Definition RobinHoodHashTable.h:328
void Reserve(SizeType ReserveNum)
Definition RobinHoodHashTable.h:1076
TRobinHoodHashTable(TRobinHoodHashTable &&Other)
Definition RobinHoodHashTable.h:689
FConstIteratorType begin() const
Definition RobinHoodHashTable.h:832
const FindValueType FindByHash(const FHashType HashValue, const KeyType &Key) const
Definition RobinHoodHashTable.h:929
IndexType GetMaxIndex() const
Definition RobinHoodHashTable.h:852
FHashElementId FindOrAddId(DeducedKeyType &&Key, DeducedValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:609
bool RemoveByHash(const FHashType HashValue, const KeyType &ComparableKey)
Definition RobinHoodHashTable.h:951
uint32 IndexType
Definition RobinHoodHashTable.h:323
void Empty()
Definition RobinHoodHashTable.h:1059
bool Remove(const KeyType &Key)
Definition RobinHoodHashTable.h:1003
IndexType ModTableSize(IndexType HashValue) const
Definition RobinHoodHashTable.h:490
static constexpr const IndexType LoadFactorQuotient
Definition RobinHoodHashTable.h:327
bool ContainsElementId(FHashElementId Id) const
Definition RobinHoodHashTable.h:867
ElementType & GetByElementId(FHashElementId Id)
Definition RobinHoodHashTable.h:857
RobinHoodHashTable_Private::TKeyValue< KeyType, ValueType > KeyValueType
Definition RobinHoodHashTable.h:319
TRobinHoodHashTable & operator=(const TRobinHoodHashTable &Other)
Definition RobinHoodHashTable.h:666
FHashElementId UpdateIdByHash(FHashType HashValue, DeducedKeyType &&Key, DeducedValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:623
static FHashType ComputeHash(const KeyType &Key)
Definition RobinHoodHashTable.h:719
FindValueType Update(DeducedKeyType &&Key, DeducedValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:636
FConstIteratorType end() const
Definition RobinHoodHashTable.h:837
const ElementType & GetByElementId(FHashElementId Id) const
Definition RobinHoodHashTable.h:862
TRobinHoodHashTable(const TRobinHoodHashTable &Other)
Definition RobinHoodHashTable.h:648
FindValueType FindOrAdd(DeducedKeyType &&Key, DeducedValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:616
TRobinHoodHashTable & operator=(TRobinHoodHashTable &&Other)
Definition RobinHoodHashTable.h:701
static constexpr const IndexType LoadFactorDivisor
Definition RobinHoodHashTable.h:326
Definition RobinHoodHashTable.h:1135
FindValueType Update(KeyType &&Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1404
FHashElementId UpdateId(KeyType &&Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1386
FHashElementId UpdateId(KeyType &&Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1319
TRobinHoodHashMap & operator=(TRobinHoodHashMap &&Other)=default
FHashElementId UpdateIdByHash(FHashType HashValue, KeyType &&Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1294
FindValueType FindOrAdd(const KeyType &Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1197
TRobinHoodHashMap()
Definition RobinHoodHashTable.h:1142
FHashElementId UpdateIdByHash(FHashType HashValue, const KeyType &Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1289
FHashElementId FindOrAddId(const KeyType &Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1177
FHashElementId UpdateId(const KeyType &Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1309
FHashElementId FindOrAddId(KeyType &&Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1187
FHashElementId FindOrAddIdByHash(FHashType HashValue, const KeyType &Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1218
FHashElementId UpdateId(const KeyType &Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1374
FHashElementId FindOrAddId(KeyType &&Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1248
FHashElementId FindOrAddId(KeyType &&Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1182
FindValueType FindOrAdd(KeyType &&Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1207
FindValueType Update(const KeyType &Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1398
FHashElementId FindOrAddIdByHash(FHashType HashValue, KeyType &&Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1230
FHashElementId FindOrAddId(const KeyType &Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1172
FindValueType Update(KeyType &&Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1339
TRobinHoodHashMap & operator=(const TRobinHoodHashMap &Other)=default
FHashElementId UpdateIdByHash(FHashType HashValue, KeyType &&Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1299
FHashElementId FindOrAddIdByHash(FHashType HashValue, KeyType &&Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1167
FindValueType FindOrAdd(const KeyType &Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1192
FHashElementId UpdateIdByHash(FHashType HashValue, KeyType &&Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1356
FHashElementId FindOrAddId(const KeyType &Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1236
FHashElementId UpdateId(const KeyType &Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1368
FHashElementId UpdateId(const KeyType &Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1304
FindValueType FindOrAdd(KeyType &&Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1272
FHashElementId FindOrAddIdByHash(FHashType HashValue, KeyType &&Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1224
FindValueType Update(KeyType &&Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1334
TRobinHoodHashMap(const TRobinHoodHashMap &Other)=default
FHashElementId FindOrAddIdByHash(FHashType HashValue, const KeyType &Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1152
FHashElementId UpdateId(KeyType &&Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1314
FHashElementId FindOrAddId(KeyType &&Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1254
FHashElementId UpdateIdByHash(FHashType HashValue, KeyType &&Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1362
FHashElementId FindOrAddIdByHash(FHashType HashValue, const KeyType &Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1212
FHashElementId FindOrAddIdByHash(FHashType HashValue, const KeyType &Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1157
FindValueType Update(KeyType &&Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1410
FindValueType FindOrAdd(const KeyType &Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1266
FHashElementId FindOrAddId(const KeyType &Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1242
FindValueType Update(const KeyType &Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1324
FHashElementId UpdateId(KeyType &&Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1380
FindValueType Update(const KeyType &Key, ValueType &&Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1329
FindValueType Update(const KeyType &Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1392
FHashElementId UpdateIdByHash(FHashType HashValue, const KeyType &Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1350
FindValueType FindOrAdd(const KeyType &Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1260
FHashElementId FindOrAddIdByHash(FHashType HashValue, KeyType &&Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1162
FHashElementId UpdateIdByHash(FHashType HashValue, const KeyType &Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1284
FindValueType FindOrAdd(KeyType &&Key, ValueType &&Val)
Definition RobinHoodHashTable.h:1278
FindValueType FindOrAdd(KeyType &&Key, const ValueType &Val, bool &bIsAlreadyInMap)
Definition RobinHoodHashTable.h:1202
FHashElementId UpdateIdByHash(FHashType HashValue, const KeyType &Key, const ValueType &Val)
Definition RobinHoodHashTable.h:1344
TRobinHoodHashMap(TRobinHoodHashMap &&Other)=default
Definition RobinHoodHashTable.h:1419
TRobinHoodHashSet()
Definition RobinHoodHashTable.h:1427
FindValueType FindOrAdd(const KeyType &Key)
Definition RobinHoodHashTable.h:1491
FHashElementId FindOrAddId(const KeyType &Key, bool &bIsAlreadyInSet)
Definition RobinHoodHashTable.h:1447
FindValueType FindOrAdd(KeyType &&Key)
Definition RobinHoodHashTable.h:1497
TRobinHoodHashSet & operator=(TRobinHoodHashSet &&Other)=default
FHashElementId FindOrAddIdByHash(FHashType HashValue, const KeyType &Key)
Definition RobinHoodHashTable.h:1467
FHashElementId FindOrAddId(const KeyType &Key)
Definition RobinHoodHashTable.h:1479
FHashElementId FindOrAddIdByHash(FHashType HashValue, KeyType &&Key, bool &bIsAlreadyInSet)
Definition RobinHoodHashTable.h:1442
TRobinHoodHashSet(TRobinHoodHashSet &&Other)=default
FindValueType FindOrAdd(KeyType &&Key, bool &bIsAlreadyInSet)
Definition RobinHoodHashTable.h:1462
FindValueType FindOrAdd(const KeyType &Key, bool &bIsAlreadyInSet)
Definition RobinHoodHashTable.h:1457
TRobinHoodHashSet & operator=(const TRobinHoodHashSet &Other)=default
FHashElementId FindOrAddId(KeyType &&Key, bool &bIsAlreadyInSet)
Definition RobinHoodHashTable.h:1452
TRobinHoodHashSet(const TRobinHoodHashSet &Other)=default
FHashElementId FindOrAddIdByHash(FHashType HashValue, KeyType &&Key)
Definition RobinHoodHashTable.h:1473
FHashElementId FindOrAddId(KeyType &&Key)
Definition RobinHoodHashTable.h:1485
FHashElementId FindOrAddIdByHash(FHashType HashValue, const KeyType &Key, bool &bIsAlreadyInSet)
Definition RobinHoodHashTable.h:1437
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & Last(SizeType IndexFromTheEnd=0) UE_LIFETIMEBOUND
Definition Array.h:1263
void RemoveAt(SizeType Index, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2083
UE_NODEBUG UE_FORCEINLINE_HINT void Push(ElementType &&Item)
Definition Array.h:1224
void Reset(SizeType NewSize=0)
Definition Array.h:2246
void SetNumUnsafeInternal(SizeType NewNum)
Definition Array.h:2395
UE_NODEBUG UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize(void) const
Definition Array.h:1059
ElementType Pop(EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:1196
SizeType Insert(std::initializer_list< ElementType > InitList, const SizeType InIndex)
Definition Array.h:1875
void Empty(SizeType Slack=0)
Definition Array.h:2273
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
Definition ContainerAllocationPolicies.h:894
@ Contains
Definition AutomationTest.h:160
Definition RobinHoodHashTable.h:18
SIZE_T GetAllocatedSize(const T &Value)
Definition ManagedArray.h:93
void GetElement(const UTypedElementRegistry *InRegistry, const HandleType &InElementHandle, TTypedElement< BaseInterfaceType > &OutElement)
Definition TypedElementList.h:39
EValueType FindValueType(FName Name)
Definition ShaderValue.cpp:630
U16 Index
Definition radfft.cpp:71
Definition RobinHoodHashTable.h:425
IndexType Index
Definition RobinHoodHashTable.h:426
bool operator==(const FIteratorState &Rhs) const
Definition RobinHoodHashTable.h:428
bool operator!=(const FIteratorState &Rhs) const
Definition RobinHoodHashTable.h:433
Definition RobinHoodHashTable.h:331
void Reserve(SizeType ReserveNum)
Definition RobinHoodHashTable.h:476
void Deallocate(IndexType Index)
Definition RobinHoodHashTable.h:370
FIteratorState Next(FIteratorState State) const
Definition RobinHoodHashTable.h:439
bool Contains(IndexType Index) const
Definition RobinHoodHashTable.h:389
IndexType Allocate(DeducedKeyType &&Key, DeducedValueType &&Val, FHashType Hash)
Definition RobinHoodHashTable.h:346
IndexType GetMaxIndex() const
Definition RobinHoodHashTable.h:419
FData & operator=(const FData &)=default
TFreeList< InlineOneAllocatorType > FreeList
Definition RobinHoodHashTable.h:487
void Empty()
Definition RobinHoodHashTable.h:461
FIteratorState Start() const
Definition RobinHoodHashTable.h:451
KeyValueType & Get(IndexType Index)
Definition RobinHoodHashTable.h:404
TArray< KeyValueType, HashMapAllocator > KeyVals
Definition RobinHoodHashTable.h:485
SizeType GetAllocatedSize() const
Definition RobinHoodHashTable.h:340
const KeyValueType & Get(IndexType Index) const
Definition RobinHoodHashTable.h:394
TArray< FHashType, HashMapAllocator > Hashes
Definition RobinHoodHashTable.h:486
SizeType Num() const
Definition RobinHoodHashTable.h:414
FIteratorState End() const
Definition RobinHoodHashTable.h:456
~FData()
Definition RobinHoodHashTable.h:335
FData(const FData &)=default