Navigation
API > API/Runtime > API/Runtime/AIModule
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.
| Name | FIndexedHandleManagerBase |
| Type | struct |
| Header File | /Engine/Source/Runtime/AIModule/Public/IndexedHandle.h |
| Include Path | #include "IndexedHandle.h" |
Syntax
template<typename TIndexedHandle, typename TIndexType, typename TSerialType, bool bOptimizeHandleReuse>
struct FIndexedHandleManagerBase
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| IndexedHandle.h | |||
FIndexedHandleManagerBase
(
const FIndexedHandleManagerBase& Other |
Defaulted copy constructor, but it acts differently from the copy assignment operator - notably, doesn't allocate a new ManagerID. | IndexedHandle.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FHandleArray | TArray< TIndexedHandle > | IndexedHandle.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ManagerIDCounter | std::atomic< uint32 > | ID used in non shipping / test builds to ensure the same manager that is used to create handles is also used to remove them | IndexedHandle.h |
| SerialNumberCounter | std::atomic< TSerialType > | IndexedHandle.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 CalcNumUsedHandles() |
Returns the number of used handles, will be greater than or equal to zero | IndexedHandle.h | |
const TArray< TIndexedHandle > & GetHandles() |
IndexedHandle.h | ||
TIndexedHandle GetNextHandle() |
IndexedHandle.h | ||
bool IsValidHandle
(
TIndexedHandle IndexedHandle |
IndexedHandle.h | ||
bool RemoveHandle
(
TIndexedHandle IndexedHandle |
IndexedHandle.h | ||
void Reset() |
IndexedHandle.h | ||
int32 ShrinkHandles() |
Attempts to shrink the Handles array if there are contiguous free slots at the end of the Array | IndexedHandle.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FIndexedHandleManagerBase & operator=
(
const FIndexedHandleManagerBase& Other |
IndexedHandle.h |