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 
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
virtual void readBuffer(mutable_buffer buf)=0
virtual void skip(size_t n)=0
Definition: connection.h:41
virtual void readBytes(void *buf, size_t n)=0
virtual size_t getByteCount()=0


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