4#error "CompactSet.h.inl should only be included after defining UE_TCOMPACT_SET"
20#include <initializer_list>
28#define TSETPRIVATEFRIEND PREPROCESSOR_JOIN(UE_TCOMPACT_SET, PrivateFriend)
57class alignas(Allocator::template AllocatorAlignment<InElementType>::Value)
UE_TCOMPACT_SET :
public TCompactSetBase<typename Allocator::template ElementAllocator<sizeof(InElementType)>>
68 using USizeType = std::make_unsigned_t<SizeType>;
69 using KeyInitType =
typename KeyFuncs::KeyInitType;
70 using ElementInitType =
typename KeyFuncs::ElementInitType;
73 template <
typename ScriptAllocator>
84 using SetType = std::conditional_t<bConst, const UE_TCOMPACT_SET, UE_TCOMPACT_SET>;
87 using ElementItType = std::conditional_t<bConst, const ElementType, ElementType>;
90 : TBaseIterator(
InSet, 0)
94 [[
nodiscard]]
inline TBaseIterator(SetType&
InSet, SizeType StartIndex)
102 check(StartIndex >= 0 && StartIndex <= InitialNum);
120 checkf(SetNum >= InitialNum,
TEXT(
"Sets/Maps should never have elements removed during iteration outside of Iterator.RemoveCurrent(). InitialNum %d CurrentNum %d"), InitialNum, SetNum);
129 return Set.IsValidId(this->GetId());
140 return !(*
this ==
Rhs);
158 template<
bool bConst>
159 class TBaseKeyIterator
162 typedef std::conditional_t < bConst, const UE_TCOMPACT_SET, UE_TCOMPACT_SET > SetType;
163 typedef std::conditional_t < bConst, const ElementType, ElementType > ItElementType;
167 using KeyArgumentType = std::conditional_t <
168 std::is_reference_v<ReferenceOrValueType> ,
187 inline TBaseKeyIterator& operator++()
193 checkf(SetNum >= InitialNum,
TEXT(
"Sets/Maps should never have elements removed during iteration outside of Iterator.RemoveCurrent(). InitialNum %d CurrentNum %d"), InitialNum, SetNum);
200 NextIndex = HashTable.GetNext(
Index, SetNum);
203 if (KeyFuncs::Matches(KeyFuncs::GetSetKey(
Set[GetId()]), Key))
228 return &
Set[GetId()];
238 ReferenceOrValueType
Key;
257 using Super = TBaseIterator<false>;
265 this->
Set.Remove(this->GetId());
280 using Super = TBaseKeyIterator<false>;
289 this->
Set.Remove(this->GetId());
339 template<
typename OtherAllocator>
346 template<
typename OtherAllocator>
388 ResizeAllocation(
Copy.NumElements);
406 Other.NumElements = 0;
407 Other.MaxElements = 0;
414 template<
typename OtherAllocator>
423 template<
typename OtherAllocator>
490 GetHashTableView().
Reset();
502 GetHashTableView().
Reset();
511 if (ResizeAllocationPreserveData(this->
NumElements))
531 if (ResizeAllocationPreserveData(
Number))
546 ensureMsgf(
false,
TEXT(
"Compact sets are always compact so CompactStable will not do anything. If you hit this then you likely need to use a different pattern to maintain order, see RemoveStable"));
566 return Super::GetAllocatedSize(GetSetLayout());
579 return Super::GetTotalMemoryRequiredInBytes(NumElements, GetSetLayout());
611 if constexpr (AllocatorType::RequireRangeCheck)
613 checkf(
IsValidId(
Id),
TEXT(
"Array index out of bounds: %d into an array of size %lld"),
Id.AsInteger(), (
long long)this->NumElements);
686 template<
typename ArgType = ElementType>
713 const KeyInitType Key = KeyFuncs::GetSetKey(
TempElement);
714 const uint32 KeyHash = KeyFuncs::GetKeyHash(Key);
716 if constexpr (!KeyFuncs::bAllowDuplicateKeys)
747 template<
typename ArgType = ElementType>
776 if constexpr (!KeyFuncs::bAllowDuplicateKeys)
823 template<
typename ElementReferenceType>
850 template<
typename ArrayAllocator>
865 template<
typename OtherAllocator>
875 template<
typename OtherAllocator>
967 template<
typename ComparableKey>
970 checkSlow(KeyHash == KeyFuncs::GetKeyHash(Key));
981 SizeType ElementIndex = FindIndexByHash(KeyFuncs::GetKeyHash(Key), Key);
984 return GetData() + ElementIndex;
1007 template<
typename ComparableKey>
1010 SizeType ElementIndex = FindIndexByHash(KeyHash, Key);
1013 return GetData() + ElementIndex;
1021 template<
typename ComparableKey>
1045 return RemoveImpl(KeyFuncs::GetKeyHash(Key), Key);
1069 return RemoveImplStable(KeyFuncs::GetKeyHash(Key), Key);
1082 template<
typename ComparableKey>
1085 checkSlow(KeyHash == KeyFuncs::GetKeyHash(Key));
1089 return RemoveImpl(KeyHash, Key);
1102 return FindIndexByHash(KeyFuncs::GetKeyHash(Key), Key) !=
INDEX_NONE;
1110 template<
typename ComparableKey>
1113 checkSlow(KeyHash == KeyFuncs::GetKeyHash(Key));
1114 return FindIndexByHash(KeyHash, Key) !=
INDEX_NONE;
1120 template<
typename PredicateType>
1130 template<
typename PredicateType>
1184 if (
B.Contains(KeyFuncs::GetSetKey(Element)))
1186 Result.Add(Element);
1200 Result.Add(Element);
1204 Result.Add(Element);
1217 if (!
OtherSet.Contains(KeyFuncs::GetSetKey(Element)))
1219 Result.Add(Element);
1235 if (
OtherSet.NumElements <= this->NumElements)
1239 if (!
Contains(KeyFuncs::GetSetKey(Element)))
1282 #if TARRAY_RANGED_FOR_CHECKS
1390 return (ElementType*)this->
Elements.GetAllocation();
1395 return (
const ElementType*)this->
Elements.GetAllocation();
1405 return Super::GetHashTableView(GetSetLayout());
1410 return Super::GetConstHashTableView(GetSetLayout());
1428 if (this->MaxElements > 0)
1437 HashTable.
Add(
Index, KeyFuncs::GetKeyHash(KeyFuncs::GetSetKey(ElementData[
Index])));
1445 if (this->NumElements == this->MaxElements)
1449 GetHashTableView().
Add(this->NumElements, KeyHash);
1450 return GetData()[this->NumElements++];
1458 template<
typename ComparableKey>
1461 if (this->NumElements == 0)
1469 const uint32 HashCount = *HashTable;
1472 #define UE_COMPACTHASHTABLE_EXECUTEBYTYPE(Type) \
1473 const Type* NextIndices = (const Type *)NextIndicesData; \
1474 const Type* HashIndices = NextIndices + this->MaxElements; \
1475 for (Type Index = HashIndices[KeyHash & (HashCount-1)]; Index != (Type)INDEX_NONE; Index = NextIndices[Index]) \
1477 checkSlow((SizeType)Index < this->NumElements); \
1478 if (KeyFuncs::Matches(KeyFuncs::GetSetKey(ElementData[Index]), Key)) \
1485 #undef UE_COMPACTHASHTABLE_EXECUTEBYTYPE
1490 template <
bool IsStable = false>
1491 void RemoveByIndex(
const SizeType ElementIndex)
1497 template <
bool IsStable = false>
1498 void RemoveByIndexAndHash(
const SizeType ElementIndex,
const uint32 KeyHash)
1505 const SizeType LastElementIndex = this->NumElements - 1;
1506 if (ElementIndex == LastElementIndex)
1508 HashTable.
Remove(ElementIndex, KeyHash, ElementIndex, KeyHash);
1529 --this->NumElements;
1532 template<
typename ComparableKey,
bool IsStable = false>
1542 SizeType ElementIndex = HashTable.
GetFirst(KeyHash);
1546 if (KeyFuncs::Matches(KeyFuncs::GetSetKey(
ElementsData[ElementIndex]), Key))
1551 if constexpr (!KeyFuncs::bAllowDuplicateKeys)
1560 ElementIndex = HashTable.
GetFirst(KeyHash);
1564 if (LastElementIndex == this->NumElements)
1566 LastElementIndex = ElementIndex;
1569 ElementIndex = HashTable.
GetNext(LastElementIndex, this->NumElements);
1575 LastElementIndex = ElementIndex;
1576 ElementIndex = HashTable.
GetNext(LastElementIndex, this->NumElements);
1583 template<
typename ComparableKey>
1590template<
typename RangeType>
1595 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1598 Object.WriteMemoryImage(Writer);
1601 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1608 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1621 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1633 Set.NumElements = 0;
1634 Set.ResizeAllocation(NumElements);
1636 ElementType* Data =
Set.GetData();
1637 for (
int32 ElementIndex = 0; ElementIndex < NumElements; ElementIndex++)
1639 Ar << *::new((
void*)(Data + ElementIndex)) ElementType;
1642 Set.NumElements = NumElements;
1647 for (ElementType& Element :
Set)
1656 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1666 Set.NumElements = 0;
1667 Set.ResizeAllocation(NumElements);
1669 ElementType* Data =
Set.GetData();
1670 for (
int32 ElementIndex = 0; ElementIndex < NumElements; ElementIndex++)
1673 ElementSlot << *::new((
void*)(Data + ElementIndex)) ElementType;
1676 Set.NumElements = NumElements;
1681 for (ElementType& Element :
Set)
1690 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1698template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1701 return TSETPRIVATEFRIEND::Serialize(Ar,
Set);
1705template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1708 TSETPRIVATEFRIEND::SerializeStructured(Ar,
Set);
1712template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1715 return TSETPRIVATEFRIEND::LegacyCompareEqual(
A,
B);
1717template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1720 return !TSETPRIVATEFRIEND::LegacyCompareEqual(
A,
B);
1728#undef TSETPRIVATEFRIEND
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
#define ensureMsgf( InExpression, InFormat,...)
Definition AssertionMacros.h:465
#define checkNoEntry()
Definition AssertionMacros.h:316
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
UE_FORCEINLINE_HINT FLinearColor operator*(float Scalar, const FLinearColor &Color)
Definition Color.h:473
#define UE_COMPACTHASHTABLE_CALLBYTYPE(NextIndexCount)
Definition CompactHashTable.h:24
FArchive & operator<<(FArchive &Ar, UE_TCOMPACT_SET< ElementType, KeyFuncs, Allocator > &Set)
Definition CompactSet.h.inl:1699
bool LegacyCompareEqual(const UE_TCOMPACT_SET< ElementType, KeyFuncs, Allocator > &A, const UE_TCOMPACT_SET< ElementType, KeyFuncs, Allocator > &B)
Definition CompactSet.h.inl:1713
bool LegacyCompareNotEqual(const UE_TCOMPACT_SET< ElementType, KeyFuncs, Allocator > &A, const UE_TCOMPACT_SET< ElementType, KeyFuncs, Allocator > &B)
Definition CompactSet.h.inl:1718
#define UE_TCOMPACT_SET
Definition CompactSet.h:5
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_STATIC_ASSERT_WARN(bExpression, Message)
Definition CoreMiscDefines.h:431
EInPlace
Definition CoreMiscDefines.h:162
@ InPlace
Definition CoreMiscDefines.h:162
EConstEval
Definition CoreMiscDefines.h:161
@ ConstEval
Definition CoreMiscDefines.h:161
FORCEINLINE constexpr void DestructItems(ElementType *Element, SizeType Count)
Definition MemoryOps.h:81
FORCEINLINE bool CompareItems(const ElementType *A, const ElementType *B, SizeType Count)
Definition MemoryOps.h:287
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
typename TElementType< T >::Type TElementType_T
Definition ElementType.h:57
UE_FORCEINLINE_HINT bool operator!=(const FIndexedPointer &Other) const
Definition LockFreeList.h:76
#define DECLARE_TEMPLATE_INTRINSIC_TYPE_LAYOUT(TemplatePrefix, T)
Definition MemoryLayout.h:661
const bool
Definition NetworkReplayStreaming.h:178
TIndexedContainerIterator< const TArray< FPreviewAttachedObjectPair >, const FPreviewAttachedObjectPair, int32 > TConstIterator
Definition PreviewAssetAttachComponent.h:69
TIndexedContainerIterator< TArray< FPreviewAttachedObjectPair >, FPreviewAttachedObjectPair, int32 > TIterator
Definition PreviewAssetAttachComponent.h:68
#define UE_REQUIRES(...)
Definition Requires.h:86
void MoveByRelocate(T &A, T &B)
Definition SetUtilities.h:82
auto GetData(const TStringConversion< Converter, DefaultConversionSize > &Conversion) -> decltype(Conversion.Get())
Definition StringConv.h:802
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTempIfPossible(T &&Obj) noexcept
Definition UnrealTemplate.h:538
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
if(Failed) console_printf("Failed.\n")
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
virtual void CountBytes(SIZE_T InNum, SIZE_T InMax)
Definition Archive.h:125
Definition CompactHashTable.h:350
UE_FORCEINLINE_HINT void RemoveStable(uint32 Index, uint32 Key) const
Definition CompactHashTable.h:380
void Reset() const
Definition CompactHashTable.h:357
void Add(uint32 Index, uint32 Key) const
Definition CompactHashTable.h:365
UE_FORCEINLINE_HINT void Remove(uint32 Index, uint32 Key, uint32 LastIndex, uint32 OptLastKey) const
Definition CompactHashTable.h:373
Definition CompactHashTable.h:283
uint32 GetFirst(uint32 Key) const
Definition CompactHashTable.h:304
uint32 GetHashCount() const
Definition CompactHashTable.h:298
uint32 GetNext(uint32 Index, uint32 CurrentCount) const
Definition CompactHashTable.h:321
uint32 GetFirstByIndex(uint32 HashIndex) const
Definition CompactHashTable.h:313
Definition MemoryImageWriter.h:14
CORE_API uint32 WriteBytes(const void *Data, uint32 Size)
Definition MemoryImage.cpp:2143
CORE_API uint32 WriteAlignment(uint32 Alignment)
Definition MemoryImage.cpp:2133
bool Is32BitTarget() const
Definition MemoryImageWriter.h:26
CORE_API FMemoryImageWriter WritePointer(const FTypeLayoutDesc &StaticTypeDesc, const FTypeLayoutDesc &DerivedTypeDesc, uint32 *OutOffsetToBase=nullptr)
Definition MemoryImage.cpp:2153
Definition MemoryImageWriter.h:78
Definition OutputDevice.h:133
void Logf(const FmtType &Fmt)
Definition OutputDevice.h:234
Definition SecureHash.h:314
Definition SetUtilities.h:95
static UE_FORCEINLINE_HINT FSetElementId FromInteger(int32 Integer)
Definition SetUtilities.h:121
constexpr UE_FORCEINLINE_HINT int32 AsInteger() const
Definition SetUtilities.h:116
Definition StructuredArchiveSlots.h:172
Definition StructuredArchiveSlots.h:52
UE_API FStructuredArchiveArray EnterArray(int32 &Num)
Definition StructuredArchiveSlots.h:257
Definition ArrayView.h:139
Definition CompactSetBase.h:19
typename AllocatorType::SizeType SizeType
Definition CompactSetBase.h:22
Allocator AllocatorType
Definition CompactSetBase.h:21
SizeType MaxElements
Definition CompactSetBase.h:279
ElementAllocatorType Elements
Definition CompactSetBase.h:276
UE_FORCEINLINE_HINT const HashCountType * GetHashTableMemory(const FCompactSetLayout Layout) const
Definition CompactSetBase.h:97
int32 AllocatorCalculateSlackGrow(int32 NewMaxElements, const FCompactSetLayout &Layout) const
Definition CompactSetBase.h:152
uint32 HashCountType
Definition CompactSetBase.h:74
SizeType NumElements
Definition CompactSetBase.h:278
Definition ScriptCompactSet.h:17
CORE_API FArchive & GetUnderlyingArchive() const
Definition StructuredArchiveSlots.cpp:7
CORE_API void Reserve(int32 CharacterCount)
Definition String.cpp.inl:307
Definition CompactSet.h.inl:255
void RemoveCurrent()
Definition CompactSet.h.inl:263
Definition CompactSet.h.inl:278
void RemoveCurrent()
Definition CompactSet.h.inl:287
typename Super::KeyArgumentType KeyArgumentType
Definition CompactSet.h.inl:283
Definition CompactSet.h.inl:58
ElementType & Get(FSetElementId Id)
Definition CompactSet.h.inl:632
void Dump(FOutputDevice &Ar) const
Definition CompactSet.h.inl:1141
ElementType * Find(KeyInitType Key)
Definition CompactSet.h.inl:979
TPair< FSetElementId, bool > EmplaceByHash(EInPlace, uint32 KeyHash, ArgTypes &&... InArgs)
Definition CompactSet.h.inl:770
friend bool operator==(const UE_TCOMPACT_SET &, const UE_TCOMPACT_SET &)=delete
UE_FORCEINLINE_HINT TConstIterator CreateConstIterator() const
Definition CompactSet.h.inl:1273
UE_TCOMPACT_SET & operator=(const UE_TCOMPACT_SET< ElementType, KeyFuncs, OtherAllocator > &Other)
Definition CompactSet.h.inl:424
void Append(std::initializer_list< ElementType > InitList)
Definition CompactSet.h.inl:886
const ElementType * FindArbitraryElement() const
Definition CompactSet.h.inl:946
UE_TCOMPACT_SET Difference(const UE_TCOMPACT_SET &OtherSet) const
Definition CompactSet.h.inl:1210
UE_FORCEINLINE_HINT FSetElementId AddByHash(uint32 KeyHash, const ElementType &InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition CompactSet.h.inl:670
UE_TCOMPACT_SET & operator=(UE_TCOMPACT_SET< ElementType, KeyFuncs, OtherAllocator > &&Other)
Definition CompactSet.h.inl:415
void CopyUnfrozen(const FMemoryUnfreezeContent &Context, void *Dst) const
Definition CompactSet.h.inl:1341
int32 RemoveByHash(uint32 KeyHash, const ComparableKey &Key)
Definition CompactSet.h.inl:1083
void Reset()
Definition CompactSet.h.inl:495
UE_TCOMPACT_SET(const UE_TCOMPACT_SET< ElementType, KeyFuncs, OtherAllocator > &Other)
Definition CompactSet.h.inl:347
void Append(const UE_TCOMPACT_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, OtherAllocator > &OtherSet)
Definition CompactSet.h.inl:906
consteval UE_TCOMPACT_SET(EConstEval)
Definition CompactSet.h.inl:308
UE_FORCEINLINE_HINT FSetElementId Emplace(ArgType &&Arg, bool *bIsAlreadyInSetPtr=nullptr)
Definition CompactSet.h.inl:687
UE_FORCEINLINE_HINT UE_TCOMPACT_SET(const UE_TCOMPACT_SET &Copy)
Definition CompactSet.h.inl:313
UE_FORCEINLINE_HINT void CheckInvariants() const
Definition CompactSet.h.inl:596
KeyFuncs KeyFuncsType
Definition CompactSet.h.inl:61
void CountBytes(FArchive &Ar) const
Definition CompactSet.h.inl:570
bool Includes(const UE_TCOMPACT_SET< ElementType, KeyFuncs, Allocator > &OtherSet) const
Definition CompactSet.h.inl:1232
void Sort(const PredicateType &Predicate)
Definition CompactSet.h.inl:1121
void SortFreeList()
Definition CompactSet.h.inl:550
ElementType * FindArbitraryElement()
Definition CompactSet.h.inl:942
UE_FORCEINLINE_HINT UE_TCOMPACT_SET(TArray< ElementType > &&InArray)
Definition CompactSet.h.inl:323
UE_FORCEINLINE_HINT UE_TCOMPACT_SET(TArrayView< const ElementType > InArrayView)
Definition CompactSet.h.inl:318
bool ContainsByHash(uint32 KeyHash, const ComparableKey &Key) const
Definition CompactSet.h.inl:1111
friend uint32 GetTypeHash(const UE_TCOMPACT_SET &Set)=delete
UE_TCOMPACT_SET(FIntrusiveUnsetOptionalState Tag)
Definition CompactSet.h.inl:365
UE_FORCEINLINE_HINT const ElementType * Find(KeyInitType Key) const
Definition CompactSet.h.inl:997
static void AppendHash(const FPlatformTypeLayoutParameters &LayoutParams, FSHA1 &Hasher)
Definition CompactSet.h.inl:1373
UE_TCOMPACT_SET & operator=(UE_TCOMPACT_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, Allocator > &&Other)
Definition CompactSet.h.inl:449
void Append(UE_TCOMPACT_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, Allocator > &&OtherSet)
Definition CompactSet.h.inl:926
void WriteMemoryImage(FMemoryImageWriter &Writer) const
Definition CompactSet.h.inl:1305
UE_FORCEINLINE_HINT FSetElementId Add(const ElementType &InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition CompactSet.h.inl:652
UE_FORCEINLINE_HINT ElementType & FindOrAdd(const InElementType &InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition CompactSet.h.inl:805
void Append(UE_TCOMPACT_SET< ElementType, KeyFuncs, OtherAllocator > &&OtherSet)
Definition CompactSet.h.inl:876
void Append(TArrayView< const ElementType > InElements)
Definition CompactSet.h.inl:841
TArrayView< const ElementType > ArrayView() const
Definition CompactSet.h.inl:1261
UE_TCOMPACT_SET & operator=(std::initializer_list< ElementType > InitList)
Definition CompactSet.h.inl:431
int32 RemoveStable(KeyInitType Key)
Definition CompactSet.h.inl:1065
UE_FORCEINLINE_HINT ElementType & FindOrAdd(InElementType &&InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition CompactSet.h.inl:809
void Compact()
Definition CompactSet.h.inl:539
static constexpr bool bHasIntrusiveUnsetOptionalState
Definition CompactSet.h.inl:362
UE_FORCEINLINE_HINT TIterator CreateIterator()
Definition CompactSet.h.inl:1267
UE_FORCEINLINE_HINT const ElementType * end() const
Definition CompactSet.h.inl:1297
UE_TCOMPACT_SET Intersect(const UE_TCOMPACT_SET &OtherSet) const
Definition CompactSet.h.inl:1173
UE_FORCEINLINE_HINT bool Contains(KeyInitType Key) const
Definition CompactSet.h.inl:1100
UE_FORCEINLINE_HINT ~UE_TCOMPACT_SET()
Definition CompactSet.h.inl:352
void Relax()
Definition CompactSet.h.inl:555
static UE_FORCEINLINE_HINT constexpr size_t GetTotalMemoryRequiredInBytes(uint32 NumElements)
Definition CompactSet.h.inl:577
FSetElementId FindIdByHash(uint32 KeyHash, const ComparableKey &Key) const
Definition CompactSet.h.inl:968
UE_FORCEINLINE_HINT FSetElementId AddByHash(uint32 KeyHash, ElementType &&InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition CompactSet.h.inl:674
UE_TCOMPACT_SET(UE_TCOMPACT_SET< ElementType, KeyFuncs, OtherAllocator > &&Other)
Definition CompactSet.h.inl:340
void RangeCheck(FSetElementId Id) const
Definition CompactSet.h.inl:606
FSetElementId FindId(KeyInitType Key) const
Definition CompactSet.h.inl:957
UE_FORCEINLINE_HINT ElementType * begin()
Definition CompactSet.h.inl:1294
const ElementType * TRangedForConstIterator
Definition CompactSet.h.inl:1292
void Append(TArray< ElementType, ArrayAllocator > &&InElements)
Definition CompactSet.h.inl:851
UE_FORCEINLINE_HINT ElementType * end()
Definition CompactSet.h.inl:1296
TBaseKeyIterator< true > TConstKeyIterator
Definition CompactSet.h.inl:274
void Empty(int32 ExpectedNumElements=0)
Definition CompactSet.h.inl:482
ElementType * FindByHash(uint32 KeyHash, const ComparableKey &Key)
Definition CompactSet.h.inl:1008
UE_FORCEINLINE_HINT constexpr UE_TCOMPACT_SET()=default
UE_TCOMPACT_SET Union(const UE_TCOMPACT_SET &OtherSet) const
Definition CompactSet.h.inl:1193
UE_TCOMPACT_SET & operator=(const UE_TCOMPACT_SET &Copy)
Definition CompactSet.h.inl:374
UE_TCOMPACT_SET & operator=(UE_TCOMPACT_SET &&Other)
Definition CompactSet.h.inl:398
ElementType * TRangedForIterator
Definition CompactSet.h.inl:1291
UE_TCOMPACT_SET & operator=(const UE_TCOMPACT_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, OtherAllocator > &Other)
Definition CompactSet.h.inl:470
UE_FORCEINLINE_HINT bool IsValidId(FSetElementId Id) const
Definition CompactSet.h.inl:587
UE_FORCEINLINE_HINT const ElementType * begin() const
Definition CompactSet.h.inl:1295
UE_FORCEINLINE_HINT FSetElementId Add(ElementType &&InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition CompactSet.h.inl:656
const ElementType & Get(FSetElementId Id) const
Definition CompactSet.h.inl:639
void Append(const UE_TCOMPACT_SET< ElementType, KeyFuncs, OtherAllocator > &OtherSet)
Definition CompactSet.h.inl:866
const ElementType & operator[](FSetElementId Id) const
Definition CompactSet.h.inl:625
void Reserve(int32 Number)
Definition CompactSet.h.inl:519
UE_TCOMPACT_SET(std::initializer_list< ElementType > InitList)
Definition CompactSet.h.inl:328
InElementType ElementType
Definition CompactSet.h.inl:60
void Shrink()
Definition CompactSet.h.inl:507
void RemoveStable(FSetElementId ElementId)
Definition CompactSet.h.inl:1055
void StableSort(const PredicateType &Predicate)
Definition CompactSet.h.inl:1131
void CompactStable()
Definition CompactSet.h.inl:544
const ElementType * FindByHash(uint32 KeyHash, const ComparableKey &Key) const
Definition CompactSet.h.inl:1022
UE_TCOMPACT_SET(UE_TCOMPACT_SET &&Other)
Definition CompactSet.h.inl:333
TArray< ElementType > Array() const
Definition CompactSet.h.inl:1255
TBaseIterator< true > TConstIterator
Definition CompactSet.h.inl:251
friend bool operator!=(const UE_TCOMPACT_SET &, const UE_TCOMPACT_SET &)=delete
UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize() const
Definition CompactSet.h.inl:564
void Remove(FSetElementId ElementId)
Definition CompactSet.h.inl:1031
TPair< FSetElementId, bool > Emplace(EInPlace, ArgTypes &&... InArgs)
Definition CompactSet.h.inl:707
ElementType & operator[](FSetElementId Id)
Definition CompactSet.h.inl:618
int32 Remove(KeyInitType Key)
Definition CompactSet.h.inl:1041
UE_FORCEINLINE_HINT FSetElementId EmplaceByHash(uint32 KeyHash, ArgType &&Arg, bool *bIsAlreadyInSetPtr=nullptr)
Definition CompactSet.h.inl:748
ElementType & FindOrAddByHash(uint32 KeyHash, ElementReferenceType &&InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition CompactSet.h.inl:824
void SetNum(TArrayView< T > &View, int32 Num)
Definition AssetDataTagMap.cpp:1011
UE_NODEBUG void IntrinsicWriteMemoryImage(FMemoryImageWriter &Writer, const TArray< T, AllocatorType > &Object, const FTypeLayoutDesc &)
Definition Array.h:3957
CORE_API uint32 DefaultAppendHash(const FTypeLayoutDesc &TypeDesc, const FPlatformTypeLayoutParameters &LayoutParams, FSHA1 &Hasher)
Definition MemoryImage.cpp:575
CORE_API uint32 AppendHash(const FTypeLayoutDesc &TypeDesc, const FPlatformTypeLayoutParameters &LayoutParams, FSHA1 &Hasher)
Definition MemoryImage.cpp:864
UE_NODEBUG uint32 IntrinsicUnfrozenCopy(const FMemoryUnfreezeContent &Context, const TArray< T, AllocatorType > &Object, void *OutDst)
Definition Array.h:3963
UE_NODEBUG uint32 IntrinsicAppendHash(const TArray< T, AllocatorType > *DummyObject, const FTypeLayoutDesc &TypeDesc, const FPlatformTypeLayoutParameters &LayoutParams, FSHA1 &Hasher)
Definition Array.h:3970
bool operator==(const FCachedAssetKey &A, const FCachedAssetKey &B)
Definition AssetDataMap.h:501
uint32 GetFirst(uint32 Key, const IndexType *HashData, const uint32 HashCount)
Definition CompactHashTable.h:92
UE_FORCEINLINE_HINT constexpr size_t GetMemoryAlignment()
Definition CompactHashTable.h:69
implementation
Definition PlayInEditorLoadingScope.h:8
CORE_API void OnInvalidSetNum(unsigned long long NewNum)
Definition ContainerHelpers.cpp:12
FORCEINLINE UE_STRING_CLASS RhsType && Rhs
Definition String.cpp.inl:718
U16 Index
Definition radfft.cpp:71
Definition CompactSetBase.h:11
Definition IntrusiveUnsetOptionalState.h:71
static UE_FORCEINLINE_HINT void * Memcpy(void *Dest, const void *Src, SIZE_T Count)
Definition UnrealMemory.h:160
Definition MemoryLayout.h:108
Definition ContainerAllocationPolicies.h:256
InElementType CopyFromOtherType
Definition ContainerElementTypeCompatibility.h:17
static constexpr void CopyingFromOtherType()
Definition ContainerElementTypeCompatibility.h:29
Definition MemoryLayout.h:626
Definition SetUtilities.h:14
@ Value
Definition SetUtilities.h:14
Definition RetainedRef.h:62
Definition CompactSet.h.inl:1619
static void SerializeStructured(FStructuredArchive::FSlot Slot, UE_TCOMPACT_SET< ElementType, KeyFuncs, Allocator > &Set)
Definition CompactSet.h.inl:1657
static bool LegacyCompareEqual(const UE_TCOMPACT_SET< ElementType, KeyFuncs, Allocator > &A, const UE_TCOMPACT_SET< ElementType, KeyFuncs, Allocator > &B)
Definition CompactSet.h.inl:1691
static FArchive & Serialize(FArchive &Ar, UE_TCOMPACT_SET< ElementType, KeyFuncs, Allocator > &Set)
Definition CompactSet.h.inl:1622
TCallTraits< T >::ConstPointerType ConstPointerType
Definition UnrealTypeTraits.h:337