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 XRD_ADAPTOR_XRD_FILE_H
2 # define XRD_ADAPTOR_XRD_FILE_H
3 
6 # include "XrdClient/XrdClient.hh"
7 # include <string>
8 
9 class XrdFile : public Storage
10 {
11 public:
12  XrdFile (void);
13  XrdFile (IOFD fd);
14  XrdFile (const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
15  XrdFile (const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
16  ~XrdFile (void);
17 
18  virtual void create (const char *name,
19  bool exclusive = false,
20  int perms = 0666);
21  virtual void create (const std::string &name,
22  bool exclusive = false,
23  int perms = 0666);
24  virtual void open (const char *name,
26  int perms = 0666);
27  virtual void open (const std::string &name,
29  int perms = 0666);
30 
31  using Storage::read;
32  using Storage::readv;
33  using Storage::write;
34  using Storage::position;
35 
36  virtual bool prefetch (const IOPosBuffer *what, IOSize n);
37  virtual IOSize read (void *into, IOSize n);
38  virtual IOSize read (void *into, IOSize n, IOOffset pos);
39  virtual IOSize readv (IOBuffer *into, IOSize n);
40  virtual IOSize readv (IOPosBuffer *into, IOSize n);
41  virtual IOSize write (const void *from, IOSize n);
42  virtual IOSize write (const void *from, IOSize n, IOOffset pos);
43 
44  virtual IOOffset position (IOOffset offset, Relative whence = SET);
45  virtual void resize (IOOffset size);
46 
47  virtual void close (void);
48  virtual void abort (void);
49 
50 private:
51  XrdClient *m_client;
53  XrdClientStatInfo m_stat;
54  bool m_close;
55  std::string m_name;
56 };
57 
58 #endif // XRD_ADAPTOR_XRD_FILE_H
virtual void resize(IOOffset size)
Definition: XrdFile.cc:394
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: Storage.cc:31
virtual void close(void)
Definition: XrdFile.cc:132
XrdClientStatInfo m_stat
Definition: XrdFile.h:53
virtual void create(const char *name, bool exclusive=false, int perms=0666)
Definition: XrdFile.cc:38
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
Definition: Storage.h:8
bool m_close
Definition: XrdFile.h:54
IOOffset m_offset
Definition: XrdFile.h:52
Relative
Definition: Storage.h:11
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
Definition: XrdFile.cc:348
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:59
XrdFile(void)
Definition: XrdFile.cc:6
virtual IOOffset position(void) const
Definition: Storage.cc:95
virtual IOSize readv(IOBuffer *into, IOSize n)
Definition: XrdFile.cc:206
int read(void)
Definition: IOInput.cc:54
unsigned int offset(bool)
XrdClient * m_client
Definition: XrdFile.h:51
std::string m_name
Definition: XrdFile.h:55
static std::string from(" from ")
~XrdFile(void)
Definition: XrdFile.cc:28
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
virtual void open(const char *name, int flags=IOFlags::OpenRead, int perms=0666)
Definition: XrdFile.cc:66
Definition: XrdFile.h:9
virtual IOSize write(const void *from, IOSize n)
Definition: XrdFile.cc:305
virtual void abort(void)
Definition: XrdFile.cc:158