File indexing completed on 2025-05-19 07:20:22
0001 #ifndef STORAGE_FACTORY_STORAGE_MAKER_H
0002 #define STORAGE_FACTORY_STORAGE_MAKER_H
0003
0004 #include "Utilities/StorageFactory/interface/IOTypes.h"
0005 #include <string>
0006 #include <memory>
0007
0008 namespace edm::storage {
0009 class Storage;
0010 class StorageMaker {
0011 public:
0012 struct AuxSettings {
0013 unsigned int timeout = 0;
0014 unsigned int debugLevel = 0;
0015
0016 AuxSettings &setDebugLevel(unsigned int iLevel) {
0017 debugLevel = iLevel;
0018 return *this;
0019 }
0020
0021 AuxSettings &setTimeout(unsigned int iTime) {
0022 timeout = iTime;
0023 return *this;
0024 }
0025 };
0026
0027 enum class UseLocalFile { kYes, kCheckFromPath, kNo };
0028
0029 StorageMaker() = default;
0030 virtual ~StorageMaker() = default;
0031
0032
0033
0034 virtual void stagein(const std::string &proto, const std::string &path, const AuxSettings &aux) const;
0035 virtual std::unique_ptr<Storage> open(const std::string &proto,
0036 const std::string &path,
0037 int mode,
0038 const AuxSettings &aux) const = 0;
0039 virtual bool check(const std::string &proto,
0040 const std::string &path,
0041 const AuxSettings &aux,
0042 IOOffset *size = nullptr) const;
0043
0044
0045 virtual UseLocalFile usesLocalFile() const = 0;
0046 };
0047 }
0048 #endif