CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RFIOFile.h
Go to the documentation of this file.
1 #ifndef RFIO_ADAPTOR_RFIO_FILE_H
2 #define RFIO_ADAPTOR_RFIO_FILE_H
3 
6 # include <string>
7 
9 class RFIOFile : public Storage
10 {
11 public:
12  RFIOFile (void);
13  RFIOFile (IOFD fd);
14  RFIOFile (const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
15  RFIOFile (const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
16  ~RFIOFile (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  using Storage::prefetch;
36 
37  virtual bool prefetch (const IOPosBuffer *what, IOSize n);
38  virtual IOSize read (void *into, IOSize n);
39  virtual IOSize readv (IOPosBuffer *into, IOSize buffers);
40  virtual IOSize write (const void *from, IOSize n);
41  virtual IOOffset position (IOOffset offset, Relative whence = SET);
42  virtual void resize (IOOffset size);
43  virtual void close (void);
44  virtual void abort (void);
45 
46 private:
47  ssize_t retryRead (void *into, IOSize n, int maxRetry = 10);
48  void reopen();
49 
51  bool m_close;
52  std::string m_name;
53  int m_flags;
54  int m_perms;
56 };
57 
58 #endif // RFIO_ADAPTOR_RFIO_FILE_H
bool m_close
Definition: RFIOFile.h:51
virtual void abort(void)
Definition: RFIOFile.cc:234
virtual IOSize write(const void *from, IOSize n)
Definition: RFIOFile.cc:350
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: Storage.cc:31
std::string m_name
Definition: RFIOFile.h:52
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
Definition: Storage.h:8
int m_flags
Definition: RFIOFile.h:53
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: RFIOFile.cc:342
virtual void open(const char *name, int flags=IOFlags::OpenRead, int perms=0666)
Definition: RFIOFile.cc:104
Relative
Definition: Storage.h:11
RFIOFile(void)
Definition: RFIOFile.cc:29
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:59
virtual void resize(IOOffset size)
Definition: RFIOFile.cc:393
virtual IOOffset position(void) const
Definition: Storage.cc:95
virtual void create(const char *name, bool exclusive=false, int perms=0666)
Definition: RFIOFile.cc:76
virtual void close(void)
Definition: RFIOFile.cc:190
int read(void)
Definition: IOInput.cc:54
unsigned int offset(bool)
ssize_t retryRead(void *into, IOSize n, int maxRetry=10)
Definition: RFIOFile.cc:258
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
Definition: Storage.cc:119
static std::string from(" from ")
void reopen()
Definition: RFIOFile.cc:244
virtual IOOffset size(void) const
Definition: Storage.cc:102
int64_t IOOffset
Definition: IOTypes.h:19
int IOFD
Definition: IOTypes.h:22
IOOffset m_curpos
Definition: RFIOFile.h:55
int m_perms
Definition: RFIOFile.h:54
size_t IOSize
Definition: IOTypes.h:14
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
Definition: RFIOFile.cc:400
IOFD m_fd
Definition: RFIOFile.h:50
~RFIOFile(void)
Definition: RFIOFile.cc:65