CMS 3D CMS Logo

FileCatalog.h

Go to the documentation of this file.
00001 #ifndef FWCore_Catalog_FileCatalog_h
00002 #define FWCore_Catalog_FileCatalog_h
00004 //
00005 // $Id: FileCatalog.h,v 1.5 2008/03/14 03:46:02 wmtan Exp $
00006 //
00007 // Class FileCatalog. Common services to manage File catalog
00008 //
00009 // Author of original version: Luca Lista
00010 // Author of current version: Bill Tanenbaum
00011 //
00013 
00014 #include <string>
00015 #include "FileCatalog/IFileCatalog.h"
00016 
00017 namespace edm {
00018 
00019   class FileCatalogItem {
00020   public:
00021     FileCatalogItem() : pfn_(), lfn_() {}
00022     FileCatalogItem(std::string const& pfn, std::string const& lfn) : pfn_(pfn), lfn_(lfn) {}
00023     std::string const& fileName() const {return pfn_;}
00024     std::string const& logicalFileName() const {return lfn_;}
00025   private:
00026     std::string pfn_;
00027     std::string lfn_;
00028   };
00029 
00030   struct PoolCatalog {
00031     PoolCatalog() : catalog_() {}
00032     pool::IFileCatalog catalog_;
00033   };
00034 
00035   class ParameterSet;
00036   class FileCatalog {
00037   public:
00038     explicit FileCatalog(PoolCatalog & poolcat);
00039     virtual ~FileCatalog() = 0;
00040     void commitCatalog();
00041     static bool const isPhysical(std::string const& name) {
00042       return (name.empty() || name.find(':') != std::string::npos);
00043     }
00044     pool::IFileCatalog& catalog() {return catalog_;}
00045     std::string & url() {return url_;}
00046     std::string const& url() const {return url_;}
00047     void setActive() {active_ = true;}
00048     bool active() const {return active_;}
00049   private:
00050     pool::IFileCatalog& catalog_;
00051     std::string url_;
00052     bool active_;
00053   };
00054 }
00055 
00056 #endif

Generated on Tue Jun 9 17:35:18 2009 for CMSSW by  doxygen 1.5.4