ATLAS Offline Software
Loading...
Searching...
No Matches
DbDomain.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef STORAGESVC_DBDOMAIN_H
5#define STORAGESVC_DBDOMAIN_H
6
7// Framework include files
8#include "StorageSvc/pool.h"
10
11// STL include files
12#include <vector>
13
14class Token;
15class StatusCode;
16class ITechFactory;
17
18// Forward declarations
19class ITechDomain;
20class DbDomainObj;
21class DbDatabaseObj;
22class DbSession;
23class DbOption;
24
33class DbDomain : public DbHandleBase<DbDomainObj> {
34 public:
36 friend class DbDomainObj;
37 private:
40 public:
44 explicit DbDomain(const DbType& type) { m_type = type.majorType(); }
46 DbDomain(const DbDomain& copy)
47 : DbHandleBase<DbDomainObj>() { *this = copy; }
48
49 virtual ~DbDomain() { switchPtr( 0 ); }
51 DbDomain& operator=(const DbDomain& copy) {
52 if ( &copy != this ) {
53 m_type = copy.m_type;
54 switchPtr(copy.m_ptr);
55 }
56 return *this;
57 }
58
59 DbDomain& operator=(const int /* null_obj */ ) {
60 switchPtr(0);
61 return *this;
62 }
63
64 const std::string& name() const;
66 int refCount() const;
67
69
76 StatusCode open(ITechFactory* imp, const DbType& technology, Io::IoFlag mod = Io::READ);
78 StatusCode close();
80 Io::IoFlag openMode() const;
82 const DbDatabaseObj* find(const std::string& db_name) const;
83 DbDatabaseObj* find(const std::string& db_name);
85 StatusCode add(const std::string& nam, DbDatabaseObj* db);
87 StatusCode remove(DbDatabaseObj* db);
89 StatusCode ageOpenDbs();
91 StatusCode closeAgedDbs();
93 void setAgeLimit(int value);
95 int ageLimit() const;
98 const ITechDomain* info() const;
99
101
105 StatusCode setOption(const DbOption& refOpt);
106
108
112 StatusCode getOption(DbOption& refOpt) const;
113
116 const ITechFactory* techFactory() const;
117};
118
119#endif
Description: Technology independent part of a Database object implementation.
Db objects: DbDomainObj.
Definition DbDomainObj.h:25
StatusCode remove(DbDatabaseObj *db)
Remove a database from the domain.
const DbDatabaseObj * find(const std::string &db_name) const
Find Database in domain.
void setAgeLimit(int value)
Set the maximal allowed age limit for files in this domain.
const ITechFactory * techFactory() const
StatusCode add(const std::string &nam, DbDatabaseObj *db)
Add database to the domain.
StatusCode close()
Close domain.
int refCount() const
Access reference counter.
ITechFactory * techFactory()
Allow access to the Database implementation.
StatusCode open(ITechFactory *imp, const DbType &technology, Io::IoFlag mod=Io::READ)
Open the domain.
friend class DbDomainObj
Friend declarations.
Definition DbDomain.h:36
void switchPtr(DbDomainObj *obj)
Assign transient object properly (including reference counting).
int ageLimit() const
Access the maximal age limit.
virtual ~DbDomain()
Standard destructor.
Definition DbDomain.h:49
DbDomain(const DbType &type)
Constructor using Db type.
Definition DbDomain.h:44
StatusCode closeAgedDbs()
Check if databases are present, which aged a lot and need to be closed.
const std::string & name() const
Acces to the domain name.
DbDomain(const DbDomain &copy)
Copy constructor.
Definition DbDomain.h:46
StatusCode getOption(DbOption &refOpt) const
Access domain specific options.
DbDomain(DbDomainObj *dom)
Friend's constructor.
DbDatabaseObj * find(const std::string &db_name)
ITechDomain * info()
Let the implementation access the internals.
const ITechDomain * info() const
DbDomain & operator=(const int)
Assignment operator to reset handel easily using 0.
Definition DbDomain.h:59
Io::IoFlag openMode() const
Access to access mode.
DbDomain & operator=(const DbDomain &copy)
Assignment operator.
Definition DbDomain.h:51
StatusCode ageOpenDbs()
Increase the age of all open databases.
StatusCode setOption(const DbOption &refOpt)
Set domain specific options.
const DbType & type() const
Description: Definition an option to be supplied to database objects.
Definition DbOption.h:22
Keeps information about storage technology.
Definition DbType.h:15
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:22
::StatusCode StatusCode
StatusCode definition for legacy code.