writer.h
Go to the documentation of this file.
1 
26 #ifndef ODVA_ETHERNETIP_SERIALIZATION_WRITER_H
27 #define ODVA_ETHERNETIP_SERIALIZATION_WRITER_H
28 
29 #include <boost/asio.hpp>
30 
32 
33 using boost::asio::const_buffer;
34 
35 namespace eip {
36 namespace serialization {
37 
41 class Writer
42 {
43 public:
44 
50  template <typename T> void write(const T& v)
51  {
52  writeBytes(&v, sizeof(v));
53  }
54 
61  virtual void writeBytes(const void* p, size_t n) = 0;
62 
69  virtual void writeBuffer(const_buffer b) = 0;
70 
75  virtual size_t getByteCount() = 0;
76 };
77 
78 } // namespace serialization
79 } // namespace eip
80 #endif // ODVA_ETHERNETIP_SERIALIZATION_WRITER_H
void write(const T &v)
Definition: writer.h:50
virtual size_t getByteCount()=0
Definition: connection.h:41
virtual void writeBuffer(const_buffer b)=0
virtual void writeBytes(const void *p, size_t n)=0


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