ATLAS Offline Software
IDatabase.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 #ifndef INCLUDE_PERSISTENCYSVC_IDATABASE_H
6 #define INCLUDE_PERSISTENCYSVC_IDATABASE_H
7 
8 // includes
9 #include <string>
10 #include <vector>
11 
12 namespace pool {
13 
14  // forward declarations
15  class DatabaseConnectionPolicy;
16  class IContainer;
17  class ITechnologySpecificAttributes;
18 
25  class IDatabase {
26  public:
28  typedef enum { CLOSED,
31 
33  virtual ~IDatabase() {};
34 
36  virtual void connectForRead() = 0;
37  virtual void connectForRead( const DatabaseConnectionPolicy& policy ) = 0;
38 
40  virtual void connectForWrite() = 0;
41  virtual void connectForWrite( const DatabaseConnectionPolicy& policy ) = 0;
42 
44  virtual void disconnect() = 0;
45 
47  virtual OpenMode openMode() const = 0;
48 
50  virtual const std::string& fid() = 0;
51 
53  virtual const std::string& pfn() = 0;
54 
59  virtual bool setTechnology( long technology ) = 0;
60 
62  virtual long technology() const = 0;
63 
65  virtual std::vector< std::string > containers() = 0;
66 
68  virtual IContainer* containerHandle( const std::string& name ) = 0;
69 
73  };
74 
75 }
76 
77 #endif
pool::IContainer
Definition: IContainer.h:23
pool::IDatabase::OpenMode
OpenMode
Current open mode enumeration.
Definition: IDatabase.h:28
pool::IDatabase::connectForRead
virtual void connectForRead()=0
Connects explicitly to the database for read operations.
pool
pool namespace
Definition: libname.h:15
pool::IDatabase::pfn
virtual const std::string & pfn()=0
Returns the physical file name of this database.
pool::IDatabase::containers
virtual std::vector< std::string > containers()=0
Returns the names of the containers in this database.
pool::IDatabase::fid
virtual const std::string & fid()=0
Returns the file identifier of this database.
pool::IDatabase::openMode
virtual OpenMode openMode() const =0
Returns the opening mode. It can be used to check whether the database is connected.
pool::IDatabase::technologySpecificAttributes
virtual const ITechnologySpecificAttributes & technologySpecificAttributes() const =0
Returns the object holding the technology specific attributes.
pool::IDatabase::connectForWrite
virtual void connectForWrite(const DatabaseConnectionPolicy &policy)=0
pool::IDatabase::connectForWrite
virtual void connectForWrite()=0
Connects explicitly to the database for write/update operations.
pool::IDatabase::CLOSED
@ CLOSED
Definition: IDatabase.h:28
pool::IDatabase::READ
@ READ
Definition: IDatabase.h:29
pool::IDatabase::technologySpecificAttributes
virtual ITechnologySpecificAttributes & technologySpecificAttributes()=0
pool::IDatabase::setTechnology
virtual bool setTechnology(long technology)=0
Sets the technology identifier for this database.
pool::IDatabase::disconnect
virtual void disconnect()=0
Disconnects from the database.
pool::IDatabase::connectForRead
virtual void connectForRead(const DatabaseConnectionPolicy &policy)=0
pool::IDatabase::UPDATE
@ UPDATE
Definition: IDatabase.h:30
pool::ITechnologySpecificAttributes
Definition: ITechnologySpecificAttributes.h:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
pool::IDatabase
Definition: IDatabase.h:25
pool::IDatabase::technology
virtual long technology() const =0
Returns the technology identifier for this database.
pool::DatabaseConnectionPolicy
Definition: DatabaseConnectionPolicy.h:19
pool::IDatabase::containerHandle
virtual IContainer * containerHandle(const std::string &name)=0
Returns a pointer to a container object. The user acquires ownership of that object.
pool::IDatabase::~IDatabase
virtual ~IDatabase()
Empty destructor.
Definition: IDatabase.h:33