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

#include <stream_reader.h>

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

Public Member Functions

size_t getByteCount ()
 
void readBuffer (mutable_buffer buf)
 
void readBytes (void *buf, size_t n)
 
virtual void skip (size_t n)
 
 StreamReader (shared_ptr< istream > isp)
 
- Public Member Functions inherited from eip::serialization::Reader
template<typename T >
void read (T &v)
 

Private Attributes

shared_ptr< istream > isp_
 

Detailed Description

Helper class to read values out of a stream to assist in deserializing. Really just an adapter so that classes can use the Reader interface for all deserialization tasks.

Definition at line 49 of file stream_reader.h.

Constructor & Destructor Documentation

eip::serialization::StreamReader::StreamReader ( shared_ptr< istream >  isp)
inline

Create a reader to use the input stream given

Parameters
ispInput stream to use for inputs

Definition at line 57 of file stream_reader.h.

Member Function Documentation

size_t eip::serialization::StreamReader::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 83 of file stream_reader.h.

void eip::serialization::StreamReader::readBuffer ( mutable_buffer  buf)
inlinevirtual

Read a set of bytes into the given buffer

Parameters
bufBuffer to use for reading
Exceptions
std::length_errorif the buffer is too small to contain that many bytes

Implements eip::serialization::Reader.

Definition at line 74 of file stream_reader.h.

void eip::serialization::StreamReader::readBytes ( void *  buf,
size_t  n 
)
inlinevirtual

Read a set of bytes from the reader into a given buffer

Parameters
bufBuffer into which to copy bytes
nnumber of bytes to read

Implements eip::serialization::Reader.

Definition at line 64 of file stream_reader.h.

virtual void eip::serialization::StreamReader::skip ( size_t  n)
inlinevirtual

Skip forward in input by n bytes

Parameters
nnumber of bytes to skip forward

Implements eip::serialization::Reader.

Definition at line 92 of file stream_reader.h.

Member Data Documentation

shared_ptr<istream> eip::serialization::StreamReader::isp_
private

Definition at line 97 of file stream_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