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
#ifndef STORAGESVC_DBCONNECTION_H
5
#define STORAGESVC_DBCONNECTION_H
6
7
#include <string>
8
9
class
DbDatabaseObj
;
10
18
class
DbConnection
{
19
private
:
21
int
m_refCount
;
23
int
m_type
;
25
std::string
m_name
;
27
DbDatabaseObj
*
m_handle
;
28
public
:
30
DbConnection
(
int
typ,
const
std::string& nam,
DbDatabaseObj
* hdl)
31
:
m_refCount
(0),
m_type
(typ),
m_name
(nam),
m_handle
(hdl) { }
32
33
DbConnection
(
const
DbConnection
& c)
34
:
m_refCount
(0),
m_type
(c.
m_type
),
m_name
(c.
m_name
),
m_handle
(c.
m_handle
){}
35
36
~DbConnection
() =
default
;
37
38
DbConnection
&
operator=
(
const
DbConnection
&) =
delete
;
39
41
int
release
() {
42
int
cnt = --
m_refCount
;
43
if
( 0 >= cnt ) {
44
delete
this
;
45
}
46
return
cnt;
47
}
48
49
int
addRef
() {
return
++
m_refCount
; }
51
DbDatabaseObj
*
handle
() {
return
m_handle
; }
52
const
DbDatabaseObj
*
handle
()
const
{
return
m_handle
; }
54
const
std::string&
name
()
const
{
return
m_name
; }
56
int
type
()
const
{
return
m_type
; }
57
};
58
59
#endif
DbConnection::DbConnection
DbConnection(int typ, const std::string &nam, DbDatabaseObj *hdl)
Constructor with initializing arguments.
Definition
DbConnection.h:30
DbConnection::name
const std::string & name() const
Access Database identifier.
Definition
DbConnection.h:54
DbConnection::m_handle
DbDatabaseObj * m_handle
True handle.
Definition
DbConnection.h:27
DbConnection::m_name
std::string m_name
Name of this connection.
Definition
DbConnection.h:25
DbConnection::addRef
int addRef()
Increase reference count.
Definition
DbConnection.h:49
DbConnection::m_type
int m_type
Connection type.
Definition
DbConnection.h:23
DbConnection::~DbConnection
~DbConnection()=default
Standard destructor.
Definition
MakeReferenceFile.cxx:87
DbConnection::type
int type() const
Access technoliogy type.
Definition
DbConnection.h:56
DbConnection::m_refCount
int m_refCount
Reference count.
Definition
DbConnection.h:21
DbConnection::release
int release()
Release token: Decrease reference count and eventually delete.
Definition
DbConnection.h:41
DbConnection::handle
const DbDatabaseObj * handle() const
Definition
DbConnection.h:52
DbConnection::handle
DbDatabaseObj * handle()
Access object identifier.
Definition
DbConnection.h:51
DbConnection::operator=
DbConnection & operator=(const DbConnection &)=delete
DbConnection::DbConnection
DbConnection(const DbConnection &c)
Copy Constructor.
Definition
DbConnection.h:33
DbDatabaseObj
Description: Technology independent part of a Database object implementation.
Definition
DbDatabaseObj.h:27
Generated on
for ATLAS Offline Software by
1.17.0