NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
CInfoCache_Base Class Referenceabstract

Search Toolkit Book for CInfoCache_Base

#include <objtools/data_loaders/genbank/impl/info_cache.hpp>

+ Inheritance diagram for CInfoCache_Base:
+ Collaboration diagram for CInfoCache_Base:

Public Types

enum  { kDefaultMaxSize = 10240 }
 

Public Member Functions

 CInfoCache_Base (CInfoManager::TMainMutex &mutex)
 
 CInfoCache_Base (CInfoManager::TMainMutex &mutex, size_t max_size)
 
virtual ~CInfoCache_Base (void)
 
size_t GetMaxGCQueueSize (void) const
 
void SetMaxGCQueueSize (size_t max_size)
 

Protected Types

typedef CInfoManager::TMainMutex TMainMutex
 
typedef CMutex TCacheMutex
 
typedef CInfo_Base::TGCQueue TGCQueue
 

Protected Member Functions

void x_SetInfo (CInfoLock_Base &lock, CInfoRequestor &requestor, CInfo_Base &info)
 
void x_AcquireLoadLock (TCacheMutex::TWriteLockGuard &guard, CInfoRequestorLock &lock, EDoNotWait do_not_wait)
 
void x_AcquireLoadLock (TMainMutex::TWriteLockGuard &guard, CInfoLock_Base &lock, EDoNotWait do_not_wait)
 
bool x_Check (const vector< const CInfo_Base * > &infos) const
 
void ReleaseInfos (const vector< CInfo_Base * > &infos)
 
void x_SetUsed (CInfo_Base &info)
 
void x_SetUnused (CInfo_Base &info)
 
void x_RemoveFromGCQueue (CInfo_Base &info)
 
void x_AddToGCQueue (CInfo_Base &info)
 
void x_GC (void)
 
virtual void x_ForgetInfo (CInfo_Base &info)=0
 

Protected Attributes

TCacheMutex m_CacheMutex
 
size_t m_MaxGCQueueSize
 
size_t m_MinGCQueueSize
 
size_t m_CurGCQueueSize
 
TGCQueue m_GCQueue
 

Friends

class CInfoLock_Base
 
class CInfoManager
 
class CInfoRequestor
 

Additional Inherited Members

- Private Member Functions inherited from INoCopying
 INoCopying ()
 

Detailed Description

Definition at line 427 of file info_cache.hpp.

Member Typedef Documentation

◆ TCacheMutex

Definition at line 455 of file info_cache.hpp.

◆ TGCQueue

Definition at line 502 of file info_cache.hpp.

◆ TMainMutex

Definition at line 450 of file info_cache.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kDefaultMaxSize 

Definition at line 430 of file info_cache.hpp.

Constructor & Destructor Documentation

◆ CInfoCache_Base() [1/2]

CInfoCache_Base::CInfoCache_Base ( CInfoManager::TMainMutex mutex)
explicit

Definition at line 374 of file info_cache.cpp.

References kDefaultMaxSize, and SetMaxGCQueueSize().

◆ CInfoCache_Base() [2/2]

CInfoCache_Base::CInfoCache_Base ( CInfoManager::TMainMutex mutex,
size_t  max_size 
)

Definition at line 381 of file info_cache.cpp.

References SetMaxGCQueueSize().

◆ ~CInfoCache_Base()

CInfoCache_Base::~CInfoCache_Base ( void  )
virtual

Definition at line 391 of file info_cache.cpp.

Member Function Documentation

◆ GetMaxGCQueueSize()

size_t CInfoCache_Base::GetMaxGCQueueSize ( void  ) const
inline

Definition at line 438 of file info_cache.hpp.

References m_MaxGCQueueSize.

◆ ReleaseInfos()

void CInfoCache_Base::ReleaseInfos ( const vector< CInfo_Base * > &  infos)
protected

Definition at line 480 of file info_cache.cpp.

References ITERATE, m_CacheMutex, and x_SetUnused().

◆ SetMaxGCQueueSize()

void CInfoCache_Base::SetMaxGCQueueSize ( size_t  max_size)

Definition at line 412 of file info_cache.cpp.

References m_CacheMutex, m_CurGCQueueSize, m_MaxGCQueueSize, m_MinGCQueueSize, and x_GC().

Referenced by CInfoCache_Base().

◆ x_AcquireLoadLock() [1/2]

void CInfoCache_Base::x_AcquireLoadLock ( TCacheMutex::TWriteLockGuard guard,
CInfoRequestorLock lock,
EDoNotWait  do_not_wait 
)
inlineprotected

◆ x_AcquireLoadLock() [2/2]

void CInfoCache_Base::x_AcquireLoadLock ( TMainMutex::TWriteLockGuard guard,
CInfoLock_Base lock,
EDoNotWait  do_not_wait 
)
inlineprotected

Definition at line 481 of file info_cache.hpp.

References CInfoLock_Base::m_Lock, and x_AcquireLoadLock().

◆ x_AddToGCQueue()

void CInfoCache_Base::x_AddToGCQueue ( CInfo_Base info)
inlineprotected

Definition at line 435 of file info_cache.cpp.

References _ASSERT, info, m_CurGCQueueSize, m_GCQueue, m_MaxGCQueueSize, Ref(), x_ForgetInfo(), and x_GC().

Referenced by x_SetUnused().

◆ x_Check()

bool CInfoCache_Base::x_Check ( const vector< const CInfo_Base * > &  infos) const
protected

Definition at line 396 of file info_cache.cpp.

References _ASSERT, info, ITERATE, and m_CurGCQueueSize.

Referenced by CInfoCache< KeyType, DataType >::x_Check().

◆ x_ForgetInfo()

virtual void CInfoCache_Base::x_ForgetInfo ( CInfo_Base info)
protectedpure virtual

Implemented in CInfoCache< KeyType, DataType >.

Referenced by x_AddToGCQueue(), and x_GC().

◆ x_GC()

void CInfoCache_Base::x_GC ( void  )
protected

◆ x_RemoveFromGCQueue()

void CInfoCache_Base::x_RemoveFromGCQueue ( CInfo_Base info)
inlineprotected

Definition at line 424 of file info_cache.cpp.

References _ASSERT, info, m_CurGCQueueSize, and m_GCQueue.

Referenced by x_GC(), and x_SetUsed().

◆ x_SetInfo()

void CInfoCache_Base::x_SetInfo ( CInfoLock_Base lock,
CInfoRequestor requestor,
CInfo_Base info 
)
protected

◆ x_SetUnused()

void CInfoCache_Base::x_SetUnused ( CInfo_Base info)
inlineprotected

Definition at line 463 of file info_cache.cpp.

References _ASSERT, info, and x_AddToGCQueue().

Referenced by ReleaseInfos().

◆ x_SetUsed()

void CInfoCache_Base::x_SetUsed ( CInfo_Base info)
inlineprotected

Definition at line 453 of file info_cache.cpp.

References _ASSERT, info, m_GCQueue, and x_RemoveFromGCQueue().

Referenced by CInfoRequestor::x_GetLock().

Friends And Related Function Documentation

◆ CInfoLock_Base

friend class CInfoLock_Base
friend

Definition at line 446 of file info_cache.hpp.

◆ CInfoManager

friend class CInfoManager
friend

Definition at line 447 of file info_cache.hpp.

◆ CInfoRequestor

friend class CInfoRequestor
friend

Definition at line 448 of file info_cache.hpp.

Member Data Documentation

◆ m_CacheMutex

TCacheMutex CInfoCache_Base::m_CacheMutex
protected

◆ m_CurGCQueueSize

size_t CInfoCache_Base::m_CurGCQueueSize
protected

Definition at line 504 of file info_cache.hpp.

Referenced by SetMaxGCQueueSize(), x_AddToGCQueue(), x_Check(), x_GC(), and x_RemoveFromGCQueue().

◆ m_GCQueue

TGCQueue CInfoCache_Base::m_GCQueue
protected

◆ m_MaxGCQueueSize

size_t CInfoCache_Base::m_MaxGCQueueSize
protected

Definition at line 504 of file info_cache.hpp.

Referenced by GetMaxGCQueueSize(), SetMaxGCQueueSize(), and x_AddToGCQueue().

◆ m_MinGCQueueSize

size_t CInfoCache_Base::m_MinGCQueueSize
protected

Definition at line 504 of file info_cache.hpp.

Referenced by SetMaxGCQueueSize(), and x_GC().


The documentation for this class was generated from the following files:
Modified on Wed May 22 11:29:32 2024 by modify_doxy.py rev. 669887