ATLAS Offline Software
DatabaseRegistry.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INCLUDE_PERSISTENCYSVC_DATABASEREGISTRY_H
6 #define INCLUDE_PERSISTENCYSVC_DATABASEREGISTRY_H
7 
8 #include <string>
9 #include <set>
10 #include <map>
11 
12 namespace pool {
13 
14  namespace PersistencySvc {
15 
16  // Forward declarations
17  class DatabaseHandler;
18 
20  public:
22  explicit DatabaseRegistry();
23 
26 
29 
32  const std::string& lfn );
33 
36 
38  DatabaseHandler* lookupByFID( const std::string& fid );
39 
41  DatabaseHandler* lookupByPFN( const std::string& pfn );
42 
44  DatabaseHandler* lookupByLFN( const std::string& lfn );
45 
47  typedef std::set< DatabaseHandler* >::const_iterator const_iterator;
48 
52 
56 
58  std::size_t size() const;
59 
60  private:
61  std::set< DatabaseHandler* > m_databases;
62  std::map< std::string, DatabaseHandler* > m_fidToDb;
63  std::map< std::string, DatabaseHandler* > m_pfnToDb;
64  std::map< std::string, DatabaseHandler* > m_lfnToDb;
65  std::map< std::string, std::set< std::string > > m_fidToLfns;
66 
67  // Registers a database
69  };
70  }
71 }
72 
73 #include "DatabaseRegistry.inl"
74 
75 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
pool::PersistencySvc::DatabaseRegistry::const_iterator
std::set< DatabaseHandler * >::const_iterator const_iterator
Definition: DatabaseRegistry.h:47
pool::PersistencySvc::DatabaseHandler
Definition: DatabaseHandler.h:34
pool::PersistencySvc::DatabaseRegistry::m_fidToLfns
std::map< std::string, std::set< std::string > > m_fidToLfns
Definition: DatabaseRegistry.h:65
pool
pool namespace
Definition: libname.h:15
pool::PersistencySvc::DatabaseRegistry::deregisterDatabaseHandler
void deregisterDatabaseHandler(DatabaseHandler *dbHandler)
Deregisters a database.
pool::PersistencySvc::DatabaseRegistry::m_pfnToDb
std::map< std::string, DatabaseHandler * > m_pfnToDb
Definition: DatabaseRegistry.h:63
pool::PersistencySvc::DatabaseRegistry::m_databases
std::set< DatabaseHandler * > m_databases
Definition: DatabaseRegistry.h:61
pool::PersistencySvc::DatabaseRegistry::begin
iterator begin()
The begin iterators.
pool::PersistencySvc::DatabaseRegistry::lookupByFID
DatabaseHandler * lookupByFID(const std::string &fid)
Looks up a database by its file id.
pool::PersistencySvc::DatabaseRegistry::lookupByLFN
DatabaseHandler * lookupByLFN(const std::string &lfn)
Looks up a database by its logical file name.
rerun_display.lfn
lfn
Definition: rerun_display.py:60
pool::PersistencySvc::DatabaseRegistry::iterator
std::set< DatabaseHandler * >::iterator iterator
Definition: DatabaseRegistry.h:46
pool::PersistencySvc::DatabaseRegistry::size
std::size_t size() const
The number of elements registered.
pool::PersistencySvc::DatabaseRegistry::~DatabaseRegistry
~DatabaseRegistry()
Destructor.
pool::PersistencySvc::DatabaseRegistry::lookupByPFN
DatabaseHandler * lookupByPFN(const std::string &pfn)
Looks up a database by its physical file name.
pool::PersistencySvc::DatabaseRegistry::registerDatabaseHandler
void registerDatabaseHandler(DatabaseHandler *dbHandler, const std::string &lfn)
Registers a database with an LFN.
pool::PersistencySvc::DatabaseRegistry
Definition: DatabaseRegistry.h:19
pool::PersistencySvc::DatabaseRegistry::begin
const_iterator begin() const
pool::PersistencySvc::DatabaseRegistry::registerDbHandler
std::set< DatabaseHandler * >::iterator registerDbHandler(DatabaseHandler *dbHandler)
pool::PersistencySvc::DatabaseRegistry::registerDatabaseHandler
void registerDatabaseHandler(DatabaseHandler *dbHandler)
Registers a database.
pool::PersistencySvc::DatabaseRegistry::DatabaseRegistry
DatabaseRegistry()
Constructor.
pool::PersistencySvc::DatabaseRegistry::end
const_iterator end() const
pool::PersistencySvc::DatabaseRegistry::m_fidToDb
std::map< std::string, DatabaseHandler * > m_fidToDb
Definition: DatabaseRegistry.h:62
pool::PersistencySvc::DatabaseRegistry::m_lfnToDb
std::map< std::string, DatabaseHandler * > m_lfnToDb
Definition: DatabaseRegistry.h:64
pool::PersistencySvc::DatabaseRegistry::end
iterator end()
The end iterators.