ATLAS Offline Software
Loading...
Searching...
No Matches
IFileCatalog.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef APR_IFILECATALOG_H
6#define APR_IFILECATALOG_H
7
8#include "GaudiUtils/IFileCatalog.h"
9#include "GaudiUtils/IFileCatalogMgr.h"
10#include "GaudiKernel/SmartIF.h"
11
13
14namespace pool {
15
16 namespace FileCatalog {
17 typedef std::string FileID;
18 }
19
20 class IFileCatalog : public AthMessaging {
21 public:
22
23 typedef Gaudi::IFileCatalog::Files Files;
24 typedef Gaudi::IFileCatalog::Strings Strings;
25 typedef Gaudi::IFileCatalogMgr::Catalogs Catalogs;
26
27
30
31 // ------------------------------ Catalog interface
33 const std::string& connectInfo() const { return m_fc->connectInfo(); }
34
36 void start() { m_fc->init(); }
38 void commit() { m_fc->commit(); }
39
41 void getFIDs( Strings& fids ) const { m_fc->getFID(fids); }
42
44 void getLFNs( const std::string& fid, Files& files ) const { m_fc->getLFN(fid, files); }
45
47 void getPFNs( const std::string& fid, Files& files ) const { m_fc->getPFN(fid, files); }
48
50 void getFirstPFN( const std::string& fid, std::string& pfn, std::string& tech ) const;
51
53 void lookupFileByPFN( const std::string& pfn, std::string& fid, std::string& tech ) const;
54
56 bool existsPFN( const std::string& pfn ) const { return m_fc->existsPFN(pfn); }
57
59 std::string lookupPFN( const std::string& pfn ) const { return m_fc->lookupPFN(pfn); }
60
62 std::string lookupLFN( const std::string& lfn ) const { return m_fc->lookupLFN(lfn); }
63
65 void deleteFID( const std::string& FileID ) { m_fc->deleteFID(FileID); }
66
68 void registerPFN( const std::string& pfn, const std::string& ftype, std::string& fid );
69
71 void renamePFN( const std::string& pfn, const std::string& newpfn ) { m_fc->renamePFN(pfn, newpfn); }
72
74 // NOTE! this method requires FID! (and not PFN)
75 void registerLFN( const std::string& fid, const std::string& lfn ) const { m_fc->registerLFN(fid, lfn ); }
76
77
78 // ------------------------- Catalog Manager interface
79
81 void addReadCatalog( const std::string& connect ) { addCatalog(connect, false); }
82 void addCatalog( const std::string& connect, bool forWriting = false );
84 void setWriteCatalog( const std::string& connect ) { addCatalog(connect, true); }
85
87 void removeCatalog( const std::string& connect ) { m_mgr->removeCatalog(connect); }
88
89 protected:
90 SmartIF<Gaudi::IFileCatalogMgr> m_mgr;
91 SmartIF<Gaudi::IFileCatalog> m_fc;
92 };
93}
94
95#endif
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
void start()
redirect to init() for Gaudi FC
void commit()
Save catalog to file.
void addReadCatalog(const std::string &connect)
Add new catalog, identified by name, to the existing ones.
void addCatalog(const std::string &connect, bool forWriting=false)
void getPFNs(const std::string &fid, Files &files) const
Dump all PFNames of the catalog and their attributes associate to the FileID.
void lookupFileByPFN(const std::string &pfn, std::string &fid, std::string &tech) const
Get FID and filetype for a given PFN.
void getFIDs(Strings &fids) const
Get all FIDs.
SmartIF< Gaudi::IFileCatalog > m_fc
bool existsPFN(const std::string &pfn) const
Return the status of a PFName.
void getFirstPFN(const std::string &fid, std::string &pfn, std::string &tech) const
Get the first PFN + filetype for the given FID.
SmartIF< Gaudi::IFileCatalogMgr > m_mgr
Gaudi::IFileCatalog::Strings Strings
Gaudi::IFileCatalog::Files Files
void registerLFN(const std::string &fid, const std::string &lfn) const
Create a Node for a FileID and DOM Node of the LFN with all the attributes.
Gaudi::IFileCatalogMgr::Catalogs Catalogs
void removeCatalog(const std::string &connect)
Remove catalog identified by name from the existing ones. * or '' removes all.
void renamePFN(const std::string &pfn, const std::string &newpfn)
Rename PFN.
const std::string & connectInfo() const
Get the connect string.
void registerPFN(const std::string &pfn, const std::string &ftype, std::string &fid)
Register PFN, assign new FID if not given.
void setWriteCatalog(const std::string &connect)
Establish the writable catalog, identified by name.
std::string lookupLFN(const std::string &lfn) const
Lookup file identified by logical file name.
void getLFNs(const std::string &fid, Files &files) const
Get all logical names for a given FID. Return pairs <LFN,FID>.
std::string lookupPFN(const std::string &pfn) const
Lookup file identifier by physical file name.
void deleteFID(const std::string &FileID)
Delete FileID Node from the catalog.
std::vector< std::string > files
file names and file pointers
Definition hcg.cxx:52
std::string FileID
Framework include files.
Definition libname.h:15
std::string FileID