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

#include <cPool.h>

Inheritance diagram for GrayLib::cPoolClass< TYPE >:
Gray::cSingleton< cPoolClass< TYPE > > GrayLib::cPool< TYPE > Gray::cSingletonStatic< TYPE > Gray::cSingletonRegister GrayLib::cPoolBase< cPoolNodeFreeT< TYPE > > Gray::CObject Gray::cHeapObject Gray::IHeapObject

Protected Member Functions

 cPoolClass (ITERATE_t nBucketAllocQty=128) noexcept
 
 ~cPoolClass ()
 
- Protected Member Functions inherited from Gray::cSingleton< cPoolClass< TYPE > >
 cSingleton (cPoolClass< TYPE > *pObject, const TYPEINFO_t &rAddrCode=typeid(cPoolClass< TYPE >)) noexcept
 
virtual ~cSingleton ()
 
- Protected Member Functions inherited from Gray::cSingletonStatic< TYPE >
 cSingletonStatic (TYPE *pObject) noexcept
 
virtual ~cSingletonStatic () noexcept
 
- Protected Member Functions inherited from Gray::cSingletonRegister
 cSingletonRegister (const TYPEINFO_t &rAddrCode) noexcept
 
virtual ~cSingletonRegister ()
 
void RegisterSingleton ()
 
- Protected Member Functions inherited from Gray::cHeapObject
const void * get_HeapPtr () const noexcept override
 Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More...
 
- Protected Member Functions inherited from GrayLib::cPoolBase< cPoolNodeFreeT< TYPE > >
 cPoolBase (ITERATE_t nBucketAllocQty=128) noexcept
 

Friends

class cSingleton< cPoolClass< TYPE > >
 

Additional Inherited Members

- Public Member Functions inherited from Gray::CObject
virtual ~CObject ()
 
virtual bool isValidCheck () const noexcept
 < memory allocation and structure definitions are valid. More...
 
virtual void AssertValid () const
 < memory allocation and structure definitions are valid. More...
 
virtual void Serialize (cArchive &a)
 
- Public Member Functions inherited from Gray::cHeapObject
 cHeapObject ()
 
virtual ~cHeapObject ()
 
bool IsValidInsideN (INT_PTR index) const
 
bool IsValidInsidePtr (void const *pTest) const
 
virtual size_t GetHeapStatsThis (OUT ITERATE_t &iAllocCount) const
 
virtual bool isValidCheck () const noexcept
 
- Public Member Functions inherited from GrayLib::cPool< TYPE >
 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 ()
 
- Static Public Member Functions inherited from Gray::cSingleton< cPoolClass< TYPE > >
static cPoolClass< TYPE > *__stdcall get_Single ()
 
static TYPE2 *__stdcall get_SingleT ()
 
static cPoolClass< TYPE > &__stdcall I ()
 
- Static Public Member Functions inherited from Gray::cSingletonStatic< TYPE >
static bool isSingleCreated () noexcept
 
static TYPEget_SingleU () noexcept
 
static TYPEget_Single ()
 
template<class TYPE2 >
static TYPE2 *__stdcall get_SingleCast ()
 
static TYPEI () noexcept
 
- Static Public Member Functions inherited from Gray::cSingletonRegister
static void __stdcall ReleaseModule (HMODULE hMod)
 
- Static Public Attributes inherited from Gray::cSingletonRegister
static cThreadLockFast sm_LockSingle
 common lock for all cSingleton. More...
 
- Protected Types inherited from GrayLib::cPoolBase< cPoolNodeFreeT< TYPE > >
typedef cArrayStruct< cPoolNodeFreeT< TYPE > > cPoolBucket
 
- Protected Attributes inherited from Gray::cSingletonRegister
HMODULE m_hModuleLoaded
 What modules loaded this ? So singletons can be destroyed if DLL/SO unloads. More...
 
- 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...
 
- Static Protected Attributes inherited from Gray::cSingletonStatic< TYPE >
static TYPEsm_pThe = nullptr
 pointer to the one and only object of this TYPE. ASSUME automatically init to = nullptr. More...
 

Detailed Description

template<class TYPE>
class GrayLib::cPoolClass< TYPE >

a Singleton pool. declare that a TYPE is only ever allocated from this pool. overload its new/delete operators to use the pool. use with POOL_CLASS_IMPL

Constructor & Destructor Documentation

◆ cPoolClass()

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

◆ ~cPoolClass()

template<class TYPE >
GrayLib::cPoolClass< TYPE >::~cPoolClass ( )
inlineprotected

Friends And Related Function Documentation

◆ cSingleton< cPoolClass< TYPE > >

template<class TYPE >
friend class cSingleton< cPoolClass< TYPE > >
friend

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