CMS 3D CMS Logo

StorageMaker.h
Go to the documentation of this file.
1 #ifndef STORAGE_FACTORY_STORAGE_MAKER_H
2 #define STORAGE_FACTORY_STORAGE_MAKER_H
3 
5 #include <string>
6 #include <memory>
7 
8 class Storage;
9 class StorageMaker {
10 public:
11  struct AuxSettings {
12  unsigned int timeout = 0;
13  unsigned int debugLevel = 0;
14 
15  AuxSettings &setDebugLevel(unsigned int iLevel) {
16  debugLevel = iLevel;
17  return *this;
18  }
19 
20  AuxSettings &setTimeout(unsigned int iTime) {
21  timeout = iTime;
22  return *this;
23  }
24  };
25 
26  StorageMaker() = default;
27  virtual ~StorageMaker() = default;
28  // implicit copy constructor
29  // implicit assignment operator
30 
31  virtual void stagein(const std::string &proto, const std::string &path, const AuxSettings &aux) const;
32  virtual std::unique_ptr<Storage> open(const std::string &proto,
33  const std::string &path,
34  int mode,
35  const AuxSettings &aux) const = 0;
36  virtual bool check(const std::string &proto,
37  const std::string &path,
38  const AuxSettings &aux,
39  IOOffset *size = nullptr) const;
40 };
41 
42 #endif // STORAGE_FACTORY_STORAGE_MAKER_H
size
Write out results.
virtual bool check(const std::string &proto, const std::string &path, const AuxSettings &aux, IOOffset *size=nullptr) const
Definition: StorageMaker.cc:8
virtual ~StorageMaker()=default
virtual std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &aux) const =0
virtual void stagein(const std::string &proto, const std::string &path, const AuxSettings &aux) const
Definition: StorageMaker.cc:6
int64_t IOOffset
Definition: IOTypes.h:19
StorageMaker()=default
AuxSettings & setDebugLevel(unsigned int iLevel)
Definition: StorageMaker.h:15
AuxSettings & setTimeout(unsigned int iTime)
Definition: StorageMaker.h:20