26 #ifndef ODVA_ETHERNETIP_SERIALIZATION_SERIALIZABLE_BUFFER_H 27 #define ODVA_ETHERNETIP_SERIALIZATION_SERIALIZABLE_BUFFER_H 29 #include <boost/asio.hpp> 36 using boost::asio::mutable_buffer;
37 using boost::asio::buffer_size;
40 namespace serialization {
64 data_ = mutable_buffer(NULL, 0);
73 return buffer_size(
data_);
129 if (length != buffer_size(
data_))
168 if (allocated_buffer_)
171 allocated_buffer_ = NULL;
178 #endif // ODVA_ETHERNETIP_SERIALIZATION_SERIALIZABLE_BUFFER_H virtual size_t getLength() const
virtual Reader & deserialize(Reader &reader)
virtual Reader & deserialize(Reader &reader, size_t length)
virtual void readBuffer(mutable_buffer buf)=0
SerializableBuffer(mutable_buffer data)
virtual ~SerializableBuffer()
virtual mutable_buffer readBuffer(size_t n)
virtual Writer & serialize(Writer &writer) const
virtual mutable_buffer getData() const
void operator=(mutable_buffer b)
virtual void setData(mutable_buffer data)
virtual void writeBuffer(const_buffer b)=0
void deleteAllocatedBuffer()