Gobelijn API documentation
- generated for commit a0cbea7
|
A buffer of bytes, with a fixed size. More...
#include <buffer.h>
Public Member Functions | |
Buffer () | |
Creates a buffer class that manages an empty block of memory. More... | |
Buffer (size_t bufferSize) | |
Allocates a new buffer, which is the given number of bytes in size. More... | |
Buffer (const Buffer &other) | |
Creates a copy of the given buffer. More... | |
Buffer (Buffer &&other) noexcept | |
Moves the given buffer. More... | |
Buffer & | operator= (const Buffer &other) |
Creates a copy of the given buffer, and assigns that to this buffer. More... | |
Buffer & | operator= (Buffer &&other) noexcept |
Moves the given buffer's data to this buffer. More... | |
~Buffer () | |
Destructor. More... | |
size_t | GetSize () const |
Gets the buffer's size, in bytes. More... | |
char & | operator[] (size_t i) |
Indexed access. Returns reference to mutable char. More... | |
const char & | operator[] (size_t i) const |
Indexed access. Returns reference to a constant char. More... | |
Private Attributes | |
size_t | m_bufSize |
Stores the size of this buffer's memory block. More... | |
char * | m_data |
Stores a pointer to this buffer's memory block. More... | |
A buffer of bytes, with a fixed size.
Buffers manage a block of memory, which can be copied and moved. A Buffer's memory block is automatically released when it goes out of scope.
|
inline |
|
inlineexplicit |
Raii::Buffer::Buffer | ( | const Buffer & | other | ) |
Creates a copy of the given buffer.
Definition at line 24 of file buffer.cpp.
|
noexcept |
Moves the given buffer.
Definition at line 31 of file buffer.cpp.
|
inline |
Creates a copy of the given buffer, and assigns that to this buffer.
Definition at line 40 of file buffer.cpp.
Moves the given buffer's data to this buffer.
Definition at line 64 of file buffer.cpp.
|
inline |
Gets the buffer's size, in bytes.
Definition at line 55 of file buffer.h.
References m_bufSize.
Referenced by printBuffer().
|
inline |
|
inline |
|
private |
Stores the size of this buffer's memory block.
Definition at line 65 of file buffer.h.
Referenced by Buffer(), GetSize(), and operator=().
|
private |
Stores a pointer to this buffer's memory block.
Definition at line 68 of file buffer.h.
Referenced by Buffer(), operator=(), operator[](), and ~Buffer().