ATLAS Offline Software
DbDomain.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: DbDomain.h 726071 2016-02-25 09:23:05Z krasznaa $
6 //====================================================================
7 // DbDomain and related class definitions
8 //--------------------------------------------------------------------
9 //
10 // Package : StorageSvc (The POOL project)
11 // @author M.Frank
12 //====================================================================
13 #ifndef POOL_DBDOMAIN_H
14 #define POOL_DBDOMAIN_H
15 
16 // Framework include files
17 #include "StorageSvc/pool.h"
19 
20 // STL include files
21 #include <vector>
22 
23 class Token;
24 
25 /*
26  * POOL namespace declaration
27  */
28 namespace pool {
29 
30  // Forward declarations
31  class IDbDomain;
32  class IOODatabase;
33  class DbDomainObj;
34  class DbDatabaseObj;
35  class DbSession;
36  class DbOption;
37 
47  class DbDomain : public DbHandleBase<DbDomainObj> {
48  public:
50  friend class DbDomainObj;
51  private:
54  public:
61  : DbHandleBase<DbDomainObj>() { *this = copy; }
63  virtual ~DbDomain() { switchPtr( 0 ); }
66  if ( &copy != this ) {
67  m_type = copy.m_type;
68  switchPtr(copy.m_ptr);
69  }
70  return *this;
71  }
73  DbDomain& operator=(const int /* null_obj */ ) {
74  switchPtr(0);
75  return *this;
76  }
78  const std::string& name() const;
80  int refCount() const;
81 
83 
90  bool exist(DbSession& sesH, int technology) const;
91 
93 
103  const DbType& technology,
112  bool existsDbase(const std::string& db_name);
114  const DbDatabaseObj* find(const std::string& db_name) const;
115  DbDatabaseObj* find(const std::string& db_name);
117  DbStatus add(const std::string& nam, DbDatabaseObj* db);
125  void setAgeLimit(int value);
127  int ageLimit() const;
130  const IDbDomain* info() const;
131 
133 
137  DbStatus setOption(const DbOption& refOpt);
138 
140 
144  DbStatus getOption(DbOption& refOpt) const;
145 
148  const IOODatabase* db() const;
149  };
150 } // End namespace pool
151 #endif // POOL_DBDOMAIN_H
pool::DbDomain::openMode
DbAccessMode openMode() const
Access to access mode.
pool::DbAccessMode
int DbAccessMode
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:47
pool::DbStatus
Definition: DbStatus.h:67
pool::DbDomain::DbDomain
DbDomain(const DbType &type)
Constructor using Db type.
Definition: DbDomain.h:58
pool::DbDomain::db
IOODatabase * db()
Allow access to the Database implementation.
pool::DbDomain::close
DbStatus close()
Close domain.
pool::DbDomain::switchPtr
void switchPtr(DbDomainObj *obj)
Assign transient object properly (including reference counting)
pool
pool namespace
Definition: libname.h:15
pool::DbDomain::closeAgedDbs
DbStatus closeAgedDbs()
Check if databases are present, which aged a lot and need to be closed.
pool::DbDomain::find
DbDatabaseObj * find(const std::string &db_name)
pool::DbSession
Db objects: class DbSession.
Definition: DbSession.h:43
pool::DbDomainObj
Db objects: DbDomainObj.
Definition: DbDomainObj.h:39
athena.value
value
Definition: athena.py:122
pool::IDbDomain
Definition: IDbDomain.h:40
pool::DbDomain::containedIn
DbSession containedIn() const
Access to session handle.
pool::DbDomain::getOption
DbStatus getOption(DbOption &refOpt) const
Access domain specific options.
pool::DbDomain::setAgeLimit
void setAgeLimit(int value)
Set the maximal allowed age limit for files in this domain.
pool::DbHandleBase< DbDomainObj >::type
const DbType & type() const
Inquire storage type of the handle.
Definition: DbHandleBase.h:66
pool::DbDomain::~DbDomain
virtual ~DbDomain()
Standard destructor.
Definition: DbDomain.h:63
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
pool::DbDomain::name
const std::string & name() const
Acces to the domain name.
pool::DbDomain::operator=
DbDomain & operator=(const DbDomain &copy)
Assignment operator.
Definition: DbDomain.h:65
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
pool::DbType
Definition: DbType.h:31
pool::DbDatabaseObj
Definition: DbDatabaseObj.h:49
pool::DbDomain::operator=
DbDomain & operator=(const int)
Assignment operator to reset handel easily using 0.
Definition: DbDomain.h:73
pool::DbOption
Definition: DbOption.h:36
pool::DbDomain::setOption
DbStatus setOption(const DbOption &refOpt)
Set domain specific options.
pool::DbHandleBase< DbDomainObj >::m_type
DbType m_type
Data member: Technology type. Sub-classes need access on re-assignment.
Definition: DbHandleBase.h:43
pool::DbDomain::DbDomain
DbDomain(DbDomainObj *dom)
Friend's constructor.
pool::DbDomain::refCount
int refCount() const
Access reference counter.
pool::DbDomain::info
IDbDomain * info()
Let the implementation access the internals.
pool::DbDomain::open
DbStatus open(DbSession &sesH, const DbType &technology, DbAccessMode mod=pool::READ)
Open domain within a session environment.
pool.h
pool::DbDomain::ageLimit
int ageLimit() const
Access the maximal age limit.
pool::READ
@ READ
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:68
pool::DbDomain::find
const DbDatabaseObj * find(const std::string &db_name) const
Find Database in domain.
pool::DbType::majorType
int majorType() const
Access to major type.
Definition: DbType.h:68
pool::DbDomain::db
const IOODatabase * db() const
pool::DbDomain::info
const IDbDomain * info() const
pool::DbDomain
Definition: DbDomain.h:47
pool::DbDomain::exist
bool exist(DbSession &sesH, int technology) const
Check for the existence of a domain within a session.
DbHandleBase.h
pool::DbHandleBase
Definition: DbHandleBase.h:24
pool::DbDomain::remove
DbStatus remove(DbDatabaseObj *db)
Find domain in session.
pool::DbDomain::DbDomain
DbDomain(const DbDomain &copy)
Copy constructor.
Definition: DbDomain.h:60
pool::DbDomain::add
DbStatus add(const std::string &nam, DbDatabaseObj *db)
Add domain to session.
calibdata.copy
bool copy
Definition: calibdata.py:27
python.PyAthena.obj
obj
Definition: PyAthena.py:135
pool::DbDomain::existsDbase
bool existsDbase(const std::string &db_name)
Check if Database exists within the domain.
pool::IOODatabase
Definition: IOODatabase.h:50
pool::DbDomain::ageOpenDbs
DbStatus ageOpenDbs()
Increase the age of all open databases.