Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cPoolBase< TYPE > Class Template Reference

#include <cPool.h>

Inheritance diagram for GrayLib::cPoolBase< TYPE >:
GrayLib::cPool< cOctreeNode >

Public Member Functions

ITERATE_t get_BucketAllocQty () const noexcept
 
ITERATE_t get_AllocQty () const noexcept
 
bool isInPool (const void *pObj) const
 
cPoolBucketAddBucketNew ()
 
void FreeBuckets ()
 

Protected Types

typedef cArrayStruct< TYPEcPoolBucket
 

Protected Member Functions

 cPoolBase (ITERATE_t nBucketAllocQty=128) noexcept
 

Protected Attributes

cArrayStruct< cPoolBucketm_aBuckets
 all allocated space. free and used objects. More...
 
ITERATE_t m_nBucketAllocQty
 how many new objects per bucket. More...
 

Detailed Description

template<class TYPE>
class GrayLib::cPoolBase< TYPE >

allocate an array of arrays of TYPE object. do not deal with the free list/queue here. much faster to allocate fixed/free size stuff in a pool than the regular heap.

Member Typedef Documentation

◆ cPoolBucket

template<class TYPE >
typedef cArrayStruct<TYPE> GrayLib::cPoolBase< TYPE >::cPoolBucket
protected

Constructor & Destructor Documentation

◆ cPoolBase()

template<class TYPE >
GrayLib::cPoolBase< TYPE >::cPoolBase ( ITERATE_t  nBucketAllocQty = 128)
inlineprotectednoexcept

nBucketAllocQty = number of items per bucket allocation.

Member Function Documentation

◆ AddBucketNew()

template<class TYPE >
cPoolBucket* GrayLib::cPoolBase< TYPE >::AddBucketNew ( )
inline

Create an array of m_nBucketAllocQty TYPE objects

◆ FreeBuckets()

template<class TYPE >
void GrayLib::cPoolBase< TYPE >::FreeBuckets ( )
inline

Assume all free.

◆ get_AllocQty()

template<class TYPE >
ITERATE_t GrayLib::cPoolBase< TYPE >::get_AllocQty ( ) const
inlinenoexcept

total number of items allocated ASSUME m_nBucketAllocQty is constant.

◆ get_BucketAllocQty()

template<class TYPE >
ITERATE_t GrayLib::cPoolBase< TYPE >::get_BucketAllocQty ( ) const
inlinenoexcept

how many TYPE objects per 'bucket' ?

◆ isInPool()

template<class TYPE >
bool GrayLib::cPoolBase< TYPE >::isInPool ( const void *  pObj) const
inline

Is this object in the pool? brute force search.

Member Data Documentation

◆ m_aBuckets

template<class TYPE >
cArrayStruct<cPoolBucket> GrayLib::cPoolBase< TYPE >::m_aBuckets
protected

all allocated space. free and used objects.

◆ m_nBucketAllocQty

template<class TYPE >
ITERATE_t GrayLib::cPoolBase< TYPE >::m_nBucketAllocQty
protected

how many new objects per bucket.


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