CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Storage.h
Go to the documentation of this file.
1 #ifndef STORAGE_FACTORY_STORAGE_H
2 # define STORAGE_FACTORY_STORAGE_H
3 
7 
8 class Storage : public virtual IOInput, public virtual IOOutput
9 {
10 public:
11  enum Relative { SET, CURRENT, END };
12 
13  Storage (void);
14  virtual ~Storage (void);
15 
16  using IOInput::read;
17  using IOInput::readv;
18  using IOOutput::write;
19  using IOOutput::writev;
20 
21  virtual bool prefetch (const IOPosBuffer *what, IOSize n);
22  virtual IOSize read (void *into, IOSize n, IOOffset pos);
24  virtual IOSize readv (IOPosBuffer *into, IOSize buffers);
25  virtual IOSize write (const void *from, IOSize n, IOOffset pos);
27  virtual IOSize writev (const IOPosBuffer *from, IOSize buffers);
28 
29  virtual bool eof (void) const;
30  virtual IOOffset size (void) const;
31  virtual IOOffset position (void) const;
32  virtual IOOffset position (IOOffset offset, Relative whence = SET) = 0;
33 
34  virtual void rewind (void);
35 
36  virtual void resize (IOOffset size) = 0;
37 
38  virtual void flush (void);
39  virtual void close (void);
40 
41 private:
42  // undefined, no semantics
43  Storage (const Storage &);
44  Storage &operator= (const Storage &);
45 };
46 
47 #endif // STORAGE_FACTORY_STORAGE_H
IOSize write(unsigned char byte)
Definition: IOOutput.cc:41
virtual ~Storage(void)
Definition: Storage.cc:8
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: Storage.cc:31
Storage & operator=(const Storage &)
Definition: Storage.h:8
virtual void resize(IOOffset size)=0
Relative
Definition: Storage.h:11
virtual IOSize readv(IOBuffer *into, IOSize buffers)
Definition: IOInput.cc:117
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:59
virtual void close(void)
Definition: Storage.cc:128
virtual IOOffset position(void) const
Definition: Storage.cc:95
virtual void flush(void)
Definition: Storage.cc:124
int read(void)
Definition: IOInput.cc:54
unsigned int offset(bool)
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
Definition: Storage.cc:119
static std::string from(" from ")
virtual IOSize writev(const IOBuffer *from, IOSize buffers)
Definition: IOOutput.cc:90
virtual IOOffset size(void) const
Definition: Storage.cc:102
int64_t IOOffset
Definition: IOTypes.h:19
size_t IOSize
Definition: IOTypes.h:14
virtual bool eof(void) const
Definition: Storage.cc:133
virtual void rewind(void)
Definition: Storage.cc:114
Definition: IOInput.h:7
Storage(void)
Definition: Storage.cc:5
virtual IOSize writev(const IOPosBuffer *from, IOSize buffers)
Definition: Storage.cc:74