|
using | ObjectType = typename Traits::ObjectType |
| The type of object created and managed by this pool. Must inherit from Object.
|
|
using | ObjectFactoryType = typename Traits::ObjectFactoryType |
| The type of the object factory. An instance of this object.
|
|
using | ObjectFactoryDescriptor = typename ObjectFactoryType::Descriptor |
| The type of the descriptor used to initialize the object factory.
|
|
using | ObjectCollectorType = ObjectCollector< Traits > |
| The type of object collector used by the object pool.
|
|
using | MutexType = typename Traits::MutexType |
|
|
| ObjectPool (ObjectPool &rhs)=delete |
|
void | Init (const Descriptor &descriptor) |
| Initializes the pool to an empty state.
|
|
void | Shutdown () |
| Shutdown the pool. The user must re-initialize to use it again.
|
|
template<typename... Args> |
ObjectType * | Allocate (Args &&... args) |
|
void | DeAllocate (ObjectType *object) |
|
void | DeAllocate (ObjectType *objects, size_t objectCount) |
|
void | DeAllocate (ObjectType **objects, size_t objectCount) |
|
void | Collect () |
| Performs an object collection cycle. Objects which are collected can be reused by Allocate.
|
|
void | CollectForce () |
| Performs an object collection cycle that ignores the collect latency, processing all objects.
|
|
size_t | GetObjectCount () const |
| Returns the total number of objects in the pool.
|
|
const ObjectFactoryType & | GetFactory () const |
|
template<typename Traits>
class AZ::RHI::ObjectPool< Traits >
This class is a simple deferred-release pool allocator for objects. It's useful when objects are being tracked on the GPU timeline, such that they require an N frame latency before being reused. For example: command lists which are being submitted to the GPU each frame. The derived type must inherit from Object.