ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
APR
StorageSvc
StorageSvc
DbConnection.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef STORAGESVC_DBCONNECTION_H
6
#define STORAGESVC_DBCONNECTION_H
7
8
#include <string>
9
10
/*
11
* POOL namespace
12
*/
13
namespace
pool
{
14
15
class
DbDatabaseObj
;
16
25
class
DbConnection
{
26
private
:
28
int
m_refCount
;
30
int
m_type
;
32
std::string
m_name
;
34
DbDatabaseObj
*
m_handle
;
35
public
:
37
DbConnection
(
int
typ,
const
std::string& nam,
DbDatabaseObj
* hdl)
38
:
m_refCount
(0),
m_type
(typ),
m_name
(nam),
m_handle
(hdl) { }
39
40
DbConnection
(
const
DbConnection
& c)
41
:
m_refCount
(0),
m_type
(c.
m_type
),
m_name
(c.
m_name
),
m_handle
(c.
m_handle
){}
42
43
~DbConnection
() =
default
;
44
45
DbConnection
&
operator=
(
const
DbConnection
&) =
delete
;
46
48
int
release
() {
49
int
cnt = --
m_refCount
;
50
if
( 0 >= cnt ) {
51
delete
this
;
52
}
53
return
cnt;
54
}
55
56
int
addRef
() {
return
++
m_refCount
; }
58
DbDatabaseObj
*
handle
() {
return
m_handle
; }
59
const
DbDatabaseObj
*
handle
()
const
{
return
m_handle
; }
61
const
std::string&
name
()
const
{
return
m_name
; }
63
int
type
()
const
{
return
m_type
; }
64
};
65
}
// namespace pool
66
67
#endif
pool::DbConnection::~DbConnection
~DbConnection()=default
Standard destructor.
pool::DbConnection::m_type
int m_type
Connection type.
Definition
DbConnection.h:30
pool::DbConnection::type
int type() const
Access technoliogy type.
Definition
DbConnection.h:63
pool::DbConnection::m_handle
DbDatabaseObj * m_handle
True handle.
Definition
DbConnection.h:34
pool::DbConnection::m_refCount
int m_refCount
Reference count.
Definition
DbConnection.h:28
pool::DbConnection::DbConnection
DbConnection(const DbConnection &c)
Copy Constructor.
Definition
DbConnection.h:40
pool::DbConnection::handle
DbDatabaseObj * handle()
Access object identifier.
Definition
DbConnection.h:58
pool::DbConnection::DbConnection
DbConnection(int typ, const std::string &nam, DbDatabaseObj *hdl)
Constructor with initializing arguments.
Definition
DbConnection.h:37
pool::DbConnection::operator=
DbConnection & operator=(const DbConnection &)=delete
pool::DbConnection::addRef
int addRef()
Increase reference count.
Definition
DbConnection.h:56
pool::DbConnection::release
int release()
Release token: Decrease reference count and eventually delete.
Definition
DbConnection.h:48
pool::DbConnection::name
const std::string & name() const
Access Database identifier.
Definition
DbConnection.h:61
pool::DbConnection::m_name
std::string m_name
Name of this connection.
Definition
DbConnection.h:32
pool::DbConnection::handle
const DbDatabaseObj * handle() const
Definition
DbConnection.h:59
pool::DbDatabaseObj
Description:
Definition
DbDatabaseObj.h:47
pool
Framework include files.
Definition
libname.h:15
Generated on
for ATLAS Offline Software by
1.17.0