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:
49  virtual LoadError LoadCatalog(const PathString &mountpoint,
50  const shash::Any &hash,
51  std::string *catalog_path,
52  shash::Any *catalog_hash);
53  virtual Catalog* CreateCatalog(const PathString &mountpoint,
54  const shash::Any &catalog_hash,
55  Catalog *parent_catalog);
56 
57  const shash::Any& base_hash() const { return base_hash_; }
58  void set_base_hash(const shash::Any &hash) { base_hash_ = hash; }
59  const std::string& dir_temp() const { return dir_temp_; }
60 
67  inline std::string MakeRelativePath(const std::string &relative_path) const {
68  return (relative_path == "") ? "" : "/" + relative_path;
69  }
70 
71  private:
73  std::string stratum0_;
74  std::string dir_temp_;
77 }; // class SimpleCatalogManager
78 
79 } // namespace catalog
80 
81 #endif // CVMFS_CATALOG_MGR_RO_H_
const manifest::Manifest * manifest() const
Definition: repository.h:125
void set_base_hash(const shash::Any &hash)
virtual LoadError LoadCatalog(const PathString &mountpoint, const shash::Any &hash, std::string *catalog_path, shash::Any *catalog_hash)
download::DownloadManager * download_manager_
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
const shash::Any & base_hash() const