ATLAS Offline Software
Loading...
Searching...
No Matches
pool::DbConnection Class Reference

Definition of the DbConnection class. More...

#include <StorageSvc/DbConnection.h>

Collaboration diagram for pool::DbConnection:

Public Member Functions

 DbConnection (int typ, const std::string &nam, DbDatabaseObj *hdl)
 Constructor with initializing arguments.
 DbConnection (const DbConnection &c)
 Copy Constructor.
 ~DbConnection ()=default
 Standard destructor.
DbConnectionoperator= (const DbConnection &)=delete
int release ()
 Release token: Decrease reference count and eventually delete.
int addRef ()
 Increase reference count.
DbDatabaseObjhandle ()
 Access object identifier.
const DbDatabaseObjhandle () const
const std::string & name () const
 Access Database identifier.
int type () const
 Access technoliogy type.

Private Attributes

int m_refCount
 Reference count.
int m_type
 Connection type.
std::string m_name
 Name of this connection.
DbDatabaseObjm_handle
 True handle.

Detailed Description

Definition of the DbConnection class.

The connection holds data specific to dealing with one type of Database.

Author
: M.Frank
Version
1.0

Definition at line 25 of file DbConnection.h.

Constructor & Destructor Documentation

◆ DbConnection() [1/2]

pool::DbConnection::DbConnection ( int typ,
const std::string & nam,
DbDatabaseObj * hdl )
inline

Constructor with initializing arguments.

Definition at line 37 of file DbConnection.h.

38 : m_refCount(0), m_type(typ), m_name(nam), m_handle(hdl) { }
int m_type
Connection type.
DbDatabaseObj * m_handle
True handle.
int m_refCount
Reference count.
std::string m_name
Name of this connection.

◆ DbConnection() [2/2]

pool::DbConnection::DbConnection ( const DbConnection & c)
inline

Copy Constructor.

Definition at line 40 of file DbConnection.h.

41 : m_refCount(0), m_type(c.m_type), m_name(c.m_name), m_handle(c.m_handle){}

◆ ~DbConnection()

pool::DbConnection::~DbConnection ( )
default

Standard destructor.

Member Function Documentation

◆ addRef()

int pool::DbConnection::addRef ( )
inline

Increase reference count.

Definition at line 56 of file DbConnection.h.

56{ return ++m_refCount; }

◆ handle() [1/2]

DbDatabaseObj * pool::DbConnection::handle ( )
inline

Access object identifier.

Definition at line 58 of file DbConnection.h.

58{ return m_handle; }

◆ handle() [2/2]

const DbDatabaseObj * pool::DbConnection::handle ( ) const
inline

Definition at line 59 of file DbConnection.h.

59{ return m_handle; }

◆ name()

const std::string & pool::DbConnection::name ( ) const
inline

Access Database identifier.

Definition at line 61 of file DbConnection.h.

61{ return m_name; }

◆ operator=()

DbConnection & pool::DbConnection::operator= ( const DbConnection & )
delete

◆ release()

int pool::DbConnection::release ( )
inline

Release token: Decrease reference count and eventually delete.

Definition at line 48 of file DbConnection.h.

48 {
49 int cnt = --m_refCount;
50 if ( 0 >= cnt ) {
51 delete this;
52 }
53 return cnt;
54 }

◆ type()

int pool::DbConnection::type ( ) const
inline

Access technoliogy type.

Definition at line 63 of file DbConnection.h.

63{ return m_type; }

Member Data Documentation

◆ m_handle

DbDatabaseObj* pool::DbConnection::m_handle
private

True handle.

Definition at line 34 of file DbConnection.h.

◆ m_name

std::string pool::DbConnection::m_name
private

Name of this connection.

Definition at line 32 of file DbConnection.h.

◆ m_refCount

int pool::DbConnection::m_refCount
private

Reference count.

Definition at line 28 of file DbConnection.h.

◆ m_type

int pool::DbConnection::m_type
private

Connection type.

Definition at line 30 of file DbConnection.h.


The documentation for this class was generated from the following file: