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. More...
#include <osvr/Common/Buffer.h>
Public Types | |
typedef ContainerType::const_iterator | const_iterator |
typedef ContainerType::value_type | ElementType |
Public Member Functions | |
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. | |
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. | |
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. | |
void | skipPadding (size_t const bytes) |
Skip reading the given number of bytes, assumed to be padding. | |
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()
|
inline |