#include <CeresEngine/Foundation/Container/ObjectPool.hpp>
◆ ObjectPool() [1/3]
Create an object pool with chunkSize objects.
Whenever the object pool runs out of objects, chunkSize more objects will be added to the pool. The pool only grows: objects are never removed from the pool (freed), until the pool is destroyed.
Throws invalid_argument if chunkSize is <= 0.
◆ ObjectPool() [2/3]
◆ ObjectPool() [3/3]
◆ ~ObjectPool()
Frees all the allocated objects.
Invalidates any objects that have been acquired for use.
◆ allocate()
template<typename... Args>
Reserve an object for use.
The reference to the object is invalidated if the object pool itself is freed.
Clients must not free the object!
- Returns
- A pointer to the allocated object
◆ allocateChunk()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ release()
Return the object to the pool.
Clients must not use the object after it has been returned to the pool.
- Parameters
-
| obj | A pointer to the object being released |
◆ defaultChunkSize
The default allocation chunk size.
◆ mAllObjects
◆ mAllocator
The allocator used to allocate memory for objects.
◆ mChunkSize
◆ mFreeList
The documentation for this class was generated from the following file:
- /Users/Rogiel/Developer/CeresEngine/Engine/Sources/CeresEngine/Foundation/Container/ObjectPool.hpp