CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
InputFileCatalog.h
Go to the documentation of this file.
1 #ifndef FWCore_Catalog_InputFileCatalog_h
2 #define FWCore_Catalog_InputFileCatalog_h
3 //
5 // Class InputFileCatalog. Services to manage InputFile catalog
6 //
8 
9 #include <string>
10 #include <vector>
11 #include "boost/scoped_ptr.hpp"
13 
14 namespace edm {
16  public:
18  FileCatalogItem(std::string const& pfn, std::string const& lfn, std::string const& fallbackPfn) : pfn_(pfn), lfn_(lfn), fallbackPfn_(fallbackPfn) {}
19  std::string const& fileName() const {return pfn_;}
20  std::string const& logicalFileName() const {return lfn_;}
21  std::string const& fallbackFileName() const {return fallbackPfn_;}
22  private:
26  };
27 
29  public:
30  InputFileCatalog(std::vector<std::string> const& fileNames, std::string const& override, bool useLFNasPFNifLFNnotFound = false);
31  InputFileCatalog(std::vector<std::string> const& fileNames, std::string const& override, std::string const& overrideFallback, bool useLFNasPFNifLFNnotFound = false);
33  std::vector<FileCatalogItem> const& fileCatalogItems() const {return fileCatalogItems_;}
34  std::vector<std::string> const& logicalFileNames() const {return logicalFileNames_;}
35  std::vector<std::string> const& fileNames() const {return fileNames_;}
36  std::vector<std::string> const& fallbackFileNames() const {return fallbackFileNames_;}
37  bool empty() const {return fileCatalogItems_.empty();}
38  static bool isPhysical(std::string const& name) {
39  return (name.empty() || name.find(':') != std::string::npos);
40  }
41 
42  private:
43  void init(std::string const& override, std::string const& overrideFallback, bool useLFNasPFNifLFNnotFound);
44  void findFile(std::string & pfn, std::string & fallbackPfn, std::string const& lfn, bool useLFNasPFNifLFNnotFound);
45  std::vector<std::string> logicalFileNames_;
46  std::vector<std::string> fileNames_;
47  std::vector<std::string> fallbackFileNames_;
48  std::vector<FileCatalogItem> fileCatalogItems_;
49  boost::scoped_ptr<FileLocator> fileLocator_;
50  boost::scoped_ptr<FileLocator> overrideFileLocator_;
51  boost::scoped_ptr<FileLocator> fallbackFileLocator_;
52  boost::scoped_ptr<FileLocator> overrideFallbackFileLocator_;
53  };
54 }
55 
56 #endif
FileCatalogItem(std::string const &pfn, std::string const &lfn, std::string const &fallbackPfn)
list pfn
Definition: dbtoconf.py:76
boost::scoped_ptr< FileLocator > fallbackFileLocator_
std::vector< FileCatalogItem > fileCatalogItems_
boost::scoped_ptr< FileLocator > overrideFileLocator_
boost::scoped_ptr< FileLocator > fileLocator_
std::vector< std::string > fileNames_
static bool isPhysical(std::string const &name)
boost::scoped_ptr< FileLocator > overrideFallbackFileLocator_
std::vector< std::string > fallbackFileNames_
std::string const & fallbackFileName() const
std::vector< std::string > const & fallbackFileNames() const
std::vector< std::string > const & logicalFileNames() const
std::vector< std::string > const & fileNames() const
std::string const & logicalFileName() const
std::string const & fileName() const
void init(std::string const &override, std::string const &overrideFallback, bool useLFNasPFNifLFNnotFound)
InputFileCatalog(std::vector< std::string > const &fileNames, std::string const &override, bool useLFNasPFNifLFNnotFound=false)
std::vector< std::string > logicalFileNames_
void findFile(std::string &pfn, std::string &fallbackPfn, std::string const &lfn, bool useLFNasPFNifLFNnotFound)
std::vector< FileCatalogItem > const & fileCatalogItems() const