CMS 3D CMS Logo

LStoreStorageMaker.cc
Go to the documentation of this file.
7 #include <unistd.h>
8 #include <iostream>
9 
10 namespace edm::storage {
12  public:
15  std::unique_ptr<Storage> open(const std::string &proto,
16  const std::string &path,
17  int mode,
18  const AuxSettings &) const override {
19  std::string fullpath = proto + ":" + path;
20  return std::make_unique<LStoreFile>(fullpath, mode);
21  }
22 
23  /* I don't think this is necessary - Melo
24  virtual void stagein (const std::string &proto, const std::string &path)
25  {
26  std::string fullpath(proto + ":" + path);
27  XrdClientAdmin admin(fullpath.c_str());
28  if (admin.Connect())
29  {
30  XrdOucString str(fullpath.c_str());
31  XrdClientUrlSet url(str);
32  admin.Prepare(url.GetFile().c_str(), kXR_stage | kXR_noerrs, 0);
33  }
34  }
35 */
36 
37  bool check(const std::string &proto,
38  const std::string &path,
39  const AuxSettings &,
40  IOOffset *size = nullptr) const override {
41  std::string fullpath = proto + ":" + path;
42  try {
43  LStoreFile fileObj(fullpath); // = LStoreFile (fullpath);
44  *size = fileObj.position(0, Storage::END);
45  } catch (cms::Exception &e) {
46  return false;
47  }
48  return true;
49  }
50  };
51 } // namespace edm::storage
52 
53 using namespace edm::storage;
size
Write out results.
int64_t IOOffset
Definition: IOTypes.h:20
std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &) const override
IOOffset position(IOOffset offset, Relative whence=SET) override
Definition: LStoreFile.cc:265
bool check(const std::string &proto, const std::string &path, const AuxSettings &, IOOffset *size=nullptr) const override
#define DEFINE_EDM_PLUGIN(factory, type, name)