A buffer of bytes, built on a byte-vector-like container. Provides methods for easily appending to the buffer (including alignment padding), and a nested class for reading from such a buffer.
More...
#include <osvr/Common/Buffer.h>
|
| Buffer () |
| Constructs an empty buffer.
|
|
| Buffer (ContainerType const &buf) |
| Constructs a buffer wrapper by copy-constructing the contained type.
|
|
template<typename InputIterator > |
| Buffer (InputIterator beginIt, InputIterator endIt) |
| Constructs a buffer by copying from two input iterators, representing a half-open range [beginIt, endIt) More...
|
|
template<typename T > |
void | append (T const v) |
| Append the binary representation of a value. More...
|
|
template<typename T > |
void | appendAligned (T const v, size_t const alignment) |
| Append the binary representation of a value, after adding the necessary number of padding bytes to begin the write at the given alignment within the buffer. More...
|
|
void | append (ElementType const *v, size_t const n) |
| Append a byte-array's contents.
|
|
void | appendAligned (ElementType const *v, size_t const n, size_t const alignment) |
| Append a byte-array's contents, after adding the necessary number of padding bytes to begin the write at the given alignment within the buffer.
|
|
void | appendPadding (size_t const bytes) |
| Append the specified number of bytes of padding.
|
|
Reader | startReading () const |
| Returns a reader object, for making a single read pass over the buffer. Do not modify this buffer during the lifetime of a reader!
|
|
size_t | size () const |
| Gets the current size, in bytes.
|
|
ContainerType & | getContents () |
| Provides access to the underlying container.
|
|
ElementType const * | data () const |
| Provides access to the underlying data.
|
|
template<typename ContainerType = BufferByteVector>
singleton osvr::common::Buffer< ContainerType >
A buffer of bytes, built on a byte-vector-like container. Provides methods for easily appending to the buffer (including alignment padding), and a nested class for reading from such a buffer.
Definition at line 206 of file Buffer.h.
template<typename ContainerType = BufferByteVector>
template<typename InputIterator >
Constructs a buffer by copying from two input iterators, representing a half-open range [beginIt, endIt)
Passed directly to contained type, so semantics are identical.
Definition at line 228 of file Buffer.h.
template<typename ContainerType = BufferByteVector>
template<typename T >
Append the binary representation of a value.
The value cannot be a pointer here.
Safe to do without violating strict aliasing because ElementType is a character type.
Definition at line 234 of file Buffer.h.
template<typename ContainerType = BufferByteVector>
template<typename T >
Append the binary representation of a value, after adding the necessary number of padding bytes to begin the write at the given alignment within the buffer.
The value cannot be a pointer here.
Definition at line 249 of file Buffer.h.
The documentation for this singleton was generated from the following file: