Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-01 22:41:11

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     StorageMaker() = default;
0028     virtual ~StorageMaker() = default;
0029     // implicit copy constructor
0030     // implicit assignment operator
0031 
0032     virtual void stagein(const std::string &proto, const std::string &path, const AuxSettings &aux) const;
0033     virtual std::unique_ptr<Storage> open(const std::string &proto,
0034                                           const std::string &path,
0035                                           int mode,
0036                                           const AuxSettings &aux) const = 0;
0037     virtual bool check(const std::string &proto,
0038                        const std::string &path,
0039                        const AuxSettings &aux,
0040                        IOOffset *size = nullptr) const;
0041   };
0042 }  // namespace edm::storage
0043 #endif  // STORAGE_FACTORY_STORAGE_MAKER_H