CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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);
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  virtual bool prefetch (const IOPosBuffer *what, IOSize n);
45  virtual IOSize read (void *into, IOSize n);
46  virtual IOSize read (void *into, IOSize n, IOOffset pos);
47  virtual IOSize readv (IOBuffer *into, IOSize n);
48  virtual IOSize readv (IOPosBuffer *into, IOSize n);
49  virtual IOSize write (const void *from, IOSize n);
50  virtual IOSize write (const void *from, IOSize n, IOOffset pos);
51 
52  virtual IOOffset position (IOOffset offset, Relative whence = SET);
53  virtual void resize (IOOffset size);
54 
55  virtual void close (void);
56  virtual void abort (void);
57 
58 private:
59 
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
virtual void resize(IOOffset size)
Definition: XrdFile.cc:539
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: Storage.cc:31
virtual void close(void)
Definition: XrdFile.cc:194
virtual void create(const char *name, bool exclusive=false, int perms=0666)
Definition: XrdFile.cc:63
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 bool prefetch(const IOPosBuffer *what, IOSize n)
Definition: XrdFile.cc:485
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:59
XrdFile(void)
Definition: XrdFile.cc:20
virtual IOOffset position(void) const
Definition: Storage.cc:95
tuple fd
Definition: ztee.py:136
std::atomic< unsigned int > m_op_count
Definition: XrdFile.h:73
virtual IOSize readv(IOBuffer *into, IOSize n)
Definition: XrdFile.cc:259
int read(void)
Definition: IOInput.cc:54
std::shared_ptr< XrdCl::File > getActiveFile()
Definition: XrdFile.cc:549
IOOffset m_size
Definition: XrdFile.h:70
std::string m_name
Definition: XrdFile.h:72
~XrdFile(void)
Definition: XrdFile.cc:53
virtual IOOffset size(void) const
Definition: Storage.cc:102
int64_t IOOffset
Definition: IOTypes.h:19
int IOFD
Definition: IOTypes.h:22
size_t IOSize
Definition: IOTypes.h:14
void addConnection(cms::Exception &)
Definition: XrdFile.cc:564
virtual void open(const char *name, int flags=IOFlags::OpenRead, int perms=0666)
Definition: XrdFile.cc:91
virtual IOSize write(const void *from, IOSize n)
Definition: XrdFile.cc:424
virtual void abort(void)
Definition: XrdFile.cc:214