|
Foundation
|
Mutex-protected, dynamically sized object pool with stable object pointers. More...
#include <AtomicPool.hpp>
Public Member Functions | |
| DynamicPool (Allocator *alloc) | |
| DynamicPool (DynamicPool const &)=delete | |
| DynamicPool & | operator= (DynamicPool const &)=delete |
| DynamicPool (DynamicPool &&)=delete | |
| DynamicPool & | operator= (DynamicPool &&)=delete |
| template<typename... Args> | |
| T * | Construct (Args &&... args) |
| Constructs an object of type T in the pool with the given arguments. | |
| void | Destruct (T *ptr) |
| Destructs the object pointed to by ptr and releases its storage. | |
| void | Collect () |
| Destructs all allocated objects in the pool. | |
| size_t | Size () const |
| ~DynamicPool () | |
Private Attributes | |
| Allocator * | mAllocator |
| List< T > | mObjects |
| Mutex | mMutex |
Mutex-protected, dynamically sized object pool with stable object pointers.
|
inlineexplicit |
|
delete |
|
delete |
|
inline |
|
inline |
Destructs all allocated objects in the pool.
|
inline |
Constructs an object of type T in the pool with the given arguments.
delete to free the returned pointer as it is managed by the pool. The destructor of T should NOT be manually called - handle both with Destruct. Destructs the object pointed to by ptr and releases its storage.
|
delete |
|
delete |
|
inline |
|
private |
|
mutableprivate |