CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
catalog_mgr_ro.h
Go to the documentation of this file.
1 
11 #ifndef CVMFS_CATALOG_MGR_RO_H_
12 #define CVMFS_CATALOG_MGR_RO_H_
13 
14 #include <string>
15 
16 #include "catalog_mgr.h"
17 
18 namespace download {
19 class DownloadManager;
20 }
21 
22 namespace manifest {
23 class Manifest;
24 }
25 
26 namespace perf {
27 class Statistics;
28 }
29 
30 namespace catalog {
31 
33  public:
35  const shash::Any &base_hash,
36  const std::string &stratum0,
37  const std::string &dir_temp,
38  download::DownloadManager *download_manager,
40  const bool manage_catalog_files = false)
41  : AbstractCatalogManager<Catalog>(statistics)
42  , base_hash_(base_hash)
43  , stratum0_(stratum0)
44  , dir_temp_(dir_temp)
45  , download_manager_(download_manager)
46  , manage_catalog_files_(manage_catalog_files) { }
47 
48  protected:
50  virtual LoadReturn LoadCatalogByHash(CatalogContext *ctlg_context);
51  virtual Catalog* CreateCatalog(const PathString &mountpoint,
52  const shash::Any &catalog_hash,
53  Catalog *parent_catalog);
54 
55  const shash::Any& base_hash() const { return base_hash_; }
56  void set_base_hash(const shash::Any &hash) { base_hash_ = hash; }
57  const std::string& dir_temp() const { return dir_temp_; }
58 
65  inline std::string MakeRelativePath(const std::string &relative_path) const {
66  return (relative_path == "") ? "" : "/" + relative_path;
67  }
68 
69  private:
71  std::string stratum0_;
72  std::string dir_temp_;
75 }; // class SimpleCatalogManager
76 
77 } // namespace catalog
78 
79 #endif // CVMFS_CATALOG_MGR_RO_H_
const manifest::Manifest * manifest() const
Definition: repository.h:125
void set_base_hash(const shash::Any &hash)
download::DownloadManager * download_manager_
virtual LoadReturn LoadCatalogByHash(CatalogContext *ctlg_context)
virtual Catalog * CreateCatalog(const PathString &mountpoint, const shash::Any &catalog_hash, Catalog *parent_catalog)
SimpleCatalogManager(const shash::Any &base_hash, const std::string &stratum0, const std::string &dir_temp, download::DownloadManager *download_manager, perf::Statistics *statistics, const bool manage_catalog_files=false)
const std::string & dir_temp() const
std::string MakeRelativePath(const std::string &relative_path) const
virtual LoadReturn GetNewRootCatalogContext(CatalogContext *result)
const shash::Any & base_hash() const