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

#include <StorageSvc/DbDomain.h>

Inheritance diagram for pool::DbDomain:
Collaboration diagram for pool::DbDomain:

Public Member Functions

 DbDomain (DbDomainObj *dom)
 Friend's constructor. More...
 
 DbDomain (const DbType &type)
 Constructor using Db type. More...
 
 DbDomain (const DbDomain &copy)
 Copy constructor. More...
 
virtual ~DbDomain ()
 Standard destructor. More...
 
DbDomainoperator= (const DbDomain &copy)
 Assignment operator. More...
 
DbDomainoperator= (const int)
 Assignment operator to reset handel easily using 0. More...
 
const std::string & name () const
 Acces to the domain name. More...
 
int refCount () const
 Access reference counter. More...
 
bool exist (DbSession &sesH, int technology) const
 Check for the existence of a domain within a session. More...
 
DbStatus open (DbSession &sesH, const DbType &technology, DbAccessMode mod=pool::READ)
 Open domain within a session environment. More...
 
DbStatus close ()
 Close domain. More...
 
DbAccessMode openMode () const
 Access to access mode. More...
 
DbSession containedIn () const
 Access to session handle. More...
 
bool existsDbase (const std::string &db_name)
 Check if Database exists within the domain. More...
 
const DbDatabaseObjfind (const std::string &db_name) const
 Find Database in domain. More...
 
DbDatabaseObjfind (const std::string &db_name)
 
DbStatus add (const std::string &nam, DbDatabaseObj *db)
 Add domain to session. More...
 
DbStatus remove (DbDatabaseObj *db)
 Find domain in session. More...
 
DbStatus ageOpenDbs ()
 Increase the age of all open databases. More...
 
DbStatus closeAgedDbs ()
 Check if databases are present, which aged a lot and need to be closed. More...
 
void setAgeLimit (int value)
 Set the maximal allowed age limit for files in this domain. More...
 
int ageLimit () const
 Access the maximal age limit. More...
 
IDbDomaininfo ()
 Let the implementation access the internals. More...
 
const IDbDomaininfo () const
 
DbStatus setOption (const DbOption &refOpt)
 Set domain specific options. More...
 
DbStatus getOption (DbOption &refOpt) const
 Access domain specific options. More...
 
IOODatabasedb ()
 Allow access to the Database implementation. More...
 
const IOODatabasedb () const
 
T * operator-> ()
 Dereference operator. More...
 
const T * operator-> () const
 
bool operator! () const
 Validity check through operator NOT. More...
 
const T * ptr () const
 Access to underlying object. More...
 
T * ptr ()
 
bool isValid () const
 Validity check (Objy like) More...
 
const DbTypetype () const
 Inquire storage type of the handle. More...
 

Protected Types

typedef T _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 (T *ptr)
 Set data pointer. More...
 

Protected Attributes

T * m_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 (DbDomainObj *obj)
 Assign transient object properly (including reference counting) More...
 

Friends

class DbDomainObj
 Friend declarations. More...
 

Detailed Description

Description:

Handle managing a DbDomainObj, a generic Database domain object.

Author
M.Frank
Version
1.0

Definition at line 47 of file DbDomain.h.

Member Typedef Documentation

◆ _DataType

typedef T pool::DbHandleBase::_DataType
protectedinherited

Data type definition.

Definition at line 37 of file DbHandleBase.h.

◆ Base

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

Data type definition.

Definition at line 39 of file DbHandleBase.h.

Constructor & Destructor Documentation

◆ DbDomain() [1/3]

pool::DbDomain::DbDomain ( DbDomainObj dom)

Friend's constructor.

◆ DbDomain() [2/3]

pool::DbDomain::DbDomain ( const DbType type)
inline

Constructor using Db type.

Definition at line 58 of file DbDomain.h.

58 { m_type = type.majorType(); }

◆ DbDomain() [3/3]

pool::DbDomain::DbDomain ( const DbDomain copy)
inline

Copy constructor.

Definition at line 60 of file DbDomain.h.

61  : DbHandleBase<DbDomainObj>() { *this = copy; }

◆ ~DbDomain()

virtual pool::DbDomain::~DbDomain ( )
inlinevirtual

Standard destructor.

Definition at line 63 of file DbDomain.h.

63 { switchPtr( 0 ); }

Member Function Documentation

◆ add()

DbStatus pool::DbDomain::add ( const std::string &  nam,
DbDatabaseObj db 
)

Add domain to session.

◆ ageLimit()

int pool::DbDomain::ageLimit ( ) const

Access the maximal age limit.

◆ ageOpenDbs()

DbStatus pool::DbDomain::ageOpenDbs ( )

Increase the age of all open databases.

◆ close()

DbStatus pool::DbDomain::close ( )

Close domain.

◆ closeAgedDbs()

DbStatus pool::DbDomain::closeAgedDbs ( )

Check if databases are present, which aged a lot and need to be closed.

◆ containedIn()

DbSession pool::DbDomain::containedIn ( ) const

Access to session handle.

◆ db() [1/2]

IOODatabase* pool::DbDomain::db ( )

Allow access to the Database implementation.

◆ db() [2/2]

const IOODatabase* pool::DbDomain::db ( ) const

◆ exist()

bool pool::DbDomain::exist ( DbSession sesH,
int  technology 
) const

Check for the existence of a domain within a session.

Parameters
sesH[IN] Handle to the database session this database domain belongs to.
technology[IN] Technology identifier of the domain.
Returns
boolean value indicating if the database was found.

◆ existsDbase()

bool pool::DbDomain::existsDbase ( const std::string &  db_name)

Check if Database exists within the domain.

◆ find() [1/2]

DbDatabaseObj* pool::DbDomain::find ( const std::string &  db_name)

◆ find() [2/2]

const DbDatabaseObj* pool::DbDomain::find ( const std::string &  db_name) const

Find Database in domain.

◆ getOption()

DbStatus pool::DbDomain::getOption ( DbOption refOpt) const

Access domain specific options.

Parameters
refOpt[IN] Reference to option object
Returns
DbStatus code indicating success or failure.

◆ info() [1/2]

IDbDomain* pool::DbDomain::info ( )

Let the implementation access the internals.

◆ info() [2/2]

const IDbDomain* pool::DbDomain::info ( ) const

◆ isValid()

bool pool::DbHandleBase::isValid
inlineinherited

Validity check (Objy like)

Definition at line 64 of file DbHandleBase.h.

64 { return 0 != m_ptr; }

◆ name()

const std::string& pool::DbDomain::name ( ) const

Acces to the domain name.

◆ open()

DbStatus pool::DbDomain::open ( DbSession sesH,
const DbType technology,
DbAccessMode  mod = pool::READ 
)

Open domain within a session environment.

Parameters
context[IN] Handle to user defined domain context
sesH[IN] Handle to the database session this database domain belongs to.
technology[IN] Technology identifier of this domain.
mod[IN] Access mode: READ, UPDATE, CREATE etc.
Returns
DbStatus code indicating success or failure.

◆ openMode()

DbAccessMode pool::DbDomain::openMode ( ) const

Access to access mode.

◆ operator!()

bool pool::DbHandleBase::operator!
inlineinherited

Validity check through operator NOT.

Definition at line 59 of file DbHandleBase.h.

59 { return !isValid(); }

◆ operator->() [1/2]

T* pool::DbHandleBase::operator->
inlineinherited

Dereference operator.

Definition at line 56 of file DbHandleBase.h.

56 { return m_ptr; }

◆ operator->() [2/2]

const T* pool::DbHandleBase::operator->
inlineinherited

Definition at line 57 of file DbHandleBase.h.

57 { return m_ptr; }

◆ operator=() [1/2]

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

Assignment operator.

Definition at line 65 of file DbDomain.h.

65  {
66  if ( &copy != this ) {
67  m_type = copy.m_type;
68  switchPtr(copy.m_ptr);
69  }
70  return *this;
71  }

◆ operator=() [2/2]

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

Assignment operator to reset handel easily using 0.

Definition at line 73 of file DbDomain.h.

73  {
74  switchPtr(0);
75  return *this;
76  }

◆ ptr() [1/2]

T* pool::DbHandleBase::ptr
inlineinherited

Definition at line 62 of file DbHandleBase.h.

62 { return m_ptr; }

◆ ptr() [2/2]

const T* pool::DbHandleBase::ptr
inlineinherited

Access to underlying object.

Definition at line 61 of file DbHandleBase.h.

61 { return m_ptr; }

◆ refCount()

int pool::DbDomain::refCount ( ) const

Access reference counter.

◆ remove()

DbStatus pool::DbDomain::remove ( DbDatabaseObj db)

Find domain in session.

◆ setAgeLimit()

void pool::DbDomain::setAgeLimit ( int  value)

Set the maximal allowed age limit for files in this domain.

◆ setOption()

DbStatus pool::DbDomain::setOption ( const DbOption refOpt)

Set domain specific options.

Parameters
refOpt[IN] Reference to option object
Returns
DbStatus code indicating success or failure.

◆ setPtr()

void pool::DbHandleBase::setPtr ( T *  ptr)
inlineprotectedinherited

Set data pointer.

Definition at line 52 of file DbHandleBase.h.

52 { m_ptr=ptr; }

◆ setType()

void pool::DbHandleBase::setType ( const DbType typ)
inlineprotectedinherited

Set handle type.

Definition at line 50 of file DbHandleBase.h.

50 { m_type=typ; }

◆ switchPtr()

void pool::DbDomain::switchPtr ( DbDomainObj obj)
private

Assign transient object properly (including reference counting)

◆ type()

const DbType& pool::DbHandleBase::type
inlineinherited

Inquire storage type of the handle.

Definition at line 66 of file DbHandleBase.h.

66 { return m_type; }

Friends And Related Function Documentation

◆ DbDomainObj

friend class DbDomainObj
friend

Friend declarations.

Definition at line 50 of file DbDomain.h.

Member Data Documentation

◆ m_ptr

T* pool::DbHandleBase::m_ptr
protectedinherited

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

Definition at line 41 of file DbHandleBase.h.

◆ m_type

DbType pool::DbHandleBase::m_type
protectedinherited

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

Definition at line 43 of file DbHandleBase.h.


The documentation for this class was generated from the following file:
pool::DbDomain::switchPtr
void switchPtr(DbDomainObj *obj)
Assign transient object properly (including reference counting)
pool::DbHandleBase< DbDomainObj >::type
const DbType & type() const
Inquire storage type of the handle.
Definition: DbHandleBase.h:66
pool::DbHandleBase< DbDomainObj >::ptr
const T * ptr() const
Access to underlying object.
Definition: DbHandleBase.h:61
pool::DbHandleBase< DbDomainObj >::m_type
DbType m_type
Data member: Technology type. Sub-classes need access on re-assignment.
Definition: DbHandleBase.h:43
pool::DbType::majorType
int majorType() const
Access to major type.
Definition: DbType.h:68
pool::DbHandleBase< DbDomainObj >::m_ptr
T * m_ptr
Data member: Object pointer. Sub-classes need access on re-assignment.
Definition: DbHandleBase.h:41
pool::DbHandleBase< DbDomainObj >::isValid
bool isValid() const
Validity check (Objy like)
Definition: DbHandleBase.h:64
calibdata.copy
bool copy
Definition: calibdata.py:27