ATLAS Offline Software
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
pool::DbSession Class Reference

Db objects: class DbSession. More...

#include <DbSession.h>

Inheritance diagram for pool::DbSession:
Collaboration diagram for pool::DbSession:

Public Member Functions

 DbSession ()
 Constructor. More...
 
 DbSession (const DbSession &copy)
 Copy constructor. More...
 
 DbSession (DbSessionObj *session)
 Object constructor. More...
 
virtual ~DbSession ()
 Standard destructor. More...
 
DbSessionoperator= (const DbSession &copy)
 Assignment operator
More...
 
DbSessionoperator= (const int)
 Assignment operator. More...
 
 DbSession (DbSession &&cp)
 
DbSessionoperator= (DbSession &&cp)
 
int refCount () const
 Access reference counter. More...
 
DbDomainObjfind (const DbType &type)
 Find domain object in session (by technology type) More...
 
DbStatus add (DbDomainObj *dom)
 Add domain to session. More...
 
DbStatus remove (const DbDomainObj *dom)
 Find domain in session. More...
 
DbStatus open ()
 Open the session in a given mode. More...
 
DbStatus close ()
 Close the session. More...
 
IOODatabasedb (const DbType &typ)
 Allow access to the Database implementation. More...
 
DbSessionObjoperator-> ()
 Dereference operator. More...
 
const DbSessionObjoperator-> () const
 
bool operator! () const
 Validity check through operator NOT. More...
 
const DbSessionObjptr () const
 Access to underlying object. More...
 
DbSessionObjptr ()
 
bool isValid () const
 Validity check (Objy like) More...
 
const DbTypetype () const
 Inquire storage type of the handle. More...
 

Protected Types

typedef DbSessionObj _DataType
 Data type definition. More...
 
typedef DbHandleBase< _DataTypeBase
 Data type definition. More...
 

Protected Member Functions

void setType (const DbType &typ)
 Set handle type. More...
 
void setPtr (DbSessionObj *ptr)
 Set data pointer. More...
 

Protected Attributes

DbSessionObjm_ptr
 Data member: Object pointer. Sub-classes need access on re-assignment. More...
 
DbType m_type
 Data member: Technology type. Sub-classes need access on re-assignment. More...
 

Private Member Functions

void switchPtr (DbSessionObj *obj)
 Assign transient object properly (including reference counting) More...
 

Friends

class DbSessionObj
 Friend declarations. More...
 

Detailed Description

Db objects: class DbSession.

Description: Handle managing a DbSessionObj, which allows to access domains and Databasees of a given storage type.

Author
M.Frank
Version
1.0

Definition at line 43 of file DbSession.h.

Member Typedef Documentation

◆ _DataType

typedef DbSessionObj pool::DbHandleBase< DbSessionObj >::_DataType
protectedinherited

Data type definition.

Definition at line 34 of file DbHandleBase.h.

◆ Base

typedef DbHandleBase<_DataType> pool::DbHandleBase< DbSessionObj >::Base
protectedinherited

Data type definition.

Definition at line 36 of file DbHandleBase.h.

Constructor & Destructor Documentation

◆ DbSession() [1/4]

pool::DbSession::DbSession ( )

Constructor.

◆ DbSession() [2/4]

pool::DbSession::DbSession ( const DbSession copy)

Copy constructor.

◆ DbSession() [3/4]

pool::DbSession::DbSession ( DbSessionObj session)

Object constructor.

◆ ~DbSession()

virtual pool::DbSession::~DbSession ( )
virtual

Standard destructor.

◆ DbSession() [4/4]

pool::DbSession::DbSession ( DbSession &&  cp)
inline

Definition at line 72 of file DbSession.h.

73  {
74  setPtr (cp.m_ptr);
75  setType (cp.m_type);
76  cp.setPtr (nullptr);
77  cp.setType(DbType(0));
78  }

Member Function Documentation

◆ add()

DbStatus pool::DbSession::add ( DbDomainObj dom)

Add domain to session.

◆ close()

DbStatus pool::DbSession::close ( )

Close the session.

◆ db()

IOODatabase* pool::DbSession::db ( const DbType typ)

Allow access to the Database implementation.

◆ find()

DbDomainObj* pool::DbSession::find ( const DbType type)

Find domain object in session (by technology type)

◆ isValid()

bool pool::DbHandleBase< DbSessionObj >::isValid
inlineinherited

Validity check (Objy like)

Definition at line 68 of file DbHandleBase.h.

68 { return 0 != m_ptr; }

◆ open()

DbStatus pool::DbSession::open ( )

Open the session in a given mode.

◆ operator!()

bool pool::DbHandleBase< DbSessionObj >::operator!
inlineinherited

Validity check through operator NOT.

Definition at line 63 of file DbHandleBase.h.

63 { return !isValid(); }

◆ operator->() [1/2]

DbSessionObj * pool::DbHandleBase< DbSessionObj >::operator->
inlineinherited

Dereference operator.

Definition at line 60 of file DbHandleBase.h.

60 { return m_ptr; }

◆ operator->() [2/2]

const DbSessionObj * pool::DbHandleBase< DbSessionObj >::operator->
inlineinherited

Definition at line 61 of file DbHandleBase.h.

61 { return m_ptr; }

◆ operator=() [1/3]

DbSession& pool::DbSession::operator= ( const DbSession copy)
inline

Assignment operator

Definition at line 59 of file DbSession.h.

59  {
60  if ( &copy != this ) {
61  switchPtr(copy.m_ptr);
62  }
63  return *this;
64  }

◆ operator=() [2/3]

DbSession& pool::DbSession::operator= ( const int  )
inline

Assignment operator.

Definition at line 66 of file DbSession.h.

66  {
67  switchPtr(0);
68  return *this;
69  }

◆ operator=() [3/3]

DbSession& pool::DbSession::operator= ( DbSession &&  cp)
inline

Definition at line 79 of file DbSession.h.

80  {
81  if (&cp != this) {
82  switchPtr (nullptr);
83  setPtr (cp.m_ptr);
84  setType (cp.m_type);
85  cp.setPtr (nullptr);
86  cp.setType(DbType(0));
87  }
88  return *this;
89  }

◆ ptr() [1/2]

DbSessionObj * pool::DbHandleBase< DbSessionObj >::ptr
inlineinherited

Definition at line 66 of file DbHandleBase.h.

66 { return m_ptr; }

◆ ptr() [2/2]

Access to underlying object.

Definition at line 65 of file DbHandleBase.h.

65 { return m_ptr; }

◆ refCount()

int pool::DbSession::refCount ( ) const

Access reference counter.

◆ remove()

DbStatus pool::DbSession::remove ( const DbDomainObj dom)

Find domain in session.

◆ setPtr()

void pool::DbHandleBase< DbSessionObj >::setPtr ( DbSessionObj ptr)
inlineprotectedinherited

Set data pointer.

Definition at line 56 of file DbHandleBase.h.

56 { m_ptr=ptr; }

◆ setType()

void pool::DbHandleBase< DbSessionObj >::setType ( const DbType typ)
inlineprotectedinherited

Set handle type.

Definition at line 54 of file DbHandleBase.h.

54 { m_type=typ; }

◆ switchPtr()

void pool::DbSession::switchPtr ( DbSessionObj obj)
private

Assign transient object properly (including reference counting)

◆ type()

const DbType& pool::DbHandleBase< DbSessionObj >::type
inlineinherited

Inquire storage type of the handle.

Definition at line 70 of file DbHandleBase.h.

70 { return m_type; }

Friends And Related Function Documentation

◆ DbSessionObj

friend class DbSessionObj
friend

Friend declarations.

Definition at line 45 of file DbSession.h.

Member Data Documentation

◆ m_ptr

DbSessionObj * pool::DbHandleBase< DbSessionObj >::m_ptr
protectedinherited

Data member: Object pointer. Sub-classes need access on re-assignment.

Definition at line 38 of file DbHandleBase.h.

◆ m_type

DbType pool::DbHandleBase< DbSessionObj >::m_type
protectedinherited

Data member: Technology type. Sub-classes need access on re-assignment.

Definition at line 40 of file DbHandleBase.h.


The documentation for this class was generated from the following file:
pool::DbHandleBase< DbSessionObj >::isValid
bool isValid() const
Validity check (Objy like)
Definition: DbHandleBase.h:68
pool::DbHandleBase< DbSessionObj >::setPtr
void setPtr(DbSessionObj *ptr)
Set data pointer.
Definition: DbHandleBase.h:56
pool::DbSession::switchPtr
void switchPtr(DbSessionObj *obj)
Assign transient object properly (including reference counting)
pool::DbHandleBase< DbSessionObj >::m_ptr
DbSessionObj * m_ptr
Data member: Object pointer. Sub-classes need access on re-assignment.
Definition: DbHandleBase.h:38
pool::DbHandleBase< DbSessionObj >::ptr
const DbSessionObj * ptr() const
Access to underlying object.
Definition: DbHandleBase.h:65
pool::DbHandleBase< DbSessionObj >::setType
void setType(const DbType &typ)
Set handle type.
Definition: DbHandleBase.h:54
LArNewCalib_PedestalAutoCorr.cp
cp
Definition: LArNewCalib_PedestalAutoCorr.py:188
calibdata.copy
bool copy
Definition: calibdata.py:26
pool::DbHandleBase< DbSessionObj >::m_type
DbType m_type
Data member: Technology type. Sub-classes need access on re-assignment.
Definition: DbHandleBase.h:40