4#error "SparseSet.h.inl should only be included after defining UE_TSPARSE_SET"
20#include "Templates/Sorting.h"
24#include <initializer_list>
27template <
typename AllocatorType>
30#define TSETPRIVATEFRIEND PREPROCESSOR_JOIN(UE_TSPARSE_SET, PrivateFriend)
59 using SizeType =
typename Allocator::SparseArrayAllocator::ElementAllocator::SizeType;
61 static_assert(std::is_same_v<SizeType, int32>,
"UE_TSPARSE_SET currently only supports 32-bit allocators");
64 using USizeType = std::make_unsigned_t<SizeType>;
69 typedef typename KeyFuncs::KeyInitType KeyInitType;
70 typedef typename KeyFuncs::ElementInitType ElementInitType;
119 return Elements ==
Tag;
132 Elements =
Copy.Elements;
138 template <
typename SetType>
176 template<
typename OtherAllocator>
184 template<
typename OtherAllocator>
192 template<
typename OtherAllocator>
201 template<
typename OtherAllocator>
268 HashSize = Allocator::GetNumberOfHashBuckets(Elements.
Num());
278 HashSize = Allocator::GetNumberOfHashBuckets(Elements.
Num());
288 if ((USizeType)
Number > (USizeType)Elements.
Num())
349 return Elements.
Num();
355 return Elements.
Max();
381 return Elements[
Id.AsInteger()].Value;
387 return Elements[
Id.AsInteger()].Value;
393 return Elements[
Id.AsInteger()].Value;
399 return Elements[
Id.AsInteger()].Value;
461 template <
typename ElementReferenceType>
479 return Element.Value;
486 if constexpr (!KeyFuncs::bAllowDuplicateKeys)
491 if (Elements.
Num() != 1)
493 SizeType
ExistingIndex = FindIndexByHash(KeyHash, KeyFuncs::GetSetKey(Element.Value));
515 inline void RehashOrLink(
uint32 KeyHash, SetElementType& Element, SizeType ElementIndex)
521 LinkElement(ElementIndex, Element, KeyHash);
533 template <
typename ArgType = ElementType>
542 uint32 KeyHash = KeyFuncs::GetKeyHash(KeyFuncs::GetSetKey(Element.Value));
565 const uint32 KeyHash = KeyFuncs::GetKeyHash(KeyFuncs::GetSetKey(Element.Value));
585 template <
typename ArgType = ElementType>
635 template<
typename ArrayAllocator>
650 template<
typename OtherAllocator>
660 template<
typename OtherAllocator>
681 void RemoveByIndex(SizeType ElementIndex)
683 checkf(Elements.
IsValidIndex(ElementIndex),
TEXT(
"Invalid ElementIndex passed to UE_TSPARSE_SET::RemoveByIndex"));
695 if (NextElementIndex == ElementIndex)
734 template <
typename ComparableKey>
737 if (Elements.
Num() == 0)
751 if (KeyFuncs::Matches(KeyFuncs::GetSetKey(Elements[ElementIndex].
Value), Key))
757 ElementIndex = Elements[ElementIndex].HashNextId.AsInteger();
772 return (Result !=
INDEX_NONE) ? &Elements[Result].Value :
nullptr;
794 template<
typename ComparableKey>
799 checkSlow(KeyHash == KeyFuncs::GetKeyHash(Key));
812 SizeType ElementIndex = FindIndexByHash(KeyFuncs::GetKeyHash(Key), Key);
815 return &Elements[ElementIndex].Value;
838 template<
typename ComparableKey>
841 SizeType ElementIndex = FindIndexByHash(KeyHash, Key);
844 return &Elements[ElementIndex].Value;
852 template<
typename ComparableKey>
859 template<
typename ComparableKey>
868 SetElementType& Element = Elements[ElementIndex];
870 if (KeyFuncs::Matches(KeyFuncs::GetSetKey(Element.Value), Key))
874 RemoveByIndex(ElementIndex);
877 if constexpr (!KeyFuncs::bAllowDuplicateKeys)
902 return RemoveImpl(KeyFuncs::GetKeyHash(Key), Key);
918 Result = RemoveImpl(KeyFuncs::GetKeyHash(Key), Key);
932 template<
typename ComparableKey>
937 checkSlow(KeyHash == KeyFuncs::GetKeyHash(Key));
942 return RemoveImpl(KeyHash, Key);
955 return FindIndexByHash(KeyFuncs::GetKeyHash(Key), Key) !=
INDEX_NONE;
963 template<
typename ComparableKey>
968 checkSlow(KeyHash == KeyFuncs::GetKeyHash(Key));
971 return FindIndexByHash(KeyHash, Key) !=
INDEX_NONE;
977 template <
typename PREDICATE_CLASS>
990 template <
typename PREDICATE_CLASS>
1016 Ar.
Logf(
TEXT(
"UE_TSPARSE_SET: %i elements, %i hash slots"), Elements.
Num(), HashSize );
1023 ElementId = Elements[ElementId.AsInteger()].HashNextId)
1039 FSetElementId ElementId = GetTypedHash(KeyFuncs::GetKeyHash(Key));
1047 ElementId = Elements[ElementId.
AsInteger()].HashNextId;
1057 Ar.
Logf(
TEXT(
" Hash[%i]"),HashIndex);
1072 ElementId = Elements[ElementId].HashNextId;
1089 if(
B.Contains(KeyFuncs::GetSetKey(*SetIt)))
1122 if(!
OtherSet.Contains(KeyFuncs::GetSetKey(*SetIt)))
1266 template <
typename PREDICATE_CLASS>
1267 class FElementCompareClass
1279 return Predicate(
A.Value,
B.Value );
1286 ElementArrayType Elements;
1297 this->Elements.WriteMemoryImage(Writer);
1314 ::new((
void*)&
DstObject->Hash) HashType();
1327 ElementArrayType::AppendHash(LayoutParams, Hasher);
1338 inline void LinkElement(SizeType ElementIndex,
const SetElementType& Element,
uint32 KeyHash)
const
1341 Element.HashIndex = KeyHash & (HashSize - 1);
1350 UE_FORCEINLINE_HINT void HashElement(SizeType ElementIndex,
const SetElementType& Element)
const
1352 LinkElement(ElementIndex, Element, KeyFuncs::GetKeyHash(KeyFuncs::GetSetKey(
Element.Value)));
1356 void UnhashElements()
1361 if (
Num() < (HashSize / 4))
1364 for (
const SetElementType& Element: Elements)
1419 for(
typename ElementArrayType::TConstIterator ElementIt(Elements);ElementIt;++ElementIt)
1421 HashElement(ElementIt.GetIndex(), *ElementIt);
1427 template<
bool bConst,
bool bRangedFor = false>
1433 typedef std::conditional_t<bConst,const ElementType,ElementType> ItElementType;
1436 typedef std::conditional_t<
1438 std::conditional_t<bRangedFor, typename ElementArrayType::TRangedForConstIterator, typename ElementArrayType::TConstIterator>,
1439 std::conditional_t<bRangedFor, typename ElementArrayType::TRangedForIterator, typename ElementArrayType::TIterator >
1462 return !(
bool)*
this;
1472 return &ElementIt->Value;
1476 return ElementIt->Value;
1482 ElementItType ElementIt;
1486 template<
bool bConst>
1487 class TBaseKeyIterator
1490 typedef std::conditional_t<bConst, const UE_TSPARSE_SET, UE_TSPARSE_SET> SetType;
1491 typedef std::conditional_t<bConst,const ElementType,ElementType> ItElementType;
1495 using KeyArgumentType =
1497 std::is_reference_v<ReferenceOrValueType>,
1510 NextIndex =
Set.GetTypedHash(KeyFuncs::GetKeyHash(Key)).AsInteger();
1520 inline TBaseKeyIterator& operator++()
1526 NextIndex =
Set.Elements[
Index].HashNextId.AsInteger();
1529 if (KeyFuncs::Matches(KeyFuncs::GetSetKey(
Set.Elements[
Index].Value),Key))
1547 return !(
bool)*
this;
1566 ReferenceOrValueType
Key;
1580 : TBaseIterator<
true>(
InSet.Elements.begin())
1592 : TBaseIterator<
false>(
InSet.Elements.begin())
1614 using Super = TBaseKeyIterator<true>;
1629 using Super = TBaseKeyIterator<false>;
1689template <
typename RangeType>
1694 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1697 Object.WriteMemoryImage(Writer);
1700 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1707 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1720 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1740 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1743 Slot <<
Set.Elements;
1757 template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1760 return A.Elements ==
B.Elements;
1765template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1768 return TSETPRIVATEFRIEND::Serialize(Ar,
Set);
1772template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1775 TSETPRIVATEFRIEND::SerializeStructured(Ar,
Set);
1779template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1782 return TSETPRIVATEFRIEND::LegacyCompareEqual(
A,
B);
1784template<
typename ElementType,
typename KeyFuncs,
typename Allocator>
1787 return !TSETPRIVATEFRIEND::LegacyCompareEqual(
A,
B);
1795#undef TSETPRIVATEFRIEND
constexpr bool operator!(EUpdateTransformFlags Value)
Definition ActorComponent.h:116
EAllowShrinking
Definition AllowShrinking.h:10
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
UE_FORCEINLINE_HINT FLinearColor operator*(float Scalar, const FLinearColor &Color)
Definition Color.h:473
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_STATIC_ASSERT_WARN(bExpression, Message)
Definition CoreMiscDefines.h:431
EInPlace
Definition CoreMiscDefines.h:162
EConstEval
Definition CoreMiscDefines.h:161
@ ConstEval
Definition CoreMiscDefines.h:161
#define UE_TSPARSE_SET
Definition SparseSet.h.inl:1431
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
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
bool LegacyCompareNotEqual(const UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &A, const UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &B)
Definition SparseSet.h.inl:1785
bool LegacyCompareEqual(const UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &A, const UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &B)
Definition SparseSet.h.inl:1780
FArchive & operator<<(FArchive &Ar, UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &Set)
Definition SparseSet.h.inl:1766
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTempIfPossible(T &&Obj) noexcept
Definition UnrealTemplate.h:538
void Move(T &A, typename TMoveSupportTraits< T >::Copy B)
Definition UnrealTemplate.h:24
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsModifyingWeakAndStrongReferences() const
Definition Archive.h:462
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
UE_FORCEINLINE_HINT bool IsSaving() const
Definition Archive.h:248
virtual void CountBytes(SIZE_T InNum, SIZE_T InMax)
Definition Archive.h:125
Definition MemoryImageWriter.h:14
CORE_API uint32 WriteBytes(const void *Data, uint32 Size)
Definition MemoryImage.cpp:2143
bool Is32BitTarget() const
Definition MemoryImageWriter.h:26
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
UE_FORCEINLINE_HINT bool IsValidId() const
Definition SetUtilities.h:101
Definition StructuredArchiveSlots.h:52
Definition ArrayView.h:139
Definition ScriptSparseSet.h:26
void SortFreeList()
Definition SparseArray.h:322
int32 Num() const
Definition SparseArray.h:470
bool Compact()
Definition SparseArray.h:412
int32 Max() const
Definition SparseArray.h:476
void RemoveAtUninitialized(int32 Index, int32 Count=1)
Definition SparseArray.h:191
FSparseArrayAllocationInfo AddUninitialized()
Definition SparseArray.h:117
bool IsValidIndex(int32 Index) const
Definition SparseArray.h:481
bool IsAllocated(int32 Index) const
Definition SparseArray.h:486
void Shrink()
Definition SparseArray.h:256
void Reserve(int32 ExpectedNumElements)
Definition SparseArray.h:219
int32 GetMaxIndex() const
Definition SparseArray.h:460
bool IsEmpty() const
Definition SparseArray.h:465
Definition SparseArray.h:524
void RemoveAt(int32 Index, int32 Count=1)
Definition SparseArray.h:650
SIZE_T GetAllocatedSize(void) const
Definition SparseArray.h:808
void StableSort(const PREDICATE_CLASS &Predicate)
Definition SparseArray.h:746
void CountBytes(FArchive &Ar) const
Definition SparseArray.h:814
void Reset()
Definition SparseArray.h:682
UE_FORCEINLINE_HINT void CheckAddress(const ElementType *Addr) const
Definition SparseArray.h:1036
void Sort(const PREDICATE_CLASS &Predicate)
Definition SparseArray.h:726
bool CompactStable()
Definition SparseArray.h:703
void Empty(int32 ExpectedNumElements=0)
Definition SparseArray.h:666
int32 FindArbitraryElementIndex() const
Definition SparseArray.h:791
Definition SparseSetElement.h:80
CORE_API FArchive & GetUnderlyingArchive() const
Definition StructuredArchiveSlots.cpp:7
CORE_API void Reserve(int32 CharacterCount)
Definition String.cpp.inl:307
Definition SparseSet.h.inl:1575
UE_FORCEINLINE_HINT TConstIterator(const UE_TSPARSE_SET &InSet)
Definition SparseSet.h.inl:1579
Definition SparseSet.h.inl:1612
typename Super::KeyArgumentType KeyArgumentType
Definition SparseSet.h.inl:1617
UE_FORCEINLINE_HINT TConstKeyIterator(const UE_TSPARSE_SET &InSet, KeyArgumentType InKey)
Definition SparseSet.h.inl:1619
Definition SparseSet.h.inl:1587
TIterator(UE_TSPARSE_SET &InSet)
Definition SparseSet.h.inl:1591
UE_FORCEINLINE_HINT void RemoveCurrent()
Definition SparseSet.h.inl:1598
Definition SparseSet.h.inl:1627
UE_FORCEINLINE_HINT TKeyIterator(UE_TSPARSE_SET &InSet, KeyArgumentType InKey)
Definition SparseSet.h.inl:1634
typename Super::KeyArgumentType KeyArgumentType
Definition SparseSet.h.inl:1632
void RemoveCurrent()
Definition SparseSet.h.inl:1640
Definition SparseSet.h.inl:53
UE_TSPARSE_SET & operator=(const UE_TSPARSE_SET &Copy)
Definition SparseSet.h.inl:126
UE_TSPARSE_SET Intersect(const UE_TSPARSE_SET &OtherSet) const
Definition SparseSet.h.inl:1078
friend bool operator==(const UE_TSPARSE_SET &, const UE_TSPARSE_SET &)=delete
void Append(const UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &OtherSet)
Definition SparseSet.h.inl:651
static constexpr bool bHasIntrusiveUnsetOptionalState
Definition SparseSet.h.inl:110
UE_FORCEINLINE_HINT TConstIterator CreateConstIterator() const
Definition SparseSet.h.inl:1654
void Append(UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &&OtherSet)
Definition SparseSet.h.inl:661
UE_TSPARSE_SET(FIntrusiveUnsetOptionalState Tag)
Definition SparseSet.h.inl:113
bool IsValidId(FSetElementId Id) const
Definition SparseSet.h.inl:369
UE_FORCEINLINE_HINT int32 Num() const
Definition SparseSet.h.inl:347
FSetElementId FindId(KeyInitType Key) const
Definition SparseSet.h.inl:784
typename Allocator::SparseArrayAllocator::ElementAllocator::SizeType SizeType
Definition SparseSet.h.inl:59
ElementType * FindByHash(uint32 KeyHash, const ComparableKey &Key)
Definition SparseSet.h.inl:839
UE_FORCEINLINE_HINT const ElementType * Find(KeyInitType Key) const
Definition SparseSet.h.inl:828
ElementType * Find(KeyInitType Key)
Definition SparseSet.h.inl:810
UE_FORCEINLINE_HINT FSetElementId Add(const InElementType &InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition SparseSet.h.inl:409
UE_FORCEINLINE_HINT TRangedForConstIterator begin() const
Definition SparseSet.h.inl:1670
int32 RemoveStable(KeyInitType Key)
Definition SparseSet.h.inl:912
UE_TSPARSE_SET Union(const UE_TSPARSE_SET &OtherSet) const
Definition SparseSet.h.inl:1098
UE_TSPARSE_SET & operator=(std::initializer_list< ElementType > InitList)
Definition SparseSet.h.inl:210
UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize(void) const
Definition SparseSet.h.inl:323
FSetElementId Emplace(ArgType &&Arg, bool *bIsAlreadyInSetPtr=nullptr)
Definition SparseSet.h.inl:534
TBaseIterator< false, true > TRangedForIterator
Definition SparseSet.h.inl:1608
void RemoveStable(FSetElementId ElementId)
Definition SparseSet.h.inl:722
void SortFreeList()
Definition SparseSet.h.inl:1005
const ElementType * FindArbitraryElement() const
Definition SparseSet.h.inl:774
UE_FORCEINLINE_HINT ElementType & FindOrAdd(InElementType &&InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition SparseSet.h.inl:429
InElementType ElementType
Definition SparseSet.h.inl:55
static void AppendHash(const FPlatformTypeLayoutParameters &LayoutParams, FSHA1 &Hasher)
Definition SparseSet.h.inl:1325
UE_FORCEINLINE_HINT const ElementType & Get(FSetElementId Id) const
Definition SparseSet.h.inl:397
bool VerifyHashElementsKey(KeyInitType Key) const
Definition SparseSet.h.inl:1032
ElementType * FindArbitraryElement()
Definition SparseSet.h.inl:767
bool Includes(const UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &OtherSet) const
Definition SparseSet.h.inl:1137
FSetElementId EmplaceByHash(uint32 KeyHash, ArgType &&Args, bool *bIsAlreadyInSetPtr=nullptr)
Definition SparseSet.h.inl:586
UE_FORCEINLINE_HINT ElementType & Get(FSetElementId Id)
Definition SparseSet.h.inl:391
void Append(TArrayView< const ElementType > InElements)
Definition SparseSet.h.inl:626
void WriteMemoryImage(FMemoryImageWriter &Writer) const
Definition SparseSet.h.inl:1292
UE_FORCEINLINE_HINT TRangedForConstIterator end() const
Definition SparseSet.h.inl:1678
void Append(TArray< ElementType, ArrayAllocator > &&InElements)
Definition SparseSet.h.inl:636
bool operator==(FIntrusiveUnsetOptionalState Tag) const
Definition SparseSet.h.inl:117
UE_FORCEINLINE_HINT FSetElementId AddByHash(uint32 KeyHash, const InElementType &InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition SparseSet.h.inl:443
bool ContainsByHash(uint32 KeyHash, const ComparableKey &Key) const
Definition SparseSet.h.inl:964
int32 RemoveByHash(uint32 KeyHash, const ComparableKey &Key)
Definition SparseSet.h.inl:933
void StableSort(const PREDICATE_CLASS &Predicate)
Definition SparseSet.h.inl:991
void Sort(const PREDICATE_CLASS &Predicate)
Definition SparseSet.h.inl:978
UE_TSPARSE_SET(UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &&Other)
Definition SparseSet.h.inl:177
FSetElementId FindIdByHash(uint32 KeyHash, const ComparableKey &Key) const
Definition SparseSet.h.inl:795
void Dump(FOutputDevice &Ar)
Definition SparseSet.h.inl:1014
UE_FORCEINLINE_HINT const ElementType & operator[](FSetElementId Id) const
Definition SparseSet.h.inl:385
void CopyUnfrozen(const FMemoryUnfreezeContent &Context, void *Dst) const
Definition SparseSet.h.inl:1307
void Append(const UE_TSPARSE_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, OtherAllocator > &OtherSet)
Definition SparseSet.h.inl:1233
UE_FORCEINLINE_HINT ElementType & FindOrAdd(const InElementType &InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition SparseSet.h.inl:425
void CountBytes(FArchive &Ar) const
Definition SparseSet.h.inl:329
void DumpHashElements(FOutputDevice &Ar)
Definition SparseSet.h.inl:1053
TArray< ElementType > Array() const
Definition SparseSet.h.inl:1160
KeyFuncs KeyFuncsType
Definition SparseSet.h.inl:56
UE_FORCEINLINE_HINT ~UE_TSPARSE_SET()
Definition SparseSet.h.inl:101
UE_TSPARSE_SET & operator=(UE_TSPARSE_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, Allocator > &&Other)
Definition SparseSet.h.inl:1193
UE_TSPARSE_SET & operator=(UE_TSPARSE_SET &&Other)
Definition SparseSet.h.inl:165
void Reset()
Definition SparseSet.h.inl:244
UE_FORCEINLINE_HINT void Relax()
Definition SparseSet.h.inl:313
UE_FORCEINLINE_HINT TRangedForIterator begin()
Definition SparseSet.h.inl:1666
friend uint32 GetTypeHash(const UE_TSPARSE_SET &Set)=delete
void Empty(int32 ExpectedNumElements=0)
Definition SparseSet.h.inl:221
TPair< FSetElementId, bool > EmplaceByHash(EInPlace, uint32 KeyHash, ArgTypes &&... InArgs)
Definition SparseSet.h.inl:611
UE_FORCEINLINE_HINT int32 GetMaxIndex() const
Definition SparseSet.h.inl:359
int32 Remove(KeyInitType Key)
Definition SparseSet.h.inl:898
void Remove(FSetElementId ElementId)
Definition SparseSet.h.inl:713
UE_FORCEINLINE_HINT UE_TSPARSE_SET(const UE_TSPARSE_SET &Copy)
Definition SparseSet.h.inl:85
UE_FORCEINLINE_HINT FSetElementId AddByHash(uint32 KeyHash, InElementType &&InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition SparseSet.h.inl:447
UE_FORCEINLINE_HINT UE_TSPARSE_SET(TArray< ElementType > &&InArray)
Definition SparseSet.h.inl:95
friend bool operator!=(const UE_TSPARSE_SET &, const UE_TSPARSE_SET &)=delete
void Reserve(int32 Number)
Definition SparseSet.h.inl:284
const ElementType * FindByHash(uint32 KeyHash, const ComparableKey &Key) const
Definition SparseSet.h.inl:853
Allocator AllocatorType
Definition SparseSet.h.inl:57
UE_FORCEINLINE_HINT int32 Max() const
Definition SparseSet.h.inl:353
UE_FORCEINLINE_HINT void CheckAddress(const ElementType *Addr) const
Definition SparseSet.h.inl:1177
TPair< FSetElementId, bool > Emplace(EInPlace, ArgTypes &&... InArgs)
Definition SparseSet.h.inl:558
UE_TSPARSE_SET(const UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &Other)
Definition SparseSet.h.inl:185
UE_FORCEINLINE_HINT TRangedForIterator end()
Definition SparseSet.h.inl:1674
TBaseIterator< true, true > TRangedForConstIterator
Definition SparseSet.h.inl:1607
UE_FORCEINLINE_HINT TIterator CreateIterator()
Definition SparseSet.h.inl:1648
UE_FORCEINLINE_HINT constexpr UE_TSPARSE_SET()=default
UE_TSPARSE_SET & operator=(const UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &Other)
Definition SparseSet.h.inl:202
ElementType & FindOrAddByHash(uint32 KeyHash, ElementReferenceType &&InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition SparseSet.h.inl:462
UE_FORCEINLINE_HINT bool Contains(KeyInitType Key) const
Definition SparseSet.h.inl:953
consteval UE_TSPARSE_SET(EConstEval)
Definition SparseSet.h.inl:78
UE_TSPARSE_SET & operator=(UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &&Other)
Definition SparseSet.h.inl:193
UE_TSPARSE_SET Difference(const UE_TSPARSE_SET &OtherSet) const
Definition SparseSet.h.inl:1115
void Append(UE_TSPARSE_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, Allocator > &&OtherSet)
Definition SparseSet.h.inl:1253
UE_TSPARSE_SET(UE_TSPARSE_SET &&Other)
Definition SparseSet.h.inl:158
void Compact()
Definition SparseSet.h.inl:264
UE_TSPARSE_SET & operator=(const UE_TSPARSE_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, OtherAllocator > &Other)
Definition SparseSet.h.inl:1214
void Shrink()
Definition SparseSet.h.inl:257
UE_TSPARSE_SET(std::initializer_list< ElementType > InitList)
Definition SparseSet.h.inl:151
void Append(std::initializer_list< ElementType > InitList)
Definition SparseSet.h.inl:671
UE_FORCEINLINE_HINT ElementType & operator[](FSetElementId Id)
Definition SparseSet.h.inl:379
void CompactStable()
Definition SparseSet.h.inl:274
UE_FORCEINLINE_HINT FSetElementId Add(InElementType &&InElement, bool *bIsAlreadyInSetPtr=nullptr)
Definition SparseSet.h.inl:413
bool IsEmpty() const
Definition SparseSet.h.inl:341
UE_FORCEINLINE_HINT UE_TSPARSE_SET(TArrayView< const ElementType > InArrayView)
Definition SparseSet.h.inl:90
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
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
@ Element
Definition Visu.h:18
void Rehash(HashType &Hash, int32 HashSize)
Definition SparseSetElement.h:132
void CopyHash(HashType &Hash, int32 &HashSize, const HashType &Copy, int32 HashSizeCopy)
Definition SparseSetElement.h:117
CORE_API void OnInvalidSetNum(unsigned long long NewNum)
Definition ContainerHelpers.cpp:12
FORCEINLINE UE_STRING_CLASS RhsType && Rhs
Definition String.cpp.inl:718
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition IntrusiveUnsetOptionalState.h:71
static UE_FORCEINLINE_HINT void * Memcpy(void *Dest, const void *Src, SIZE_T Count)
Definition UnrealMemory.h:160
static UE_FORCEINLINE_HINT void * Memset(void *Dest, uint8 Char, SIZE_T Count)
Definition UnrealMemory.h:119
Definition SparseArray.h:31
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 FArchive & Serialize(FArchive &Ar, UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &Set)
Definition SparseSet.h.inl:1721
static void SerializeStructured(FStructuredArchive::FSlot Slot, UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &Set)
Definition SparseSet.h.inl:1741
static bool LegacyCompareEqual(const UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &A, const UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &B)
Definition SparseSet.h.inl:1758
TCallTraits< T >::ConstPointerType ConstPointerType
Definition UnrealTypeTraits.h:337