Apama
10.1.0.5
|
A class that holds an untyped byte buffer. More...
#include <buffer_t.hpp>
Inherits sag_underlying_buffer_t.
Public Member Functions | |
buffer_t () | |
Construct an empty buffer. More... | |
buffer_t (size_t n) | |
Construct a buffer with (at least) capacity for n items. More... | |
~buffer_t () | |
Free the underlying buffer contents. More... | |
buffer_t & | operator= (buffer_t &&other) |
Move assignment. More... | |
buffer_t (buffer_t &&other) | |
Move constructor. More... | |
void | swap (buffer_t &&other) |
Swap the contents of this buffer and other. More... | |
buffer_t | copy () const |
Return a deep copy of this buffer. More... | |
bool | operator== (const buffer_t &other) const |
Returns true if both buffers are the same size and have the same contents. More... | |
bool | operator!= (const buffer_t &other) const |
Returns true if both buffers are different sizes or have different contents. More... | |
iterator | begin () |
Forward iterator begin. More... | |
iterator | end () |
Forward iterator end. More... | |
const_iterator | begin () const |
Forward const_iterator begin. More... | |
const_iterator | end () const |
Forward const_iterator end. More... | |
const_iterator | cbegin () const |
Forward const_iterator begin. More... | |
const_iterator | cend () const |
Forward const_iterator end. More... | |
size_t | size () const |
Returns the size of the buffer. More... | |
bool | empty () const |
Returns true if the buffer is unallocated (size() == 0) More... | |
uint8_t & | operator[] (size_t n) |
Return a reference to the byte at the given offset. More... | |
const uint8_t & | operator[] (size_t n) const |
Return a reference the byte at the given offset. More... | |
void | clear () |
Free the underlying buffer;. More... | |
A class that holds an untyped byte buffer.
Iterators and indexing give access to the underlying byte[] which is guaranteed to be contiguous and at least as large as size().
This is moveable, but not implicitly copyable. If you want to copy it use the .copy() method. If you want to move it use std::move().
|
inline |
Construct an empty buffer.
|
explicit |
Construct a buffer with (at least) capacity for n items.
|
inline |
Free the underlying buffer contents.
|
inline |
Move constructor.
Other will be left as the empty buffer
|
inline |
Forward iterator begin.
|
inline |
Forward const_iterator begin.
|
inline |
Forward const_iterator begin.
|
inline |
Forward const_iterator end.
void buffer_t::clear | ( | ) |
Free the underlying buffer;.
buffer_t buffer_t::copy | ( | ) | const |
Return a deep copy of this buffer.
|
inline |
Returns true if the buffer is unallocated (size() == 0)
|
inline |
Forward iterator end.
|
inline |
Forward const_iterator end.
|
inline |
Returns true if both buffers are different sizes or have different contents.
Move assignment.
Other will be left as the empty buffer and our previous contents will be freed.
|
inline |
Returns true if both buffers are the same size and have the same contents.
|
inline |
Return a reference to the byte at the given offset.
If the offset is outside the buffer then throws std::runtime_error
|
inline |
Return a reference the byte at the given offset.
If the offset is outside the buffer then throws std::runtime_error
|
inline |
Returns the size of the buffer.
|
inline |
Swap the contents of this buffer and other.