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 namespace edm::storage {
9  class Storage;
10  class StorageMaker {
11  public:
12  struct AuxSettings {
13  unsigned int timeout = 0;
14  unsigned int debugLevel = 0;
15 
16  AuxSettings &setDebugLevel(unsigned int iLevel) {
17  debugLevel = iLevel;
18  return *this;
19  }
20 
21  AuxSettings &setTimeout(unsigned int iTime) {
22  timeout = iTime;
23  return *this;
24  }
25  };
26 
27  StorageMaker() = default;
28  virtual ~StorageMaker() = default;
29  // implicit copy constructor
30  // implicit assignment operator
31 
32  virtual void stagein(const std::string &proto, const std::string &path, const AuxSettings &aux) const;
33  virtual std::unique_ptr<Storage> open(const std::string &proto,
34  const std::string &path,
35  int mode,
36  const AuxSettings &aux) const = 0;
37  virtual bool check(const std::string &proto,
38  const std::string &path,
39  const AuxSettings &aux,
40  IOOffset *size = nullptr) const;
41  };
42 } // namespace edm::storage
43 #endif // STORAGE_FACTORY_STORAGE_MAKER_H
int64_t IOOffset
Definition: IOTypes.h:20
AuxSettings & setTimeout(unsigned int iTime)
Definition: StorageMaker.h:21
virtual ~StorageMaker()=default
virtual std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &aux) const =0
AuxSettings & setDebugLevel(unsigned int iLevel)
Definition: StorageMaker.h:16
virtual void stagein(const std::string &proto, const std::string &path, const AuxSettings &aux) const
Definition: StorageMaker.cc:8
virtual bool check(const std::string &proto, const std::string &path, const AuxSettings &aux, IOOffset *size=nullptr) const
Definition: StorageMaker.cc:10