UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs > Class Template Reference
+ Inheritance diagram for TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >:

Public Member Functions

template<typename PREDICATE_CLASS >
UE_FORCEINLINE_HINT void KeySort (const PREDICATE_CLASS &Predicate)
 
template<typename PREDICATE_CLASS >
UE_FORCEINLINE_HINT void KeyStableSort (const PREDICATE_CLASS &Predicate)
 
template<typename PREDICATE_CLASS >
UE_FORCEINLINE_HINT void ValueSort (const PREDICATE_CLASS &Predicate)
 
template<typename PREDICATE_CLASS >
UE_FORCEINLINE_HINT void ValueStableSort (const PREDICATE_CLASS &Predicate)
 
void SortFreeList ()
 
- Public Member Functions inherited from TMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >
bool OrderIndependentCompareEqual (const TMAPBASE &Other) const
 
UE_FORCEINLINE_HINT void Empty (int32 ExpectedNumElements=0)
 
UE_FORCEINLINE_HINT void Reset ()
 
UE_FORCEINLINE_HINT void Shrink ()
 
UE_FORCEINLINE_HINT void Compact ()
 
UE_FORCEINLINE_HINT void CompactStable ()
 
UE_FORCEINLINE_HINT void Reserve (int32 Number)
 
bool IsEmpty () const
 
UE_FORCEINLINE_HINT int32 Num () const
 
UE_FORCEINLINE_HINT int32 Max () const
 
UE_FORCEINLINE_HINT int32 GetMaxIndex () const
 
UE_FORCEINLINE_HINT bool IsValidId (FSetElementId Id) const
 
UE_FORCEINLINE_HINT ElementTypeGet (FSetElementId Id)
 
UE_FORCEINLINE_HINT const ElementTypeGet (FSetElementId Id) const
 
template<typename Allocator >
int32 GetKeys (TArray< KeyType, Allocator > &OutKeys) const
 
template<typename InSetKeyFuncs , typename InSetAllocator >
int32 GetKeys (TSet< KeyType, InSetKeyFuncs, InSetAllocator > &OutKeys) const
 
UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize () const
 
UE_FORCEINLINE_HINT void CountBytes (FArchive &Ar) const
 
UE_FORCEINLINE_HINT ValueType & Add (const KeyType &InKey, const ValueType &InValue)
 
UE_FORCEINLINE_HINT ValueType & Add (const KeyType &InKey, ValueType &&InValue)
 
UE_FORCEINLINE_HINT ValueType & Add (KeyType &&InKey, const ValueType &InValue)
 
UE_FORCEINLINE_HINT ValueType & Add (KeyType &&InKey, ValueType &&InValue)
 
UE_FORCEINLINE_HINT ValueType & AddByHash (uint32 KeyHash, const KeyType &InKey, const ValueType &InValue)
 
UE_FORCEINLINE_HINT ValueType & AddByHash (uint32 KeyHash, const KeyType &InKey, ValueType &&InValue)
 
UE_FORCEINLINE_HINT ValueType & AddByHash (uint32 KeyHash, KeyType &&InKey, const ValueType &InValue)
 
UE_FORCEINLINE_HINT ValueType & AddByHash (uint32 KeyHash, KeyType &&InKey, ValueType &&InValue)
 
UE_FORCEINLINE_HINT ValueType & Add (const KeyType &InKey)
 
UE_FORCEINLINE_HINT ValueType & Add (KeyType &&InKey)
 
UE_FORCEINLINE_HINT ValueType & AddByHash (uint32 KeyHash, const KeyType &InKey)
 
UE_FORCEINLINE_HINT ValueType & AddByHash (uint32 KeyHash, KeyType &&InKey)
 
UE_FORCEINLINE_HINT ValueType & Add (const TTuple< KeyType, ValueType > &InKeyValue)
 
UE_FORCEINLINE_HINT ValueType & Add (TTuple< KeyType, ValueType > &&InKeyValue)
 
template<typename InitKeyType = KeyType, typename InitValueType = ValueType>
ValueType & Emplace (InitKeyType &&InKey, InitValueType &&InValue)
 
template<typename InitKeyType = KeyType, typename InitValueType = ValueType>
ValueType & EmplaceByHash (uint32 KeyHash, InitKeyType &&InKey, InitValueType &&InValue)
 
template<typename InitKeyType = KeyType>
ValueType & Emplace (InitKeyType &&InKey)
 
template<typename InitKeyType = KeyType>
ValueType & EmplaceByHash (uint32 KeyHash, InitKeyType &&InKey)
 
int32 Remove (KeyConstPointerType InKey)
 
int32 RemoveStable (KeyConstPointerType InKey)
 
template<typename ComparableKey >
int32 RemoveByHash (uint32 KeyHash, const ComparableKey &Key)
 
UE_FORCEINLINE_HINT void Remove (FSetElementId Id)
 
const KeyType * FindKey (ValueInitType Value) const
 
template<typename Predicate >
TMAP< KeyType, ValueType, SetAllocator, KeyFuncs > FilterByPredicate (Predicate Pred) const
 
ValueType * Find (KeyConstPointerType Key)
 
UE_FORCEINLINE_HINT const ValueType * Find (KeyConstPointerType Key) const
 
template<typename ComparableKey >
ValueType * FindByHash (uint32 KeyHash, const ComparableKey &Key)
 
template<typename ComparableKey >
UE_FORCEINLINE_HINT const ValueType * FindByHash (uint32 KeyHash, const ComparableKey &Key) const
 
template<typename ComparableKey >
ValueType & FindByHashChecked (uint32 KeyHash, const ComparableKey &Key)
 
template<typename ComparableKey >
UE_FORCEINLINE_HINT const ValueType & FindByHashChecked (uint32 KeyHash, const ComparableKey &Key) const
 
UE_FORCEINLINE_HINT FSetElementId FindId (KeyInitType Key) const
 
template<typename ComparableKey >
UE_FORCEINLINE_HINT FSetElementId FindIdByHash (uint32 KeyHash, const ComparableKey &Key) const
 
UE_FORCEINLINE_HINT ValueType & FindOrAdd (const KeyType &Key)
 
UE_FORCEINLINE_HINT ValueType & FindOrAdd (KeyType &&Key)
 
UE_FORCEINLINE_HINT ValueType & FindOrAddByHash (uint32 KeyHash, const KeyType &Key)
 
UE_FORCEINLINE_HINT ValueType & FindOrAddByHash (uint32 KeyHash, KeyType &&Key)
 
UE_FORCEINLINE_HINT ValueType & FindOrAdd (const KeyType &Key, const ValueType &Value)
 
UE_FORCEINLINE_HINT ValueType & FindOrAdd (const KeyType &Key, ValueType &&Value)
 
UE_FORCEINLINE_HINT ValueType & FindOrAdd (KeyType &&Key, const ValueType &Value)
 
UE_FORCEINLINE_HINT ValueType & FindOrAdd (KeyType &&Key, ValueType &&Value)
 
UE_FORCEINLINE_HINT ValueType & FindOrAddByHash (uint32 KeyHash, const KeyType &Key, const ValueType &Value)
 
UE_FORCEINLINE_HINT ValueType & FindOrAddByHash (uint32 KeyHash, const KeyType &Key, ValueType &&Value)
 
UE_FORCEINLINE_HINT ValueType & FindOrAddByHash (uint32 KeyHash, KeyType &&Key, const ValueType &Value)
 
UE_FORCEINLINE_HINT ValueType & FindOrAddByHash (uint32 KeyHash, KeyType &&Key, ValueType &&Value)
 
const ValueType & FindChecked (KeyConstPointerType Key) const
 
ValueType & FindChecked (KeyConstPointerType Key)
 
ValueType FindRef (KeyConstPointerType Key) const
 
ValueType FindRef (KeyConstPointerType Key, ValueType DefaultValue) const
 
ElementTypeFindArbitraryElement ()
 
const ElementTypeFindArbitraryElement () const
 
UE_FORCEINLINE_HINT bool Contains (KeyConstPointerType Key) const
 
template<typename ComparableKey >
UE_FORCEINLINE_HINT bool ContainsByHash (uint32 KeyHash, const ComparableKey &Key) const
 
TArray< ElementTypeArray () const
 
template<typename Allocator >
void GenerateKeyArray (TArray< KeyType, Allocator > &OutArray) const
 
template<typename Allocator >
void GenerateValueArray (TArray< ValueType, Allocator > &OutArray) const
 
void Dump (FOutputDevice &Ar)
 
void WriteMemoryImage (FMemoryImageWriter &Writer) const
 
void CopyUnfrozen (const FMemoryUnfreezeContent &Context, void *Dst) const
 
UE_FORCEINLINE_HINT TIterator CreateIterator ()
 
UE_FORCEINLINE_HINT TConstIterator CreateConstIterator () const
 
UE_FORCEINLINE_HINT TKeyIterator CreateKeyIterator (typename TKeyIterator::KeyArgumentType InKey)
 
UE_FORCEINLINE_HINT TConstKeyIterator CreateConstKeyIterator (typename TConstKeyIterator::KeyArgumentType InKey) const
 
UE_FORCEINLINE_HINT TRangedForIterator begin ()
 
UE_FORCEINLINE_HINT TRangedForConstIterator begin () const
 
UE_FORCEINLINE_HINT TRangedForIterator end ()
 
UE_FORCEINLINE_HINT TRangedForConstIterator end () const
 

Protected Types

typedef TMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs > Super
 
using IntrusiveUnsetOptionalStateType = TSORTABLEMAPBASE
 
- Protected Types inherited from TMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >
using IntrusiveUnsetOptionalStateType = TMAPBASE
 
using ElementSetType = TSET< ElementType, KeyFuncs, SetAllocator >
 

Protected Member Functions

constexpr TSORTABLEMAPBASE ()=default
 
consteval TSORTABLEMAPBASE (EConstEval)
 
 TSORTABLEMAPBASE (TSORTABLEMAPBASE &&)=default
 
 TSORTABLEMAPBASE (const TSORTABLEMAPBASE &)=default
 
TSORTABLEMAPBASEoperator= (TSORTABLEMAPBASE &&)=default
 
TSORTABLEMAPBASEoperator= (const TSORTABLEMAPBASE &)=default
 
template<typename OtherSetAllocator >
 TSORTABLEMAPBASE (TSORTABLEMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
 TSORTABLEMAPBASE (const TSORTABLEMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
template<typename OtherSetAllocator >
TSORTABLEMAPBASEoperator= (TSORTABLEMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
TSORTABLEMAPBASEoperator= (const TSORTABLEMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
 TSORTABLEMAPBASE (FIntrusiveUnsetOptionalState Tag)
 
bool operator== (FIntrusiveUnsetOptionalState Tag) const
 
- Protected Member Functions inherited from TMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >
constexpr TMAPBASE ()=default
 
consteval TMAPBASE (EConstEval)
 
 TMAPBASE (TMAPBASE &&)=default
 
 TMAPBASE (const TMAPBASE &)=default
 
TMAPBASEoperator= (TMAPBASE &&)=default
 
TMAPBASEoperator= (const TMAPBASE &)=default
 
template<typename OtherSetAllocator >
 TMAPBASE (TMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
 TMAPBASE (const TMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 
 ~TMAPBASE ()
 
 TMAPBASE (FIntrusiveUnsetOptionalState Tag)
 
bool operator== (FIntrusiveUnsetOptionalState Tag) const
 
template<typename OtherSetAllocator >
TMAPBASEoperator= (TMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&Other)
 
template<typename OtherSetAllocator >
TMAPBASEoperator= (const TMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &Other)
 

Static Protected Attributes

static constexpr bool bHasIntrusiveUnsetOptionalState = true
 
- Static Protected Attributes inherited from TMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >
static constexpr bool bHasIntrusiveUnsetOptionalState = true
 

Additional Inherited Members

- Public Types inherited from TMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >
typedef TTypeTraits< KeyType >::ConstPointerType KeyConstPointerType
 
typedef TTypeTraits< KeyType >::ConstInitType KeyInitType
 
typedef TTypeTraits< ValueType >::ConstInitType ValueInitType
 
typedef TPair< KeyType, ValueType > ElementType
 
using TRangedForIterator = typename ElementSetType::TRangedForIterator
 
using TRangedForConstIterator = typename ElementSetType::TRangedForConstIterator
 
- Static Public Member Functions inherited from TMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >
static void AppendHash (const FPlatformTypeLayoutParameters &LayoutParams, FSHA1 &Hasher)
 
- Protected Attributes inherited from TMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >
ElementSetType Pairs
 

Detailed Description

template<typename KeyType, typename ValueType, typename SetAllocator, typename KeyFuncs>
class TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >

The base type of sortable maps.

Member Typedef Documentation

◆ IntrusiveUnsetOptionalStateType

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
using TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::IntrusiveUnsetOptionalStateType = TSORTABLEMAPBASE
protected

◆ Super

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
typedef TMAPBASE<KeyType, ValueType, SetAllocator, KeyFuncs> TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::Super
protected

Constructor & Destructor Documentation

◆ TSORTABLEMAPBASE() [1/7]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
constexpr TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::TSORTABLEMAPBASE ( )
constexprprotecteddefault

◆ TSORTABLEMAPBASE() [2/7]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
consteval TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::TSORTABLEMAPBASE ( EConstEval  )
inlineexplicitprotected

◆ TSORTABLEMAPBASE() [3/7]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::TSORTABLEMAPBASE ( TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs > &&  )
protecteddefault

◆ TSORTABLEMAPBASE() [4/7]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::TSORTABLEMAPBASE ( const TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs > &  )
protecteddefault

◆ TSORTABLEMAPBASE() [5/7]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::TSORTABLEMAPBASE ( TSORTABLEMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&  Other)
inlineprotected

Constructor for moving elements from a TMAP with a different SetAllocator

◆ TSORTABLEMAPBASE() [6/7]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::TSORTABLEMAPBASE ( const TSORTABLEMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &  Other)
inlineprotected

Constructor for copying elements from a TMAP with a different SetAllocator

◆ TSORTABLEMAPBASE() [7/7]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::TSORTABLEMAPBASE ( FIntrusiveUnsetOptionalState  Tag)
inlineexplicitprotected

Member Function Documentation

◆ KeySort()

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
UE_FORCEINLINE_HINT void TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::KeySort ( const PREDICATE_CLASS Predicate)
inline

Sorts the pairs array using each pair's Key as the sort criteria, then rebuilds the map's hash. Invoked using "MyMapVar.KeySort( PREDICATE_CLASS() );"

◆ KeyStableSort()

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
UE_FORCEINLINE_HINT void TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::KeyStableSort ( const PREDICATE_CLASS Predicate)
inline

Stable sorts the pairs array using each pair's Key as the sort criteria, then rebuilds the map's hash. Invoked using "MyMapVar.KeySort( PREDICATE_CLASS() );"

◆ operator=() [1/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TSORTABLEMAPBASE & TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( const TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs > &  )
protecteddefault

◆ operator=() [2/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TSORTABLEMAPBASE & TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( const TSORTABLEMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &  Other)
inlineprotected

Assignment operator for copying elements from a TMAP with a different SetAllocator

◆ operator=() [3/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TSORTABLEMAPBASE & TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs > &&  )
protecteddefault

◆ operator=() [4/4]

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
TSORTABLEMAPBASE & TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::operator= ( TSORTABLEMAPBASE< KeyType, ValueType, OtherSetAllocator, KeyFuncs > &&  Other)
inlineprotected

Assignment operator for moving elements from a TMAP with a different SetAllocator

◆ operator==()

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
bool TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::operator== ( FIntrusiveUnsetOptionalState  Tag) const
inlineprotected

◆ SortFreeList()

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
void TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::SortFreeList ( )
inline

Sort the free element list so that subsequent additions will occur in the lowest available TSet index resulting in tighter packing without moving any existing items. Also useful for some types of determinism.

See also
TSparseArray::SortFreeList() for more info.

◆ ValueSort()

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
UE_FORCEINLINE_HINT void TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::ValueSort ( const PREDICATE_CLASS Predicate)
inline

Sorts the pairs array using each pair's Value as the sort criteria, then rebuilds the map's hash. Invoked using "MyMapVar.ValueSort( PREDICATE_CLASS() );"

◆ ValueStableSort()

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
UE_FORCEINLINE_HINT void TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::ValueStableSort ( const PREDICATE_CLASS Predicate)
inline

Stable sorts the pairs array using each pair's Value as the sort criteria, then rebuilds the map's hash. Invoked using "MyMapVar.ValueSort( PREDICATE_CLASS() );"

Member Data Documentation

◆ bHasIntrusiveUnsetOptionalState

template<typename KeyType , typename ValueType , typename SetAllocator , typename KeyFuncs >
constexpr bool TSORTABLEMAPBASE< KeyType, ValueType, SetAllocator, KeyFuncs >::bHasIntrusiveUnsetOptionalState = true
staticconstexprprotected

The documentation for this class was generated from the following file: