CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IOPosBuffer.h
Go to the documentation of this file.
1 #ifndef STORAGE_FACTORY_IO_POS_BUFFER_H
2 # define STORAGE_FACTORY_IO_POS_BUFFER_H
3 
5 
7 struct IOPosBuffer
8 {
9 public:
10  IOPosBuffer (void);
11  IOPosBuffer (IOOffset offset, void *data, IOSize length);
12  IOPosBuffer (IOOffset offset, const void *data, IOSize length);
13 
14  IOOffset offset (void) const;
15  void * data (void) const;
16  IOSize size (void) const;
17 
18  void set_offset (IOOffset new_offset);
19  void set_data (void * new_buffer);
20  void set_size (IOSize new_size);
21 
22 private:
23  IOOffset m_offset; //< File offset.
24  void *m_data; //< Data
25  IOSize m_length; //< Length of data in bytes.
26 };
27 
29 inline
31  : m_offset (0),
32  m_data (0),
33  m_length (0)
34 {}
35 
37 inline
39  : m_offset (offset),
40  m_data (data),
41  m_length (length)
42 {}
43 
45 inline
47  : m_offset (offset),
48  m_data (const_cast<void *> (data)),
49  m_length (length)
50 {}
51 
53 inline IOOffset
54 IOPosBuffer::offset (void) const
55 { return m_offset; }
56 
58 inline void *
59 IOPosBuffer::data (void) const
60 { return m_data; }
61 
63 inline IOSize
64 IOPosBuffer::size (void) const
65 { return m_length; }
66 
68 inline void
70 { m_offset = new_offset; }
71 
73 inline void
74 IOPosBuffer::set_data(void * new_data)
75 { m_data = new_data; }
76 
78 inline void
80 { m_length = new_length; }
81 
82 #endif // STORAGE_FACTORY_IO_POS_BUFFER_H
IOSize m_length
Definition: IOPosBuffer.h:25
IOOffset m_offset
Definition: IOPosBuffer.h:23
IOPosBuffer(void)
Definition: IOPosBuffer.h:30
void set_data(void *new_buffer)
Definition: IOPosBuffer.h:74
void set_size(IOSize new_size)
Definition: IOPosBuffer.h:79
void set_offset(IOOffset new_offset)
Definition: IOPosBuffer.h:69
IOOffset offset(void) const
Definition: IOPosBuffer.h:54
void * m_data
Definition: IOPosBuffer.h:24
void * data(void) const
Definition: IOPosBuffer.h:59
IOSize size(void) const
Definition: IOPosBuffer.h:64
int64_t IOOffset
Definition: IOTypes.h:19
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
size_t IOSize
Definition: IOTypes.h:14