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 {
19 public:
20  XrdFile (void);
21  XrdFile (IOFD fd);
22  XrdFile (const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
23  XrdFile (const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
24  ~XrdFile (void) override;
25 
26  virtual void create (const char *name,
27  bool exclusive = false,
28  int perms = 0666);
29  virtual void create (const std::string &name,
30  bool exclusive = false,
31  int perms = 0666);
32  virtual void open (const char *name,
34  int perms = 0666);
35  virtual void open (const std::string &name,
37  int perms = 0666);
38 
39  using Storage::read;
40  using Storage::readv;
41  using Storage::write;
42  using Storage::position;
43 
44  bool prefetch (const IOPosBuffer *what, IOSize n) override;
45  IOSize read (void *into, IOSize n) override;
46  IOSize read (void *into, IOSize n, IOOffset pos) override;
47  IOSize readv (IOBuffer *into, IOSize n) override;
48  IOSize readv (IOPosBuffer *into, IOSize n) override;
49  IOSize write (const void *from, IOSize n) override;
50  IOSize write (const void *from, IOSize n, IOOffset pos) override;
51 
52  IOOffset position (IOOffset offset, Relative whence = SET) override;
53  void resize (IOOffset size) override;
54 
55  void close (void) override;
56  virtual void abort (void);
57 
58 private:
59 
60  void addConnection(cms::Exception &);
61 
66  std::shared_ptr<XrdCl::File> getActiveFile();
67 
71  bool m_close;
73  std::atomic<unsigned int> m_op_count;
74 
75 };
76 
77 #endif // XRD_ADAPTOR_XRD_FILE_H
edm::propagate_const< std::shared_ptr< XrdAdaptor::RequestManager > > m_requestmanager
Definition: XrdFile.h:68
size
Write out results.
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: Storage.cc:31
def create(alignables, pedeDump, additionalData, outputFile, config)
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
bool m_close
Definition: XrdFile.h:71
IOOffset m_offset
Definition: XrdFile.h:69
Relative
Definition: Storage.h:23
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:59
virtual IOOffset position(void) const
Definition: Storage.cc:95
std::atomic< unsigned int > m_op_count
Definition: XrdFile.h:73
int read(void)
Definition: IOInput.cc:54
IOOffset m_size
Definition: XrdFile.h:70
std::string m_name
Definition: XrdFile.h:72
int64_t IOOffset
Definition: IOTypes.h:19
int IOFD
Definition: IOTypes.h:22
static int position[264][3]
Definition: ReadPGInfo.cc:509
size_t IOSize
Definition: IOTypes.h:14
def write(self, setup)