NCBI C++ ToolKit
|
Search Toolkit Book for CGuard
#include <corelib/guard.hpp>
Public Types | |
typedef Resource | resource_type |
typedef resource_type * | resource_ptr |
typedef Lock | lock_type |
typedef Unlock | unlock_type |
typedef CGuard< Resource, Lock, Unlock, ReportExceptions > | TThisType |
Public Types inherited from CGuard_Base | |
enum | EReportExceptions { eReport , eSilent } |
Exception reporting options. More... | |
Public Member Functions | |
CGuard (EEmptyGuard) | |
CGuard (resource_type &resource) | |
This constructor locks the resource passed. More... | |
CGuard (EEmptyGuard, const lock_type &lock, const unlock_type &unlock=unlock_type()) | |
CGuard (resource_type &resource, const lock_type &lock, const unlock_type &unlock=unlock_type()) | |
This constructor locks the resource passed. More... | |
~CGuard () | |
Destructor releases the resource. More... | |
void | Release () |
Manually force the resource to be released. More... | |
void | Guard (resource_type &resource) |
Manually force the guard to protect some other resource. More... | |
Protected Member Functions | |
resource_ptr & | GetResource (void) |
lock_type & | GetLock (void) |
unlock_type & | GetUnlock (void) |
Private Member Functions | |
CGuard (const CGuard< resource_type, lock_type, unlock_type > &) | |
void | operator= (const CGuard< resource_type, lock_type, unlock_type > &) |
Private Attributes | |
pair_base_member< lock_type, pair_base_member< unlock_type, resource_ptr > > | m_Data |
Maintain a pointer to the original resource that is being guarded. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from CGuard_Base | |
static void | ReportException (std::exception &ex) |
typedef resource_type* CGuard< Resource, Lock, Unlock, ReportExceptions >::resource_ptr |
typedef Resource CGuard< Resource, Lock, Unlock, ReportExceptions >::resource_type |
typedef Unlock CGuard< Resource, Lock, Unlock, ReportExceptions >::unlock_type |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
private |
|
inlineprotected |
Definition at line 187 of file guard.hpp.
Referenced by CGuard< IRegistry, SSimpleReadLock< IRegistry > >::Guard().
|
inlineprotected |
Definition at line 183 of file guard.hpp.
Referenced by CGuard< IRegistry, SSimpleReadLock< IRegistry > >::Guard(), and CGuard< IRegistry, SSimpleReadLock< IRegistry > >::Release().
|
inlineprotected |
Definition at line 191 of file guard.hpp.
Referenced by CGuard< IRegistry, SSimpleReadLock< IRegistry > >::Release().
|
inline |
Manually force the guard to protect some other resource.
Definition at line 175 of file guard.hpp.
Referenced by CGuard< IRegistry, SSimpleReadLock< IRegistry > >::CGuard(), CInitGuard::CInitGuard(), CTLibContext::CTLIB_cserr_handler(), CTLibContext::CTLIB_cterr_handler(), CTLibContext::CTLIB_srverr_handler(), CInitGuard::ForceGuard(), CFastLocalTime::GetLocalTime(), CDSAnnotLockReadGuard::Guard(), CDSAnnotLockWriteGuard::Guard(), CThreadPool_Guard::Guard(), CTSE_Default_Assigner::LoadAnnot(), CTSE_Default_Assigner::LoadBioseq(), CTSE_Default_Assigner::LoadChunkBioseqs(), CAsyncDiagThread::Main(), impl::CDriverContext::MakePooledConnection(), CAsyncDiagHandler::Post(), CSafeStaticGuard::x_Cleanup(), CSeq_annot_Finder::x_Find(), CBioseq_Base_Info::x_PrefetchDesc(), impl::CConnection::x_RecordServer(), CAnnot_Collector::x_SearchRange(), CInfoManager::x_WaitForOtherLoader(), and CBlockingQueue< TRequest >::x_WaitForPredicate().
|
private |
|
inline |
Manually force the resource to be released.
Definition at line 166 of file guard.hpp.
Referenced by CObjectManager::AcquireDataLoader(), CObjectManager::AcquireSharedBioseq(), CObjectManager::AcquireSharedSeq_annot(), CObjectManager::AcquireSharedSeq_entry(), CScope_Impl::AddScope(), CFastLocalTime::CFastLocalTime(), CTLibContext::CTLIB_cterr_handler(), CTLibContext::CTLIB_srverr_handler(), CAppJobDispatcher::DeleteJob(), SNetServiceImpl::DiscoverServersIfNeeded(), CwxLogDiagHandler::DoLogRecord(), SNetServerInPool::GetConnectionFromPool(), CBlockingQueue< TRequest >::GetHandle(), CBlockingQueue_ForServer::GetHandle(), CFastLocalTime::GetLocalTime(), CServer_ConnectionPool::GetPollAndTimerVec(), CGuard< IRegistry, SSimpleReadLock< IRegistry > >::Guard(), CMetaRegistry::Load(), CSafeStaticPtr_Base::Lock(), CAsyncDiagThread::Main(), impl::CDriverContext::MakePooledConnection(), CAsyncDiagHandler::Post(), CwxLogDiagHandler::Post(), CPIDGuard::Release(), CTSE_LoadLockGuard::Release(), CThreadPool_Guard::Release(), CObjectManager::ReleaseDataSource(), CObjectManager::RevokeDataLoader(), CAsn2Asn::RunAsn2Asn(), impl::CDriverContext::SatisfyPoolMinimum(), CSafeStatic< CTls< TValue >, CStaticTls_Callbacks< TValue > >::sx_SelfCleanup(), CSafeStaticPtr< T >::sx_SelfCleanup(), CSafeStaticRef< CExtensionRegistry >::sx_SelfCleanup(), CTime::ToTime(), CQueue::TouchClientsRegistry(), CInfoCache_Base::x_AcquireLoadLock(), CInfoManager::x_AcquireLoadLock(), CTime::x_AdjustTimeImmediately(), CWGSDb_Impl::SAmbiguityInfo::x_Calculate4na(), CSafeStaticGuard::x_Cleanup(), CSeq_annot_Finder::x_Find(), CAppJobDispatcher::x_FlushStateEventQueue(), CMetaRegistry::x_Load(), CBioseq_Base_Info::x_PrefetchDesc(), CInitGuard::x_Release(), CScheduler_MT::x_SchedQueueChanged(), CAnnot_Collector::x_SearchRange(), CFastLocalTime::x_Tuneup(), CInfoManager::x_WaitForOtherLoader(), CBlockingQueue< TRequest >::x_WaitForPredicate(), and CGuard< IRegistry, SSimpleReadLock< IRegistry > >::~CGuard().
|
private |
Maintain a pointer to the original resource that is being guarded.
Definition at line 200 of file guard.hpp.
Referenced by CGuard< IRegistry, SSimpleReadLock< IRegistry > >::GetLock(), CGuard< IRegistry, SSimpleReadLock< IRegistry > >::GetResource(), and CGuard< IRegistry, SSimpleReadLock< IRegistry > >::GetUnlock().