UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FIndexedHandleManagerBase< TIndexedHandle, TIndexType, TSerialType, bOptimizeHandleReuse > Struct Template Reference

#include <IndexedHandle.h>

+ Inheritance diagram for FIndexedHandleManagerBase< TIndexedHandle, TIndexType, TSerialType, bOptimizeHandleReuse >:

Public Member Functions

 FIndexedHandleManagerBase ()
 
TIndexedHandle GetNextHandle ()
 
bool RemoveHandle (TIndexedHandle IndexedHandle)
 
bool IsValidHandle (TIndexedHandle IndexedHandle) const
 
const TArray< TIndexedHandle > & GetHandles () const
 
int32 CalcNumUsedHandles () const
 
 FIndexedHandleManagerBase (const FIndexedHandleManagerBase &Other)=default
 
FIndexedHandleManagerBaseoperator= (const FIndexedHandleManagerBase &Other)
 
int32 ShrinkHandles ()
 
void Reset ()
 

Protected Types

typedef TArray< TIndexedHandleFHandleArray
 

Protected Attributes

FHandleArray Handles
 
TArray< TIndexTypeFreeHandleIndices
 
uint32 ManagerID = 0
 

Static Protected Attributes

static std::atomic< TSerialTypeSerialNumberCounter = { 0 }
 
static std::atomic< uint32ManagerIDCounter = { 0 }
 

Detailed Description

template<typename TIndexedHandle, typename TIndexType, typename TSerialType, bool bOptimizeHandleReuse = false>
struct FIndexedHandleManagerBase< TIndexedHandle, TIndexType, TSerialType, bOptimizeHandleReuse >

Handle Manager meant for FIndexedHandleBase and FCompactIndexedHandleBase derived classes, handles are given out from a freelist and are zero based and consecutive in nature, so ideal for being used as indices in to arrays. Using bOptimizeHandleReuse performance impact on releasing a handle. Because new handles will always use the smallest index, this will help greatly the compaction code(ShrinkHandles) and reduce the total number of handles. This is very useful when you need to iterate through every valid handles often.

Member Typedef Documentation

◆ FHandleArray

Constructor & Destructor Documentation

◆ FIndexedHandleManagerBase() [1/2]

◆ FIndexedHandleManagerBase() [2/2]

Member Function Documentation

◆ CalcNumUsedHandles()

template<typename TIndexedHandle , typename TIndexType , typename TSerialType , bool bOptimizeHandleReuse = false>
int32 FIndexedHandleManagerBase< TIndexedHandle, TIndexType, TSerialType, bOptimizeHandleReuse >::CalcNumUsedHandles ( ) const
inline

returns the number of used handles, will be greater than or equal to zero

◆ GetHandles()

◆ GetNextHandle()

◆ IsValidHandle()

template<typename TIndexedHandle , typename TIndexType , typename TSerialType , bool bOptimizeHandleReuse = false>
bool FIndexedHandleManagerBase< TIndexedHandle, TIndexType, TSerialType, bOptimizeHandleReuse >::IsValidHandle ( TIndexedHandle  IndexedHandle) const
inline

◆ operator=()

◆ RemoveHandle()

◆ Reset()

◆ ShrinkHandles()

Attempts to shrink the Handles array if there are contiguous free slots at the end of the Array

Returns
the new Num items in the handles array

Member Data Documentation

◆ FreeHandleIndices

◆ Handles

Handles stored as a free list sparse array, Handle entries that are free will have a GetIndex() == INDEX_NONE

◆ ManagerID

◆ ManagerIDCounter

template<typename TIndexedHandle , typename TIndexType , typename TSerialType , bool bOptimizeHandleReuse>
std::atomic< uint32 > FIndexedHandleManagerBase< TIndexedHandle, TIndexType, TSerialType, bOptimizeHandleReuse >::ManagerIDCounter = { 0 }
staticprotected

ID used in non shipping / test builds to ensure the same manager that is used to create handles is also used to remove them

◆ SerialNumberCounter

template<typename TIndexedHandle , typename TIndexType , typename TSerialType , bool bOptimizeHandleReuse>
std::atomic< TSerialType > FIndexedHandleManagerBase< TIndexedHandle, TIndexType, TSerialType, bOptimizeHandleReuse >::SerialNumberCounter = { 0 }
staticprotected

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