NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Member Functions | List of all members
CResourcePool< Value, Lock, CF > Class Template Reference

Search Toolkit Book for CResourcePool

General purpose resource pool (standard version, requiring CF to have a default constructor). More...

#include <util/resource_pool.hpp>

+ Inheritance diagram for CResourcePool< Value, Lock, CF >:
+ Collaboration diagram for CResourcePool< Value, Lock, CF >:

Public Types

typedef CResourcePool_Base< Value, Lock, CF > TBase
 
typedef TBase::TValue TValue
 
typedef TBase::TLock TLock
 
typedef TBase::TReadLockGuard TReadLockGuard
 
typedef TBase::TWriteLockGuard TWriteLockGuard
 
typedef TBase::TClassFactory TClassFactory
 
typedef TBase::TValuePtr TValuePtr
 
typedef TBase::TPoolList TPoolList
 
- Public Types inherited from CResourcePool_Base< Value, CNoLock, CResoursePool_NewClassFactory< Value > >
typedef Value TValue
 
typedef CNoLock TLock
 
typedef Lock::TReadLockGuard TReadLockGuard
 
typedef Lock::TWriteLockGuard TWriteLockGuard
 
typedef CResoursePool_NewClassFactory< Value > TClassFactory
 
typedef Value * TValuePtr
 
typedef deque< Value * > TPoolList
 

Public Member Functions

 CResourcePool (size_t capacity_upper_limit=0, const TClassFactory &cf=TClassFactory())
 
- Public Member Functions inherited from CResourcePool_Base< Value, CNoLock, CResoursePool_NewClassFactory< Value > >
 CResourcePool_Base (size_t capacity_upper_limit, const TClassFactory &cf)
 Construction. More...
 
 ~CResourcePool_Base ()
 
size_t GetCapacityLimit () const
 Return max pool size. More...
 
void SetCapacityLimit (size_t capacity_upper_limit)
 Set upper limit for pool capacity (everything above this is deleted) More...
 
size_t GetSize () const
 Get current pool size (number of objects in the pool) More...
 
Value * Get ()
 Get object from the pool. More...
 
Value * GetIfAvailable ()
 Get object from the pool if there is a vacancy, otherwise returns NULL. More...
 
void Put (Value *v)
 Put object into the pool. More...
 
void Return (Value *v)
 
Value * Forget (Value *v)
 Makes the pool to forget the object. More...
 
void ForgetAll ()
 Makes pool to forget all objects. More...
 
void FreeAll ()
 Free all pool objects. More...
 
TPoolListGetFreeList ()
 Get internal list of free objects. More...
 
const TPoolListGetFreeList () const
 Get internal list of free objects. More...
 

Protected Member Functions

 CResourcePool (const CResourcePool &)
 
CResourcePooloperator= (const CResourcePool &)
 
- Protected Member Functions inherited from CResourcePool_Base< Value, CNoLock, CResoursePool_NewClassFactory< Value > >
 CResourcePool_Base (const CResourcePool_Base &)
 
CResourcePool_Baseoperator= (const CResourcePool_Base &)
 

Additional Inherited Members

- Protected Attributes inherited from CResourcePool_Base< Value, CNoLock, CResoursePool_NewClassFactory< Value > >
TPoolList m_FreeObjects
 
TLock m_Lock
 
TClassFactory m_CF
 
size_t m_UpperLimit
 Upper limit how much to pool. More...
 

Detailed Description

template<class Value, class Lock = CNoLock, class CF = CResoursePool_NewClassFactory<Value>>
class CResourcePool< Value, Lock, CF >

General purpose resource pool (standard version, requiring CF to have a default constructor).

Definition at line 260 of file resource_pool.hpp.


The documentation for this class was generated from the following file:
Modified on Wed Sep 04 14:59:22 2024 by modify_doxy.py rev. 669887