Navigation
API > API/Runtime > API/Runtime/Engine
A templated pool for resources that can only be freed at a 'safe' point in the frame.
| Name | TResourcePool |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/ResourcePool.h |
| Include Path | #include "ResourcePool.h" |
Syntax
template<typename ResourceType, class ResourcePoolPolicy, class ResourceCreationArguments>
class TResourcePool
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| ResourcePool.h | |||
TResourcePool
(
ResourcePoolPolicy InPolicy |
Constructor with policy argument | ResourcePool.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~TResourcePool() |
Destructor | ResourcePool.h |
Classes
| Name | Remarks |
|---|---|
| FLockScope | A scope that takes a single lock so that individual allocations / deallocations can skip it. |
Structs
| Name | Remarks |
|---|---|
| FPooledResource | Describes a Resource in the free pool. |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bLocked | bool | ResourcePool.h | ||
| CS | UE::FMutex | ResourcePool.h | ||
| LastSafeFrameNumber | uint32 | ResourcePool.h | ||
| Policy | ResourcePoolPolicy | Pooling policy for this resource | ResourcePool.h | |
| ResourceBuckets | TArray< FPooledResource > | Pool of free Resources, indexed by bucket for constant size search time. | ResourcePool.h | |
| SafeResourceBuckets | TArray< FPooledResource > | Resources that have been freed more recently than NumSafeFrames ago. | ResourcePool.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ResourceType CreatePooledResource
(
FRHICommandListBase& RHICmdList, |
Creates a pooled resource. | ResourcePool.h | |
void DrainPool
(
bool bForceDrainAll |
Drain the pool of freed resources that need to be culled or prepared for reuse. | ResourcePool.h | |
uint32 PooledSizeForCreationArguments
(
ResourceCreationArguments Args |
Gets the size a pooled object will use when constructed from the pool. | ResourcePool.h | |
void ReleasePooledResource
(
ResourceType&& Resource |
Release a resource back into the pool. | ResourcePool.h |