Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::ObjectPool< T, N, allowResize > Class Template Reference

#include <ObjectPool.h>

Public Member Functions

 ObjectPool ()
 
template<typename... Args>
PoolHandle allocate (Args... args)
 
void deallocate (PoolHandle handle)
 
PoolHandle registerExisting (T &object)
 
void unregisterExisting (PoolHandle handle)
 
T * find (PoolHandle handle) const
 

Protected Member Functions

PoolHandle registerExistingInternal (T &object, bool retry)
 

Protected Attributes

SharedMutex _poolLock
 
eastl::fixed_vector< PoolHandle, N, allowResize > _ids {}
 
eastl::fixed_vector< T *, N, allowResize > _pool {}
 

Detailed Description

template<typename T, size_t N, bool allowResize>
class Divide::ObjectPool< T, N, allowResize >

Definition at line 42 of file ObjectPool.h.

Constructor & Destructor Documentation

◆ ObjectPool()

template<typename T , size_t N, bool allowResize>
Divide::ObjectPool< T, N, allowResize >::ObjectPool

Definition at line 39 of file ObjectPool.inl.

Member Function Documentation

◆ allocate()

template<typename T , size_t N, bool allowResize>
template<typename... Args>
PoolHandle Divide::ObjectPool< T, N, allowResize >::allocate ( Args...  args)

Definition at line 59 of file ObjectPool.inl.

◆ deallocate()

template<typename T , size_t N, bool allowResize>
void Divide::ObjectPool< T, N, allowResize >::deallocate ( PoolHandle  handle)

Definition at line 66 of file ObjectPool.inl.

◆ find()

template<typename T , size_t N, bool allowResize>
T * Divide::ObjectPool< T, N, allowResize >::find ( PoolHandle  handle) const

Definition at line 46 of file ObjectPool.inl.

◆ registerExisting()

template<typename T , size_t N, bool allowResize>
FORCE_INLINE PoolHandle Divide::ObjectPool< T, N, allowResize >::registerExisting ( T &  object)

Definition at line 77 of file ObjectPool.inl.

◆ registerExistingInternal()

template<typename T , size_t N, bool allowResize>
PoolHandle Divide::ObjectPool< T, N, allowResize >::registerExistingInternal ( T &  object,
bool  retry 
)
protected

Definition at line 84 of file ObjectPool.inl.

◆ unregisterExisting()

template<typename T , size_t N, bool allowResize>
void Divide::ObjectPool< T, N, allowResize >::unregisterExisting ( PoolHandle  handle)

Definition at line 110 of file ObjectPool.inl.

Member Data Documentation

◆ _ids

template<typename T , size_t N, bool allowResize>
eastl::fixed_vector<PoolHandle, N, allowResize> Divide::ObjectPool< T, N, allowResize >::_ids {}
protected

Definition at line 61 of file ObjectPool.h.

◆ _pool

template<typename T , size_t N, bool allowResize>
eastl::fixed_vector<T*, N, allowResize> Divide::ObjectPool< T, N, allowResize >::_pool {}
protected

Definition at line 62 of file ObjectPool.h.

◆ _poolLock

template<typename T , size_t N, bool allowResize>
SharedMutex Divide::ObjectPool< T, N, allowResize >::_poolLock
mutableprotected

Definition at line 59 of file ObjectPool.h.


The documentation for this class was generated from the following files: