include
odva_ethernetip
serialization
reader.h
Go to the documentation of this file.
1
26
#ifndef ODVA_ETHERNETIP_SERIALIZATION_READER_H
27
#define ODVA_ETHERNETIP_SERIALIZATION_READER_H
28
29
#include <stdexcept>
30
#include <boost/asio.hpp>
31
32
#include "
odva_ethernetip/eip_types.h
"
33
34
using
boost::asio::mutable_buffer;
35
36
namespace
eip
{
37
namespace
serialization {
38
42
class
Reader
43
{
44
public
:
45
51
template
<
typename
T>
void
read
(T& v)
52
{
53
readBytes
(&v,
sizeof
(v));
54
}
55
63
virtual
void
readBytes
(
void
* buf,
size_t
n) = 0;
64
69
virtual
void
readBuffer
(mutable_buffer buf) = 0;
70
75
virtual
size_t
getByteCount
() = 0;
76
82
virtual
void
skip
(
size_t
n) = 0;
83
};
84
85
}
// namespace serialization
86
}
// namespace eip
87
#endif // ODVA_ETHERNETIP_SERIALIZATION_READER_H
eip_types.h
eip::serialization::Reader
Definition:
reader.h:42
eip
Definition:
connection.h:41
eip::serialization::Reader::getByteCount
virtual size_t getByteCount()=0
eip::serialization::Reader::read
void read(T &v)
Definition:
reader.h:51
eip::serialization::Reader::skip
virtual void skip(size_t n)=0
eip::serialization::Reader::readBuffer
virtual void readBuffer(mutable_buffer buf)=0
eip::serialization::Reader::readBytes
virtual void readBytes(void *buf, size_t n)=0
odva_ethernetip
Author(s): Kareem Shehata
autogenerated on Wed Mar 2 2022 00:38:56