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

Protected Types

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

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

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

Friends

class DbSessionObj
 Friend declarations.

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

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 }
void setPtr(DbSessionObj *ptr)
void setType(const DbType &typ)

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 ( ) const
inlineinherited

Validity check (Objy like)

Definition at line 68 of file DbHandleBase.h.

68{ return 0 != m_ptr; }
Description: Definition of the generic database object handle.

◆ open()

DbStatus pool::DbSession::open ( )

Open the session in a given mode.

◆ operator!()

bool pool::DbHandleBase< DbSessionObj >::operator! ( ) const
inlineinherited

Validity check through operator NOT.

Definition at line 63 of file DbHandleBase.h.

63{ return !isValid(); }

◆ operator->()

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

Dereference operator.

Definition at line 60 of file DbHandleBase.h.

60{ 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 }
void switchPtr(DbSessionObj *obj)
Assign transient object properly (including reference counting)
bool copy
Definition calibdata.py:26

◆ 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()

const DbSessionObj * pool::DbHandleBase< DbSessionObj >::ptr ( ) const
inlineinherited

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 ( ) const
inlineinherited

Inquire storage type of the handle.

Definition at line 70 of file DbHandleBase.h.

70{ return m_type; }

◆ 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: