Public Member Functions | Private Attributes
eip::serialization::BufferReader Class Reference

#include <buffer_reader.h>

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

List of all members.

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_

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 ( ) [inline, virtual]

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) [inline, virtual]

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) [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

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 
) [inline, virtual]

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) [inline, virtual]

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) [inline, virtual]

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.

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 Sat Jun 8 2019 20:21:23