#include <buffer_reader.h>
Public Member Functions | |
BufferReader (mutable_buffer buf) | |
virtual size_t | getByteCount () |
virtual mutable_buffer | readBuffer (size_t n) |
virtual void | readBuffer (mutable_buffer buf) |
virtual void | readBytes (void *buf, size_t n) |
virtual void * | readBytes (size_t n) |
virtual void | skip (size_t n) |
Private Attributes | |
mutable_buffer | buf_ |
size_t | byte_count_ |
Helper class to read values out of a buffer to assist in deserializing.
Definition at line 45 of file buffer_reader.h.
eip::serialization::BufferReader::BufferReader | ( | mutable_buffer | buf | ) | [inline] |
Create a reader to use the buffer given
buf | Buffer from which to read data |
Definition at line 53 of file buffer_reader.h.
virtual size_t eip::serialization::BufferReader::getByteCount | ( | ) | [inline, virtual] |
Get the number of bytes read from the buffer
Implements eip::serialization::Reader.
Definition at line 118 of file buffer_reader.h.
virtual mutable_buffer eip::serialization::BufferReader::readBuffer | ( | size_t | n | ) | [inline, virtual] |
Read a set of bytes from the buffer without copying.
n | number of bytes to read |
std::length_error | if the buffer is too small to contain that many bytes |
Definition at line 83 of file buffer_reader.h.
virtual void eip::serialization::BufferReader::readBuffer | ( | mutable_buffer | buf | ) | [inline, virtual] |
Read a set of bytes from the input buffer and copy into the given buffer. Automatically increases the number of bytes read and advances the pointer in the buffer
buf | Buffer into which to copy data |
std::length_error | if the buffer is too small to contain that many bytes |
Implements eip::serialization::Reader.
Definition at line 102 of file buffer_reader.h.
virtual void eip::serialization::BufferReader::readBytes | ( | void * | buf, |
size_t | n | ||
) | [inline, virtual] |
Copy a set of bytes from the buffer into a given buffer.
buf | Buffer into which to copy bytes |
n | Number of bytes to copy |
std::length_error | if the buffer is too small to contain that many bytes |
Implements eip::serialization::Reader.
Definition at line 61 of file buffer_reader.h.
virtual void* eip::serialization::BufferReader::readBytes | ( | size_t | n | ) | [inline, virtual] |
Read a set of bytes from the input buffer without copying
n | Number of bytes to read |
std::length_error | if the buffer is too small to contain that many bytes |
Definition at line 72 of file buffer_reader.h.
virtual void eip::serialization::BufferReader::skip | ( | size_t | n | ) | [inline, virtual] |
Skip forward in input by n bytes
n | number of bytes to skip forward |
std::length_error | if end of output buffer reached |
Implements eip::serialization::Reader.
Definition at line 128 of file buffer_reader.h.
mutable_buffer eip::serialization::BufferReader::buf_ [private] |
Definition at line 138 of file buffer_reader.h.
size_t eip::serialization::BufferReader::byte_count_ [private] |
Definition at line 139 of file buffer_reader.h.