Public Member Functions | Private Attributes | List of all members
eip::serialization::BufferReader Class Reference

#include <buffer_reader.h>

Inheritance diagram for eip::serialization::BufferReader:
Inheritance graph
[legend]

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)
 
- Public Member Functions inherited from eip::serialization::Reader
template<typename T >
void read (T &v)
 

Private Attributes

mutable_buffer buf_
 
size_t byte_count_
 

Detailed Description

Helper class to read values out of a buffer to assist in deserializing.

Definition at line 45 of file buffer_reader.h.

Constructor & Destructor Documentation

eip::serialization::BufferReader::BufferReader ( mutable_buffer  buf)
inline

Create a reader to use the buffer given

Parameters
bufBuffer from which to read data

Definition at line 53 of file buffer_reader.h.

Member Function Documentation

virtual size_t eip::serialization::BufferReader::getByteCount ( )
inlinevirtual

Get the number of bytes read from the buffer

Returns
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)
inlinevirtual

Read a set of bytes from the buffer without copying.

Parameters
nnumber of bytes to read
Returns
buffer of resulting data
Exceptions
std::length_errorif 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)
inlinevirtual

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

Parameters
bufBuffer into which to copy data
Exceptions
std::length_errorif 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 
)
inlinevirtual

Copy a set of bytes from the buffer into a given buffer.

Parameters
bufBuffer into which to copy bytes
nNumber of bytes to copy
Exceptions
std::length_errorif 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)
inlinevirtual

Read a set of bytes from the input buffer without copying

Parameters
nNumber of bytes to read
Returns
pointer into the output buffer
Exceptions
std::length_errorif 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)
inlinevirtual

Skip forward in input by n bytes

Parameters
nnumber of bytes to skip forward
Exceptions
std::length_errorif end of output buffer reached

Implements eip::serialization::Reader.

Definition at line 128 of file buffer_reader.h.

Member Data Documentation

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.


The documentation for this class was generated from the following file:


odva_ethernetip
Author(s): Kareem Shehata
autogenerated on Mon Jun 10 2019 14:00:16