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
eip::serialization::Writer
Definition: writer.h:41
eip_types.h
eip
Definition: connection.h:41
eip::serialization::Writer::write
void write(const T &v)
Definition: writer.h:50
eip::serialization::Writer::writeBytes
virtual void writeBytes(const void *p, size_t n)=0
eip::serialization::Writer::writeBuffer
virtual void writeBuffer(const_buffer b)=0
eip::serialization::Writer::getByteCount
virtual size_t getByteCount()=0


odva_ethernetip
Author(s): Kareem Shehata
autogenerated on Wed Mar 2 2022 00:38:56