Provides for a single reading pass over a buffer.
More...
#include <Buffer.h>
|
typedef ContainerType::const_iterator | const_iterator |
|
typedef ContainerType::value_type | ElementType |
|
|
| BufferReader (ContainerType const &buf) |
|
size_t | bytesRead () const |
|
size_t | bytesRemaining () const |
|
template<typename T > |
void | read (T &v) |
| Get the binary representation of a type from a buffer. More...
|
|
const_iterator | readBytes (size_t const n) |
| Returns an iterator into the buffer valid for n elements, and assumes you'll take care of copying them. More...
|
|
template<typename T > |
void | readAligned (T &v, size_t const alignment) |
| Get the binary representation of a type from a buffer, after skipping the necessary number of bytes to begin the read at the given alignment. More...
|
|
const_iterator | readBytesAligned (size_t const n, size_t const alignment) |
| Returns an iterator into the buffer valid for n elements, after skipping the necessary number of bytes to begin the read at the given alignment, and assumes you'll take care of copying them. More...
|
|
void | skipPadding (size_t const bytes) |
| Skip reading the given number of bytes, assumed to be padding. More...
|
|
template<typename ContainerType>
class osvr::common::BufferReader< ContainerType >
Provides for a single reading pass over a buffer.
It is important that the buffer not change while a Reader obtained from it is still in scope.
Get one by calling Buffer::startReading()
§ read()
template<typename ContainerType>
template<typename T >
Get the binary representation of a type from a buffer.
Safe to do without violating strict aliasing because ElementType is a character type.
§ readAligned()
template<typename ContainerType>
template<typename T >
Get the binary representation of a type from a buffer, after skipping the necessary number of bytes to begin the read at the given alignment.
§ readBytes()
template<typename ContainerType>
Returns an iterator into the buffer valid for n elements, and assumes you'll take care of copying them.
§ readBytesAligned()
template<typename ContainerType>
Returns an iterator into the buffer valid for n elements, after skipping the necessary number of bytes to begin the read at the given alignment, and assumes you'll take care of copying them.
§ skipPadding()
template<typename ContainerType>
Skip reading the given number of bytes, assumed to be padding.
The documentation for this class was generated from the following file: