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

#include <cPool.h>

Inheritance diagram for GrayLib::cPool< TYPE >:
GrayLib::cPoolBase< cPoolNodeFreeT< TYPE > > GrayLib::cPoolClass< TYPE >

Public Member Functions

 cPool (ITERATE_t nBucketAllocQty=128) noexcept
 
 ~cPool ()
 
bool isPoolUsed () const
 
bool put_BucketAllocQty (ITERATE_t nBucketAllocQty)
 
void FreePool ()
 
TYPEAllocPoolObjectNC ()
 
void FreePoolObjectND (TYPE *pUsed)
 
TYPEAllocPoolObject ()
 
void FreePoolObject (TYPE *pUsed)
 
bool CheckValidPool (UINT_PTR uCheckVal=0) const
 
bool IsInFreeState (const TYPE *pUsedNode) const
 
bool IsInFreeList (const TYPE *pUsedNode) const
 
 UNITTEST_FRIEND (cPool)
 
- Public Member Functions inherited from GrayLib::cPoolBase< cPoolNodeFreeT< TYPE > >
ITERATE_t get_BucketAllocQty () const noexcept
 
ITERATE_t get_AllocQty () const noexcept
 
bool isInPool (const void *pObj) const
 
cPoolBucketAddBucketNew ()
 
void FreeBuckets ()
 

Additional Inherited Members

- Protected Types inherited from GrayLib::cPoolBase< cPoolNodeFreeT< TYPE > >
typedef cArrayStruct< cPoolNodeFreeT< TYPE > > cPoolBucket
 
- Protected Member Functions inherited from GrayLib::cPoolBase< cPoolNodeFreeT< TYPE > >
 cPoolBase (ITERATE_t nBucketAllocQty=128) noexcept
 
- Protected Attributes inherited from GrayLib::cPoolBase< cPoolNodeFreeT< TYPE > >
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::cPool< TYPE >

a clean pool of TYPE object. each allocation gets a new constructor called on the object. ASSUME TYPE is based on IPoolNode

Constructor & Destructor Documentation

◆ cPool()

template<class TYPE >
GrayLib::cPool< TYPE >::cPool ( ITERATE_t  nBucketAllocQty = 128)
inlinenoexcept

◆ ~cPool()

template<class TYPE >
GrayLib::cPool< TYPE >::~cPool ( )
inline

Can't delete the buckets with outstanding used objects?

Member Function Documentation

◆ AllocPoolObject()

template<class TYPE >
TYPE* GrayLib::cPool< TYPE >::AllocPoolObject ( )
inline

Allocate 1 object from the pool. call constructor. overload TYPE new operator use cPoolClass instead. overload this to make specially constructed TYPE types.

◆ AllocPoolObjectNC()

template<class TYPE >
TYPE* GrayLib::cPool< TYPE >::AllocPoolObjectNC ( )
inline

Alloc TYPE object with no constructor.

◆ CheckValidPool()

template<class TYPE >
bool GrayLib::cPool< TYPE >::CheckValidPool ( UINT_PTR  uCheckVal = 0) const
inline

Validate all the objects in the pool and the free list.

◆ FreePool()

template<class TYPE >
void GrayLib::cPool< TYPE >::FreePool ( )
inline

Free all objects in the pool

◆ FreePoolObject()

template<class TYPE >
void GrayLib::cPool< TYPE >::FreePoolObject ( TYPE pUsed)
inline

Free 1 object from the pool. call destructor. overload TYPE delete use cPoolClass instead. destruct TYPE in place

◆ FreePoolObjectND()

template<class TYPE >
void GrayLib::cPool< TYPE >::FreePoolObjectND ( TYPE pUsed)
inline

overload TYPE delete operator to call this instead. ASSUME TYPE destruct already called. does NOT call it again.

◆ IsInFreeList()

template<class TYPE >
bool GrayLib::cPool< TYPE >::IsInFreeList ( const TYPE pUsedNode) const
inline

marginally legal thing to do.

◆ IsInFreeState()

template<class TYPE >
bool GrayLib::cPool< TYPE >::IsInFreeState ( const TYPE pUsedNode) const
inline

◆ isPoolUsed()

template<class TYPE >
bool GrayLib::cPool< TYPE >::isPoolUsed ( ) const
inline

◆ put_BucketAllocQty()

template<class TYPE >
bool GrayLib::cPool< TYPE >::put_BucketAllocQty ( ITERATE_t  nBucketAllocQty)
inline

set how many objects per 'bucket' allocation?

◆ UNITTEST_FRIEND()

template<class TYPE >
GrayLib::cPool< TYPE >::UNITTEST_FRIEND ( cPool< TYPE )

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