UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TCompactSetBase< Allocator > Class Template Reference

#include <CompactSetBase.h>

Public Types

using AllocatorType = Allocator
 
using SizeType = typename AllocatorType::SizeType
 

Public Member Functions

bool operator== (FIntrusiveUnsetOptionalState Tag) const
 
UE_FORCEINLINE_HINT bool IsEmpty () const
 
UE_FORCEINLINE_HINT int32 Num () const
 
UE_FORCEINLINE_HINT int32 Max () const
 
UE_FORCEINLINE_HINT int32 GetMaxIndex () const
 
UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize (const FCompactSetLayout Layout) const
 

Protected Types

using HashCountType = uint32
 
using ElementAllocatorType = typename AllocatorType::template ForElementType< uint8 >
 

Protected Member Functions

UE_FORCEINLINE_HINT TCompactSetBase ()=default
 
consteval TCompactSetBase (EConstEval)
 
 TCompactSetBase (FIntrusiveUnsetOptionalState Tag)
 
UE_FORCEINLINE_HINT const HashCountTypeGetHashTableMemory (const FCompactSetLayout Layout) const
 
FCompactHashTableView GetHashTableView (const FCompactSetLayout Layout)
 
FConstCompactHashTableView GetConstHashTableView (const FCompactSetLayout Layout) const
 
int32 AllocatorCalculateSlackGrow (int32 NewMaxElements, const FCompactSetLayout &Layout) const
 
void ResizeAllocation (const int32 NewMaxElements, const FCompactSetLayout &Layout)
 
bool ResizeAllocationPreserveData (const int32 NewMaxElements, const FCompactSetLayout &Layout, bool bPreserve=true)
 

Static Protected Member Functions

static UE_FORCEINLINE_HINT constexpr SizeType GetHashCount (uint32 NumElements)
 
static UE_FORCEINLINE_HINT constexpr size_t GetElementsSizeInBytes (uint32 NumElements, const FCompactSetLayout Layout)
 
static UE_FORCEINLINE_HINT constexpr size_t GetTotalMemoryRequiredInBytes (uint32 NumElements, uint32 HashCount, const FCompactSetLayout Layout)
 
static UE_FORCEINLINE_HINT constexpr size_t GetTotalMemoryRequiredInBytes (uint32 NumElements, const FCompactSetLayout Layout)
 
static constexpr SizeType GetMaxElementsForAvailableSpace (size_t TotalBytes, uint32 HashCount, uint32 MinElementCount, const FCompactSetLayout Layout)
 

Protected Attributes

ElementAllocatorType Elements
 
SizeType NumElements = 0
 
SizeType MaxElements = 0
 

Static Protected Attributes

static constexpr size_t HashCountSize = sizeof(HashCountType)
 

Detailed Description

template<typename Allocator>
class TCompactSetBase< Allocator >

Base class for the compact set provides common functionality to manage the data using FCompactSetLayout to describe it

Member Typedef Documentation

◆ AllocatorType

template<typename Allocator >
using TCompactSetBase< Allocator >::AllocatorType = Allocator

◆ ElementAllocatorType

template<typename Allocator >
using TCompactSetBase< Allocator >::ElementAllocatorType = typename AllocatorType::template ForElementType<uint8>
protected

◆ HashCountType

template<typename Allocator >
using TCompactSetBase< Allocator >::HashCountType = uint32
protected

◆ SizeType

template<typename Allocator >
using TCompactSetBase< Allocator >::SizeType = typename AllocatorType::SizeType

Constructor & Destructor Documentation

◆ TCompactSetBase() [1/3]

◆ TCompactSetBase() [2/3]

◆ TCompactSetBase() [3/3]

Member Function Documentation

◆ AllocatorCalculateSlackGrow()

template<typename Allocator >
int32 TCompactSetBase< Allocator >::AllocatorCalculateSlackGrow ( int32  NewMaxElements,
const FCompactSetLayout Layout 
) const
inlineprotected

◆ GetAllocatedSize()

template<typename Allocator >
UE_FORCEINLINE_HINT SIZE_T TCompactSetBase< Allocator >::GetAllocatedSize ( const FCompactSetLayout  Layout) const
inline

Helper function to return the amount of memory allocated by this container Only returns the size of allocations made directly by the container, not the elements themselves.

Returns
number of bytes allocated by this container

◆ GetConstHashTableView()

template<typename Allocator >
FConstCompactHashTableView TCompactSetBase< Allocator >::GetConstHashTableView ( const FCompactSetLayout  Layout) const
inlineprotected

◆ GetElementsSizeInBytes()

template<typename Allocator >
static UE_FORCEINLINE_HINT constexpr size_t TCompactSetBase< Allocator >::GetElementsSizeInBytes ( uint32  NumElements,
const FCompactSetLayout  Layout 
)
inlinestaticconstexprprotected

◆ GetHashCount()

template<typename Allocator >
static UE_FORCEINLINE_HINT constexpr SizeType TCompactSetBase< Allocator >::GetHashCount ( uint32  NumElements)
inlinestaticconstexprprotected

◆ GetHashTableMemory()

template<typename Allocator >
UE_FORCEINLINE_HINT const HashCountType * TCompactSetBase< Allocator >::GetHashTableMemory ( const FCompactSetLayout  Layout) const
inlineprotected

◆ GetHashTableView()

template<typename Allocator >
FCompactHashTableView TCompactSetBase< Allocator >::GetHashTableView ( const FCompactSetLayout  Layout)
inlineprotected

◆ GetMaxElementsForAvailableSpace()

template<typename Allocator >
static constexpr SizeType TCompactSetBase< Allocator >::GetMaxElementsForAvailableSpace ( size_t  TotalBytes,
uint32  HashCount,
uint32  MinElementCount,
const FCompactSetLayout  Layout 
)
inlinestaticconstexprprotected

◆ GetMaxIndex()

template<typename Allocator >
UE_FORCEINLINE_HINT int32 TCompactSetBase< Allocator >::GetMaxIndex ( ) const
inline

Deprecated - unnecessary, keeping this here so TCompactSet can be swapped with TSet without changing code

◆ GetTotalMemoryRequiredInBytes() [1/2]

template<typename Allocator >
static UE_FORCEINLINE_HINT constexpr size_t TCompactSetBase< Allocator >::GetTotalMemoryRequiredInBytes ( uint32  NumElements,
const FCompactSetLayout  Layout 
)
inlinestaticconstexprprotected

◆ GetTotalMemoryRequiredInBytes() [2/2]

template<typename Allocator >
static UE_FORCEINLINE_HINT constexpr size_t TCompactSetBase< Allocator >::GetTotalMemoryRequiredInBytes ( uint32  NumElements,
uint32  HashCount,
const FCompactSetLayout  Layout 
)
inlinestaticconstexprprotected

◆ IsEmpty()

template<typename Allocator >
UE_FORCEINLINE_HINT bool TCompactSetBase< Allocator >::IsEmpty ( ) const
inline

Returns true if the sets is empty and contains no elements.

Returns
True if the set is empty.
See also
Num

◆ Max()

Returns
The number of elements the set can hold before reallocation.

◆ Num()

Returns
the number of elements.

◆ operator==()

template<typename Allocator >
bool TCompactSetBase< Allocator >::operator== ( FIntrusiveUnsetOptionalState  Tag) const
inline

◆ ResizeAllocation()

template<typename Allocator >
void TCompactSetBase< Allocator >::ResizeAllocation ( const int32  NewMaxElements,
const FCompactSetLayout Layout 
)
inlineprotected

◆ ResizeAllocationPreserveData()

template<typename Allocator >
bool TCompactSetBase< Allocator >::ResizeAllocationPreserveData ( const int32  NewMaxElements,
const FCompactSetLayout Layout,
bool  bPreserve = true 
)
inlineprotected

Member Data Documentation

◆ Elements

◆ HashCountSize

template<typename Allocator >
constexpr size_t TCompactSetBase< Allocator >::HashCountSize = sizeof(HashCountType)
staticconstexprprotected

◆ MaxElements

template<typename Allocator >
SizeType TCompactSetBase< Allocator >::MaxElements = 0
protected

◆ NumElements

template<typename Allocator >
SizeType TCompactSetBase< Allocator >::NumElements = 0
protected

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