CMS 3D CMS Logo

Storage.h
Go to the documentation of this file.
1 #ifndef STORAGE_FACTORY_STORAGE_H
2 #define STORAGE_FACTORY_STORAGE_H
3 
7 
8 //
9 // ROOT will probe for prefetching support by calling
10 // ReadBufferAsync(0, 0)
11 // Storage turns this into:
12 // prefetch(0, PREFETCH_PROBE_LENGTH)
13 //
14 // For example, if the Storage implementation wants to provide a prefetch
15 // implementation, but prefers it not to be used by default, it
16 // should detect the probe and return true.
17 //
18 #define PREFETCH_PROBE_LENGTH 4096
19 
20 class Storage : public virtual IOInput, public virtual IOOutput {
21 public:
22  enum Relative { SET, CURRENT, END };
23 
24  Storage(void);
25 
26  // undefined, no semantics
27  Storage(const Storage &) = delete;
28  Storage &operator=(const Storage &) = delete;
29 
30  ~Storage(void) override;
31 
32  using IOInput::read;
33  using IOInput::readv;
34  using IOOutput::write;
35  using IOOutput::writev;
36 
37  virtual bool prefetch(const IOPosBuffer *what, IOSize n);
38  virtual IOSize read(void *into, IOSize n, IOOffset pos);
40  virtual IOSize readv(IOPosBuffer *into, IOSize buffers);
41  virtual IOSize write(const void *from, IOSize n, IOOffset pos);
43  virtual IOSize writev(const IOPosBuffer *from, IOSize buffers);
44 
45  virtual bool eof(void) const;
46  virtual IOOffset size(void) const;
47  virtual IOOffset position(void) const;
48  virtual IOOffset position(IOOffset offset, Relative whence = SET) = 0;
49 
50  virtual void rewind(void);
51 
52  virtual void resize(IOOffset size) = 0;
53 
54  virtual void flush(void);
55  virtual void close(void);
56 };
57 
58 #endif // STORAGE_FACTORY_STORAGE_H
Storage::size
virtual IOOffset size(void) const
Definition: Storage.cc:77
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
pos
Definition: PixelAliasList.h:18
Storage::eof
virtual bool eof(void) const
Definition: Storage.cc:98
Storage::END
Definition: Storage.h:22
IOOutput.h
Storage::SET
Definition: Storage.h:22
Storage::Relative
Relative
Definition: Storage.h:22
Storage::readv
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: Storage.cc:24
IOInput::readv
virtual IOSize readv(IOBuffer *into, IOSize buffers)
Definition: IOInput.cc:111
IOOutput
Definition: IOOutput.h:7
IOOutput::writev
virtual IOSize writev(const IOBuffer *from, IOSize buffers)
Definition: IOOutput.cc:84
IOInput.h
Storage::resize
virtual void resize(IOOffset size)=0
IOBuffer
Definition: IOBuffer.h:7
Storage::rewind
virtual void rewind(void)
Definition: Storage.cc:87
IOOffset
int64_t IOOffset
Definition: IOTypes.h:19
Storage::Storage
Storage(void)
Definition: Storage.cc:5
IOInput
Definition: IOInput.h:7
Storage::~Storage
~Storage(void) override
Definition: Storage.cc:7
Storage::flush
virtual void flush(void)
Definition: Storage.cc:93
Storage::prefetch
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
Definition: Storage.cc:90
Storage::writev
virtual IOSize writev(const IOPosBuffer *from, IOSize buffers)
Definition: Storage.cc:57
Storage::position
virtual IOOffset position(void) const
Definition: Storage.cc:72
IOInput::read
int read(void)
Definition: IOInput.cc:52
Storage::close
virtual void close(void)
Definition: Storage.cc:95
IOPosBuffer.h
Storage::CURRENT
Definition: Storage.h:22
IOOutput::write
IOSize write(unsigned char byte)
Definition: IOOutput.cc:39
IOPosBuffer
Definition: IOPosBuffer.h:7
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
IOSize
size_t IOSize
Definition: IOTypes.h:14
Storage
Definition: Storage.h:20
Storage::write
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:44
Storage::operator=
Storage & operator=(const Storage &)=delete