CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
6 namespace edm::storage {
7 
9  struct IOPosBuffer {
10  public:
11  IOPosBuffer();
12  IOPosBuffer(IOOffset offset, void *data, IOSize length);
13  IOPosBuffer(IOOffset offset, const void *data, IOSize length);
14 
15  IOOffset offset() const;
16  void *data() const;
17  IOSize size() const;
18 
19  void set_offset(IOOffset new_offset);
20  void set_data(void *new_buffer);
21  void set_size(IOSize new_size);
22 
23  private:
24  IOOffset m_offset; //< File offset.
25  void *m_data; //< Data
26  IOSize m_length; //< Length of data in bytes.
27  };
28 
30  inline IOPosBuffer::IOPosBuffer(void) : m_offset(0), m_data(nullptr), m_length(0) {}
31 
34  : m_offset(offset), m_data(data), m_length(length) {}
35 
37  inline IOPosBuffer::IOPosBuffer(IOOffset offset, const void *data, IOSize length)
38  : m_offset(offset), m_data(const_cast<void *>(data)), m_length(length) {}
39 
41  inline IOOffset IOPosBuffer::offset(void) const { return m_offset; }
42 
44  inline void *IOPosBuffer::data(void) const { return m_data; }
45 
47  inline IOSize IOPosBuffer::size(void) const { return m_length; }
48 
50  inline void IOPosBuffer::set_offset(IOOffset new_offset) { m_offset = new_offset; }
51 
53  inline void IOPosBuffer::set_data(void *new_data) { m_data = new_data; }
54 
56  inline void IOPosBuffer::set_size(IOSize new_length) { m_length = new_length; }
57 } // namespace edm::storage
58 #endif // STORAGE_FACTORY_IO_POS_BUFFER_H
int64_t IOOffset
Definition: IOTypes.h:20
void * data() const
Definition: IOPosBuffer.h:44
IOSize size() const
Definition: IOPosBuffer.h:47
void set_size(IOSize new_size)
Definition: IOPosBuffer.h:56
void set_offset(IOOffset new_offset)
Definition: IOPosBuffer.h:50
size_t IOSize
Definition: IOTypes.h:15
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void set_data(void *new_buffer)
Definition: IOPosBuffer.h:53
IOOffset offset() const
Definition: IOPosBuffer.h:41