API Documentation
PtrPool.h
1 // Pool.h
3 //
5 
6 namespace nkMemory
7 {
13  template <typename T>
14  class PtrPool final
15  {
16  public :
17 
24  PtrPool (UniquePtr<Allocator<T>> allocator = makeUnique<DefaultAllocator<T>>(), UniquePtr<Deallocator<T>> deallocator = makeUnique<DefaultDeallocator<T>>()) noexcept
28  ~PtrPool () ;
29 
33  unsigned long long getPoolSize () const ;
37  unsigned long long getFreeItemsCount () const ;
41  unsigned long long getFlyingItemsCount () const ;
42 
48  T* getObject () ;
54  void releaseObject (T* object) ;
55  } ;
56 }
nkMemory::PtrPool::getPoolSize
unsigned long long getPoolSize() const
nkMemory::PtrPool::getFreeItemsCount
unsigned long long getFreeItemsCount() const
nkMemory::PtrPool::getFlyingItemsCount
unsigned long long getFlyingItemsCount() const
nkMemory::PtrPool::getObject
T * getObject()
nkMemory::Allocator
Interface representing an allocator, supposed to allocate an object when requested.
Definition: Allocator.h:15
nkMemory::DefaultDeallocator
A utility default deallocator using a simple call to delete.
Definition: DefaultDeallocator.h:13
nkMemory::DefaultAllocator
A utility default allocator allocating an object through a simple call to new.
Definition: DefaultAllocator.h:13
nkMemory::UniquePtr
Smart pointer owning the object instance it encapsulates.
Definition: UniquePtr.h:17
nkMemory::PtrPool::PtrPool
PtrPool(UniquePtr< Allocator< T >> allocator=makeUnique< DefaultAllocator< T >>(), UniquePtr< Deallocator< T >> deallocator=makeUnique< DefaultDeallocator< T >>()) noexcept ~PtrPool()
nkMemory::Deallocator
Interface used for deallocating memory.
Definition: Deallocator.h:13
nkMemory::PtrPool::releaseObject
void releaseObject(T *object)
nkMemory::PtrPool
A pool of objects, allocated in the heap and tracked by their pointers.
Definition: PtrPool.h:15
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7