ATLAS Offline Software
Loading...
Searching...
No Matches
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
12namespace 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
46 typedef std::set< DatabaseHandler* >::iterator iterator;
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
68 std::set< DatabaseHandler* >::iterator registerDbHandler( DatabaseHandler* dbHandler );
69 };
70 }
71}
72
73#include "DatabaseRegistry.inl"
74
75#endif
DatabaseHandler is a class taking care of the micro-connections and the micro transactions for a give...
std::set< DatabaseHandler * > m_databases
void deregisterDatabaseHandler(DatabaseHandler *dbHandler)
Deregisters a database.
std::map< std::string, DatabaseHandler * > m_fidToDb
iterator begin()
The begin iterators.
DatabaseHandler * lookupByLFN(const std::string &lfn)
Looks up a database by its logical file name.
DatabaseHandler * lookupByPFN(const std::string &pfn)
Looks up a database by its physical file name.
std::set< DatabaseHandler * >::iterator iterator
std::set< DatabaseHandler * >::const_iterator const_iterator
void registerDatabaseHandler(DatabaseHandler *dbHandler)
Registers a database.
void registerDatabaseHandler(DatabaseHandler *dbHandler, const std::string &lfn)
Registers a database with an LFN.
std::size_t size() const
The number of elements registered.
std::map< std::string, DatabaseHandler * > m_pfnToDb
std::map< std::string, std::set< std::string > > m_fidToLfns
iterator end()
The end iterators.
DatabaseHandler * lookupByFID(const std::string &fid)
Looks up a database by its file id.
std::set< DatabaseHandler * >::iterator registerDbHandler(DatabaseHandler *dbHandler)
std::map< std::string, DatabaseHandler * > m_lfnToDb
pool namespace
Definition libname.h:15