NCBI C++ ToolKit
|
Search Toolkit Book for CResourcePool
General purpose resource pool (standard version, requiring CF to have a default constructor). More...
#include <util/resource_pool.hpp>
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... | |
TPoolList & | GetFreeList () |
Get internal list of free objects. More... | |
const TPoolList & | GetFreeList () const |
Get internal list of free objects. More... | |
Protected Member Functions | |
CResourcePool (const CResourcePool &) | |
CResourcePool & | operator= (const CResourcePool &) |
Protected Member Functions inherited from CResourcePool_Base< Value, CNoLock, CResoursePool_NewClassFactory< Value > > | |
CResourcePool_Base (const CResourcePool_Base &) | |
CResourcePool_Base & | operator= (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... | |
General purpose resource pool (standard version, requiring CF to have a default constructor).
Definition at line 260 of file resource_pool.hpp.