ATLAS Offline Software
Loading...
Searching...
No Matches
pool::DbDomain Class Reference

Description: More...

#include <StorageSvc/DbDomain.h>

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

Public Member Functions

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

Protected Types

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

Protected Member Functions

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

Protected Attributes

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

Friends

class DbDomainObj
 Friend declarations.

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 DbDomainObj pool::DbHandleBase< DbDomainObj >::_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

◆ DbDomain() [1/3]

pool::DbDomain::DbDomain ( DbDomainObj * dom)

Friend's constructor.

◆ DbDomain() [2/3]

pool::DbDomain::DbDomain ( const DbType & type)
inlineexplicit

Constructor using Db type.

Definition at line 58 of file DbDomain.h.

58{ m_type = type.majorType(); }
const DbType & type() const

◆ DbDomain() [3/3]

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

Copy constructor.

Definition at line 60 of file DbDomain.h.

◆ ~DbDomain()

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

Standard destructor.

Definition at line 63 of file DbDomain.h.

63{ switchPtr( 0 ); }
void switchPtr(DbDomainObj *obj)
Assign transient object properly (including reference counting)

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< DbDomainObj >::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.

◆ 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< DbDomainObj >::operator! ( ) const
inlineinherited

Validity check through operator NOT.

Definition at line 63 of file DbHandleBase.h.

63{ return !isValid(); }

◆ operator->()

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

Dereference operator.

Definition at line 60 of file DbHandleBase.h.

60{ 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()

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

Access to underlying object.

Definition at line 65 of file DbHandleBase.h.

65{ 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< DbDomainObj >::setPtr ( DbDomainObj * ptr)
inlineprotectedinherited

Set data pointer.

Definition at line 56 of file DbHandleBase.h.

56{ m_ptr=ptr; }

◆ setType()

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

Set handle type.

Definition at line 54 of file DbHandleBase.h.

54{ m_type=typ; }

◆ switchPtr()

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

Assign transient object properly (including reference counting)

◆ type()

const DbType & pool::DbHandleBase< DbDomainObj >::type ( ) const
inlineinherited

Inquire storage type of the handle.

Definition at line 70 of file DbHandleBase.h.

70{ return m_type; }

◆ DbDomainObj

friend class DbDomainObj
friend

Friend declarations.

Definition at line 50 of file DbDomain.h.

Member Data Documentation

◆ m_ptr

DbDomainObj* pool::DbHandleBase< DbDomainObj >::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< DbDomainObj >::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: