UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TSetKeyFuncs< ElementType, KeyFuncsType > Class Template Reference

#include <SetKeyFuncs.h>

Classes

struct  FIterationSentinel
 
struct  FIterator
 

Public Member Functions

 TSetKeyFuncs (KeyFuncsType KeyFuncs, int32 ExpectedNumElements=0)
 
 TSetKeyFuncs (const TSetKeyFuncs< ElementType, KeyFuncsType > &Other)
 
 TSetKeyFuncs (TSetKeyFuncs< ElementType, KeyFuncsType > &&Other)
 
TSetKeyFuncsoperator= (const TSetKeyFuncs< ElementType, KeyFuncsType > &Other)
 
TSetKeyFuncsoperator= (TSetKeyFuncs< ElementType, KeyFuncsType > &&Other)
 
 ~TSetKeyFuncs ()
 
void SetKeyFuncs (KeyFuncsType KeyFuncs)
 
void Reset ()
 
void Empty (int32 ExpectedNumElements=0)
 
void Reserve (int32 ExpectedNumElements)
 
void ResizeToTargetSize ()
 
int32 Num () const
 
SIZE_T GetAllocatedSize () const
 
FSetKeyFuncsStats GetStats () const
 
template<typename CompareType >
const ElementType * Find (const CompareType &Key) const
 
template<typename CompareType >
const ElementType * FindByHash (uint32 TypeHash, const CompareType &Key) const
 
void Add (ElementType Value, bool *bAlreadyExists=nullptr)
 
void AddByHash (uint32 TypeHash, ElementType Value, bool *bAlreadyExists=nullptr)
 
int32 Remove (const ElementType &Value)
 
int32 RemoveByHash (uint32 TypeHash, const ElementType &Value)
 

Friends

FIterator begin (const TSetKeyFuncs< ElementType, KeyFuncsType > &Set)
 
FIterationSentinel end (const TSetKeyFuncs< ElementType, KeyFuncsType > &Set)
 

Detailed Description

template<typename ElementType, typename KeyFuncsType>
class TSetKeyFuncs< ElementType, KeyFuncsType >

Replacement for TSet that takes an instance of KeyFuncs rather than static functions on KeyFuncs.

KeyFuncs must support: struct KeyFuncs { ~KeyFuncs(); KeyFuncs(KeyFuncs&& Other); // Used in constructor and SetKeyFuncs KeyFuncs& operator=(const KeyFuncs& Other); // Used in TSetKeyFuncs operator=(const TSetKeyFuncs&) KeyFuncs& operator=(KeyFuncs&& Other); // Used in TSetKeyFuncs operator=(TSetKeyFuncs&&)

// Functions needed for ElementType ElementType GetInvalidElement(); bool IsInvalid(const ElementType&); uint32 GetTypeHash(const ElementType&); bool Matches(const ElementType& Element, const ElementType& Comparison);

// Functions needed for each ComparisonType passed into Find bool Matches(const ElementType& Element, const ComparisonType& Comparison); uint32 GetTypeHash(const ComparisonType&); };

ElementType must support: ElementType(const ElementType& Other) ElementType(ElementType&& Other)

Constructor & Destructor Documentation

◆ TSetKeyFuncs() [1/3]

template<typename ElementType , typename KeyFuncsType >
TSetKeyFuncs< ElementType, KeyFuncsType >::TSetKeyFuncs ( KeyFuncsType  KeyFuncs,
int32  ExpectedNumElements = 0 
)
inline

◆ TSetKeyFuncs() [2/3]

template<typename ElementType , typename KeyFuncsType >
TSetKeyFuncs< ElementType, KeyFuncsType >::TSetKeyFuncs ( const TSetKeyFuncs< ElementType, KeyFuncsType > &  Other)
inline

◆ TSetKeyFuncs() [3/3]

template<typename ElementType , typename KeyFuncsType >
TSetKeyFuncs< ElementType, KeyFuncsType >::TSetKeyFuncs ( TSetKeyFuncs< ElementType, KeyFuncsType > &&  Other)
inline

◆ ~TSetKeyFuncs()

template<typename ElementType , typename KeyFuncsType >
TSetKeyFuncs< ElementType, KeyFuncsType >::~TSetKeyFuncs ( )
inline

Member Function Documentation

◆ Add()

template<typename ElementType , typename KeyFuncsType >
void TSetKeyFuncs< ElementType, KeyFuncsType >::Add ( ElementType  Value,
bool bAlreadyExists = nullptr 
)
inline

◆ AddByHash()

template<typename ElementType , typename KeyFuncsType >
void TSetKeyFuncs< ElementType, KeyFuncsType >::AddByHash ( uint32  TypeHash,
ElementType  Value,
bool bAlreadyExists = nullptr 
)
inline

◆ Empty()

template<typename ElementType , typename KeyFuncsType >
void TSetKeyFuncs< ElementType, KeyFuncsType >::Empty ( int32  ExpectedNumElements = 0)
inline

◆ Find()

template<typename ElementType , typename KeyFuncsType >
template<typename CompareType >
const ElementType * TSetKeyFuncs< ElementType, KeyFuncsType >::Find ( const CompareType &  Key) const

◆ FindByHash()

template<typename ElementType , typename KeyFuncsType >
template<typename CompareType >
const ElementType * TSetKeyFuncs< ElementType, KeyFuncsType >::FindByHash ( uint32  TypeHash,
const CompareType &  Key 
) const

◆ GetAllocatedSize()

template<typename ElementType , typename KeyFuncsType >
SIZE_T TSetKeyFuncs< ElementType, KeyFuncsType >::GetAllocatedSize ( ) const
inline

◆ GetStats()

template<typename ElementType , typename KeyFuncsType >
FSetKeyFuncsStats TSetKeyFuncs< ElementType, KeyFuncsType >::GetStats ( ) const
inline

◆ Num()

template<typename ElementType , typename KeyFuncsType >
int32 TSetKeyFuncs< ElementType, KeyFuncsType >::Num ( ) const
inline

◆ operator=() [1/2]

template<typename ElementType , typename KeyFuncsType >
TSetKeyFuncs< ElementType, KeyFuncsType > & TSetKeyFuncs< ElementType, KeyFuncsType >::operator= ( const TSetKeyFuncs< ElementType, KeyFuncsType > &  Other)
inline

◆ operator=() [2/2]

template<typename ElementType , typename KeyFuncsType >
TSetKeyFuncs< ElementType, KeyFuncsType > & TSetKeyFuncs< ElementType, KeyFuncsType >::operator= ( TSetKeyFuncs< ElementType, KeyFuncsType > &&  Other)
inline

◆ Remove()

template<typename ElementType , typename KeyFuncsType >
int32 TSetKeyFuncs< ElementType, KeyFuncsType >::Remove ( const ElementType &  Value)
inline

◆ RemoveByHash()

template<typename ElementType , typename KeyFuncsType >
int32 TSetKeyFuncs< ElementType, KeyFuncsType >::RemoveByHash ( uint32  TypeHash,
const ElementType &  Value 
)
inline

◆ Reserve()

template<typename ElementType , typename KeyFuncsType >
void TSetKeyFuncs< ElementType, KeyFuncsType >::Reserve ( int32  ExpectedNumElements)
inline

◆ Reset()

template<typename ElementType , typename KeyFuncsType >
void TSetKeyFuncs< ElementType, KeyFuncsType >::Reset ( )
inline

◆ ResizeToTargetSize()

template<typename ElementType , typename KeyFuncsType >
void TSetKeyFuncs< ElementType, KeyFuncsType >::ResizeToTargetSize ( )
inline

Shrinks or grows the container to be equal in size to our target hardcoded loadfactor (HashSize == NumValues/TargetLoadFactor).

◆ SetKeyFuncs()

template<typename ElementType , typename KeyFuncsType >
void TSetKeyFuncs< ElementType, KeyFuncsType >::SetKeyFuncs ( KeyFuncsType  KeyFuncs)
inline

Friends And Related Symbol Documentation

◆ begin

template<typename ElementType , typename KeyFuncsType >
FIterator begin ( const TSetKeyFuncs< ElementType, KeyFuncsType > &  Set)
friend

◆ end

template<typename ElementType , typename KeyFuncsType >
FIterationSentinel end ( const TSetKeyFuncs< ElementType, KeyFuncsType > &  Set)
friend

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