CMS 3D CMS Logo

IOBuffer.h
Go to the documentation of this file.
1 #ifndef STORAGE_FACTORY_IO_BUFFER_H
2 #define STORAGE_FACTORY_IO_BUFFER_H
3 
5 
7 class IOBuffer {
8 public:
9  IOBuffer(void);
10  IOBuffer(void *data, IOSize length);
11  IOBuffer(const void *data, IOSize length);
12 
13  void *data(void) const;
14  IOSize size(void) const;
15 
16 private:
17  void *m_data; //< Data
18  IOSize m_length; //< Length of data in bytes.
19 };
20 
22 inline IOBuffer::IOBuffer(void) : m_data(nullptr), m_length(0) {}
23 
25 inline IOBuffer::IOBuffer(void *data, IOSize length) : m_data(data), m_length(length) {}
26 
28 inline IOBuffer::IOBuffer(const void *data, IOSize length) : m_data(const_cast<void *>(data)), m_length(length) {}
29 
31 inline void *IOBuffer::data(void) const { return m_data; }
32 
34 inline IOSize IOBuffer::size(void) const { return m_length; }
35 
36 #endif // STORAGE_FACTORY_IO_BUFFER_H
void * data(void) const
Definition: IOBuffer.h:31
#define nullptr
void * m_data
Definition: IOBuffer.h:17
IOSize size(void) const
Definition: IOBuffer.h:34
IOBuffer(void)
Definition: IOBuffer.h:22
size_t IOSize
Definition: IOTypes.h:14
IOSize m_length
Definition: IOBuffer.h:18