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 
36  virtual IOSize read (void *into, IOSize n);
37  virtual IOSize readv (IOPosBuffer *into, IOSize buffers);
38  virtual IOSize write (const void *from, IOSize n);
39  virtual IOOffset position (IOOffset offset, Relative whence = SET);
40  virtual void resize (IOOffset size);
41  virtual void close (void);
42  virtual void abort (void);
43 
44 /*
45  * Note: we used to implement prefetch for RFIOFile, but it never got used in
46  * production due to memory leaks in the underlying library. This was removed
47  * in CMSSW 6 so we could default to storage-only if available.
48  */
49 
50 private:
51  ssize_t retryRead (void *into, IOSize n, int maxRetry = 10);
52  void reopen();
53 
55  bool m_close;
57  int m_flags;
58  int m_perms;
60 };
61 
62 #endif // RFIO_ADAPTOR_RFIO_FILE_H
bool m_close
Definition: RFIOFile.h:55
virtual void abort(void)
Definition: RFIOFile.cc:245
virtual IOSize write(const void *from, IOSize n)
Definition: RFIOFile.cc:363
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: Storage.cc:31
std::string m_name
Definition: RFIOFile.h:56
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
int m_flags
Definition: RFIOFile.h:57
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: RFIOFile.cc:355
virtual void open(const char *name, int flags=IOFlags::OpenRead, int perms=0666)
Definition: RFIOFile.cc:105
Relative
Definition: Storage.h:23
RFIOFile(void)
Definition: RFIOFile.cc:30
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:59
virtual void resize(IOOffset size)
Definition: RFIOFile.cc:414
virtual IOOffset position(void) const
Definition: Storage.cc:95
virtual void create(const char *name, bool exclusive=false, int perms=0666)
Definition: RFIOFile.cc:77
virtual void close(void)
Definition: RFIOFile.cc:201
int read(void)
Definition: IOInput.cc:54
ssize_t retryRead(void *into, IOSize n, int maxRetry=10)
Definition: RFIOFile.cc:269
void reopen()
Definition: RFIOFile.cc:255
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:59
int m_perms
Definition: RFIOFile.h:58
size_t IOSize
Definition: IOTypes.h:14
IOFD m_fd
Definition: RFIOFile.h:54
~RFIOFile(void)
Definition: RFIOFile.cc:66