NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CDbapiConnMgr Class Reference

Search Toolkit Book for CDbapiConnMgr

CDbapiConnMgr. More...

#include <dbapi/driver/dbapi_driver_conn_mgr.hpp>

+ Collaboration diagram for CDbapiConnMgr:

Public Types

enum  EIfSet { eIfSet_Replace , eIfSet_KeepSilently , eIfSet_KeepAndWarn , eIfSet_KeepAndThrow }
 What to do if a connection factory has already been explicitly registered. More...
 

Public Member Functions

void SetConnectionFactory (IDBConnectionFactory *factory, EIfSet if_set=eIfSet_Replace)
 Set up a connection factory. More...
 
CRef< IDBConnectionFactoryGetConnectionFactory (void) const
 Retrieve a connection factory. More...
 

Static Public Member Functions

static CDbapiConnMgrInstance (void)
 Get access to the class instance. More...
 
static void SetMaxConnect (unsigned int max_connect)
 
static unsigned int GetMaxConnect (void)
 

Private Member Functions

 CDbapiConnMgr (void)
 
 ~CDbapiConnMgr (void)
 
bool AddConnect (void)
 
void DelConnect (void)
 

Private Attributes

CRef< IDBConnectionFactorym_ConnectFactory
 
CFastMutex m_Mutex
 
unsigned int m_NumConnect
 
bool m_HasExplicitConnectionFactory
 

Friends

class CSafeStatic_Allocator< CDbapiConnMgr >
 
class impl::CConnection
 

Detailed Description

CDbapiConnMgr.

Definition at line 123 of file dbapi_driver_conn_mgr.hpp.

Member Enumeration Documentation

◆ EIfSet

What to do if a connection factory has already been explicitly registered.

Enumerator
eIfSet_Replace 

Replace it anyway.

eIfSet_KeepSilently 

Silently keep it.

eIfSet_KeepAndWarn 

Keep it, but issue a warning.

eIfSet_KeepAndThrow 

Keep it and throw an exception.

Definition at line 131 of file dbapi_driver_conn_mgr.hpp.

Constructor & Destructor Documentation

◆ CDbapiConnMgr()

CDbapiConnMgr::CDbapiConnMgr ( void  )
private

Definition at line 130 of file dbapi_driver_conn_mgr.cpp.

References m_ConnectFactory, and CRef< C, Locker >::Reset().

◆ ~CDbapiConnMgr()

CDbapiConnMgr::~CDbapiConnMgr ( void  )
private

Definition at line 136 of file dbapi_driver_conn_mgr.cpp.

Member Function Documentation

◆ AddConnect()

bool CDbapiConnMgr::AddConnect ( void  )
private

Definition at line 188 of file dbapi_driver_conn_mgr.cpp.

References GetMaxConnect(), m_Mutex, and m_NumConnect.

◆ DelConnect()

void CDbapiConnMgr::DelConnect ( void  )
private

Definition at line 199 of file dbapi_driver_conn_mgr.cpp.

References m_Mutex, and m_NumConnect.

Referenced by impl::CConnection::MarkClosed().

◆ GetConnectionFactory()

CRef<IDBConnectionFactory> CDbapiConnMgr::GetConnectionFactory ( void  ) const
inline

Retrieve a connection factory.

Definition at line 143 of file dbapi_driver_conn_mgr.hpp.

References m_ConnectFactory.

Referenced by impl::CDriverContext::MakeConnection(), CSDBAPI::UpdateMirror(), and CDBLBClientApp::x_GetServiceMapper().

◆ GetMaxConnect()

unsigned int CDbapiConnMgr::GetMaxConnect ( void  )
static

Definition at line 183 of file dbapi_driver_conn_mgr.cpp.

Referenced by AddConnect(), and CDriverManager::GetMaxConnect().

◆ Instance()

CDbapiConnMgr & CDbapiConnMgr::Instance ( void  )
static

◆ SetConnectionFactory()

void CDbapiConnMgr::SetConnectionFactory ( IDBConnectionFactory factory,
EIfSet  if_set = eIfSet_Replace 
)

◆ SetMaxConnect()

void CDbapiConnMgr::SetMaxConnect ( unsigned int  max_connect)
static

Friends And Related Function Documentation

◆ CSafeStatic_Allocator< CDbapiConnMgr >

friend class CSafeStatic_Allocator< CDbapiConnMgr >
friend

Definition at line 163 of file dbapi_driver_conn_mgr.hpp.

◆ impl::CConnection

friend class impl::CConnection
friend

Definition at line 167 of file dbapi_driver_conn_mgr.hpp.

Member Data Documentation

◆ m_ConnectFactory

CRef<IDBConnectionFactory> CDbapiConnMgr::m_ConnectFactory
private

◆ m_HasExplicitConnectionFactory

bool CDbapiConnMgr::m_HasExplicitConnectionFactory
private

Definition at line 163 of file dbapi_driver_conn_mgr.hpp.

Referenced by SetConnectionFactory().

◆ m_Mutex

CFastMutex CDbapiConnMgr::m_Mutex
private

Definition at line 161 of file dbapi_driver_conn_mgr.hpp.

Referenced by AddConnect(), DelConnect(), and SetConnectionFactory().

◆ m_NumConnect

unsigned int CDbapiConnMgr::m_NumConnect
private

Definition at line 162 of file dbapi_driver_conn_mgr.hpp.

Referenced by AddConnect(), and DelConnect().


The documentation for this class was generated from the following files:
Modified on Wed Feb 21 09:54:05 2024 by modify_doxy.py rev. 669887