CMS 3D CMS Logo

XrdFile.h
Go to the documentation of this file.
1 #ifndef Utilities_XrdAdaptor_XrdFile_h
2 #define Utilities_XrdAdaptor_XrdFile_h
3 
8 #include "XrdCl/XrdClFile.hh"
9 #include <string>
10 #include <memory>
11 #include <atomic>
12 
13 namespace XrdAdaptor {
14  class RequestManager;
15 }
16 
17 class XrdFile : public Storage {
18 public:
19  XrdFile(void);
20  XrdFile(IOFD fd);
21  XrdFile(const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
22  XrdFile(const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
23  ~XrdFile(void) override;
24 
25  virtual void create(const char *name, bool exclusive = false, int perms = 0666);
26  virtual void create(const std::string &name, bool exclusive = false, int perms = 0666);
27  virtual void open(const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
28  virtual void open(const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
29 
30  using Storage::position;
31  using Storage::read;
32  using Storage::readv;
33  using Storage::write;
34 
35  bool prefetch(const IOPosBuffer *what, IOSize n) override;
36  IOSize read(void *into, IOSize n) override;
37  IOSize read(void *into, IOSize n, IOOffset pos) override;
38  IOSize readv(IOBuffer *into, IOSize n) override;
39  IOSize readv(IOPosBuffer *into, IOSize n) override;
40  IOSize write(const void *from, IOSize n) override;
41  IOSize write(const void *from, IOSize n, IOOffset pos) override;
42 
43  IOOffset position(IOOffset offset, Relative whence = SET) override;
44  void resize(IOOffset size) override;
45 
46  void close(void) override;
47  virtual void abort(void);
48 
49 private:
50  void addConnection(cms::Exception &);
51 
56  std::shared_ptr<XrdCl::File> getActiveFile();
57 
61  bool m_close;
63  std::atomic<unsigned int> m_op_count;
64 };
65 
66 #endif // XRD_ADAPTOR_XRD_FILE_H
edm::propagate_const< std::shared_ptr< XrdAdaptor::RequestManager > > m_requestmanager
Definition: XrdFile.h:58
size
Write out results.
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: Storage.cc:24
def create(alignables, pedeDump, additionalData, outputFile, config)
bool m_close
Definition: XrdFile.h:61
IOOffset m_offset
Definition: XrdFile.h:59
Relative
Definition: Storage.h:22
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:44
virtual IOOffset position(void) const
Definition: Storage.cc:72
std::atomic< unsigned int > m_op_count
Definition: XrdFile.h:63
int read(void)
Definition: IOInput.cc:52
IOOffset m_size
Definition: XrdFile.h:60
std::string m_name
Definition: XrdFile.h:62
int64_t IOOffset
Definition: IOTypes.h:19
int IOFD
Definition: IOTypes.h:22
static int position[264][3]
Definition: ReadPGInfo.cc:289
size_t IOSize
Definition: IOTypes.h:14
fd
Definition: ztee.py:136