Version: 9.16.0
ObjectPool< X > Class Template Reference

#include <ObjectPool.hxx>

Inheritance diagram for ObjectPool< X >:

Public Member Functions

 ObjectPool (int nblk=1024)
 
virtual ~ObjectPool ()
 
X * getNew ()
 
void destroy (X *obj)
 
void clear ()
 
size_t size () const
 
size_t nbElements () const
 
const X * operator[] (size_t i) const
 
const X * at (size_t i) const
 

Private Member Functions

int getNextFree ()
 
void checkDelete (int chunkId)
 

Private Attributes

std::vector< X * > _chunkList
 
std::vector< bool_freeList
 
int _nextFree
 
int _maxAvail
 
int _chunkSize
 
int _maxOccupied
 
int _nbHoles
 
int _lastDelChunk
 

Friends

class ObjectPoolIterator< X >
 

Constructor & Destructor Documentation

◆ ObjectPool()

◆ ~ObjectPool()

template<class X >
virtual ObjectPool< X >::~ObjectPool ( )
virtual

Member Function Documentation

◆ at()

◆ checkDelete()

template<class X >
void ObjectPool< X >::checkDelete ( int  chunkId)
private

◆ clear()

◆ destroy()

◆ getNew()

◆ getNextFree()

◆ nbElements()

template<class X >
size_t ObjectPool< X >::nbElements ( ) const

◆ operator[]()

template<class X >
const X * ObjectPool< X >::operator[] ( size_t  i) const

◆ size()

template<class X >
size_t ObjectPool< X >::size ( ) const

Friends And Related Function Documentation

◆ ObjectPoolIterator< X >

template<class X >
friend class ObjectPoolIterator< X >
friend

Field Documentation

◆ _chunkList

◆ _chunkSize

◆ _freeList

◆ _lastDelChunk

template<class X >
int ObjectPool< X >::_lastDelChunk
private

◆ _maxAvail

◆ _maxOccupied

◆ _nbHoles

◆ _nextFree