ATLAS Offline Software
DbSession.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 // $Id: DbSession.h 726071 2016-02-25 09:23:05Z krasznaa $
6 //====================================================================
7 // DbSession class definition
8 //--------------------------------------------------------------------
9 //
10 // Package : StorageSvc (The POOL project)
11 //
12 // Description: Definition of a Database session and related classes
13 //
14 // @author M.Frank
15 //====================================================================
16 #ifndef POOL_DBSESSION_H
17 #define POOL_DBSESSION_H
18 
19 // Framework include files
20 #include "StorageSvc/DbStatus.h"
22 
23 /*
24  * POOL namespace declaration
25  */
26 namespace pool {
27 
28  // Forward declarations
29  class DbType;
30  class DbDomainObj;
31  class DbSessionObj;
32  class IOODatabase;
33 
43  class DbSession : public DbHandleBase<DbSessionObj> {
45  friend class DbSessionObj;
46  private:
49  public:
57  virtual ~DbSession();
60  if ( &copy != this ) {
61  switchPtr(copy.m_ptr);
62  }
63  return *this;
64  }
66  DbSession& operator=(const int /* null_obj */ ) {
67  switchPtr(0);
68  return *this;
69  }
71  int refCount() const;
83  IOODatabase* db(const DbType& typ);
84  };
85 } // End namespace pool
86 #endif // POOL_DBSESSION_H
pool::DbSession::close
DbStatus close()
Close the session.
pool::DbStatus
Definition: DbStatus.h:67
pool
pool namespace
Definition: libname.h:15
pool::DbSession::~DbSession
virtual ~DbSession()
Standard destructor.
pool::DbSession
Db objects: class DbSession.
Definition: DbSession.h:43
pool::DbDomainObj
Db objects: DbDomainObj.
Definition: DbDomainObj.h:39
pool::DbSession::switchPtr
void switchPtr(DbSessionObj *obj)
Assign transient object properly (including reference counting)
pool::DbHandleBase< DbSessionObj >::type
const DbType & type() const
Inquire storage type of the handle.
Definition: DbHandleBase.h:66
pool::DbSession::DbSession
DbSession(DbSessionObj *session)
Object constructor.
pool::DbSession::find
DbDomainObj * find(const DbType &type)
Find domain object in session (by technology type)
pool::DbType
Definition: DbType.h:31
pool::DbSession::DbSession
DbSession()
Constructor.
pool::DbSession::open
DbStatus open()
Open the session in a given mode.
pool::DbSession::DbSession
DbSession(const DbSession &copy)
Copy constructor.
pool::DbSession::add
DbStatus add(DbDomainObj *dom)
Add domain to session.
pool::DbSession::operator=
DbSession & operator=(const int)
Assignment operator.
Definition: DbSession.h:66
pool::DbSession::remove
DbStatus remove(const DbDomainObj *dom)
Find domain in session.
pool::DbSessionObj
Db objects: DbSessionObj.
Definition: DbSessionObj.h:45
DbHandleBase.h
pool::DbSession::db
IOODatabase * db(const DbType &typ)
Allow access to the Database implementation.
pool::DbHandleBase
Definition: DbHandleBase.h:24
pool::DbSession::operator=
DbSession & operator=(const DbSession &copy)
Assignment operator
Definition: DbSession.h:59
calibdata.copy
bool copy
Definition: calibdata.py:27
python.PyAthena.obj
obj
Definition: PyAthena.py:135
pool::DbSession::refCount
int refCount() const
Access reference counter.
DbStatus.h
pool::IOODatabase
Definition: IOODatabase.h:50