CMS 3D CMS Logo

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