ATLAS Offline Software
DbConnection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef STORAGESVC_DBCONNECTION_H
6 #define STORAGESVC_DBCONNECTION_H
7 
9 #include <string>
10 
11 /*
12  * POOL namespace
13  */
14 namespace pool {
15 
16  // Forward declarations
17  class DbDatabase;
18 
31  private:
35  int m_type;
37  std::string m_name;
39  void* m_handle;
40  public:
42  DbConnection(int typ, const std::string& nam, void* hdl)
43  : DatabaseConnection(),
44  m_refCount(0), m_type(typ), m_name(nam), m_handle(hdl) { }
50  virtual ~DbConnection() { }
51 
53 
55  int release() {
56  int cnt = --m_refCount;
57  if ( 0 >= cnt ) {
58  delete this;
59  }
60  return cnt;
61  }
63  int addRef() { return ++m_refCount; }
65  virtual void* handle() { return m_handle; }
66  virtual const void* handle() const { return m_handle; }
68  virtual const std::string& name() const { return m_name; }
70  virtual int type() const { return m_type; }
71  };
72 } // namespace pool
73 
74 #endif
pool::DatabaseConnection
Definition: DatabaseConnection.h:23
pool::DbConnection::release
int release()
Release token: Decrease reference count and eventually delete.
Definition: DbConnection.h:55
pool::DbConnection::handle
virtual void * handle()
Access object identifier.
Definition: DbConnection.h:65
pool::DbConnection::m_name
std::string m_name
Name of this connection.
Definition: DbConnection.h:37
pool
pool namespace
Definition: libname.h:15
pool::DbConnection::DbConnection
DbConnection(const DbConnection &c)
Copy Constructor.
Definition: DbConnection.h:46
DatabaseConnection.h
pool::DbConnection::~DbConnection
virtual ~DbConnection()
Standard destructor.
Definition: DbConnection.h:50
pool::DbConnection::addRef
int addRef()
Increase reference count.
Definition: DbConnection.h:63
pool::DbConnection::m_handle
void * m_handle
True handle.
Definition: DbConnection.h:39
pool::DbConnection::operator=
DbConnection & operator=(const DbConnection &)=delete
pool::DbConnection::type
virtual int type() const
Access technoliogy type.
Definition: DbConnection.h:70
pool::DbConnection::m_type
int m_type
Connection type.
Definition: DbConnection.h:35
pool::DbConnection::DbConnection
DbConnection(int typ, const std::string &nam, void *hdl)
Constructor with initializing arguments.
Definition: DbConnection.h:42
pool::DbConnection::handle
virtual const void * handle() const
Definition: DbConnection.h:66
trigbs_pickEvents.cnt
cnt
Definition: trigbs_pickEvents.py:71
pool::DbConnection::name
virtual const std::string & name() const
Access Database identifier.
Definition: DbConnection.h:68
pool::DbConnection
Definition: DbConnection.h:30
pool::DbConnection::m_refCount
int m_refCount
Reference count.
Definition: DbConnection.h:33
python.compressB64.c
def c
Definition: compressB64.py:93