Go to the documentation of this file.00001
00026 #ifndef ODVA_ETHERNETIP_SERIALIZATION_WRITER_H
00027 #define ODVA_ETHERNETIP_SERIALIZATION_WRITER_H
00028
00029 #include <boost/asio.hpp>
00030
00031 #include "odva_ethernetip/eip_types.h"
00032
00033 using boost::asio::const_buffer;
00034
00035 namespace eip {
00036 namespace serialization {
00037
00041 class Writer
00042 {
00043 public:
00044
00050 template <typename T> void write(const T& v)
00051 {
00052 writeBytes(&v, sizeof(v));
00053 }
00054
00061 virtual void writeBytes(const void* p, size_t n) = 0;
00062
00069 virtual void writeBuffer(const_buffer b) = 0;
00070
00075 virtual size_t getByteCount() = 0;
00076 };
00077
00078 }
00079 }
00080 #endif // ODVA_ETHERNETIP_SERIALIZATION_WRITER_H