#include <serializable_buffer.h>
Public Member Functions | |
virtual Reader & | deserialize (Reader &reader, size_t length) |
virtual Reader & | deserialize (Reader &reader) |
virtual mutable_buffer | getData () const |
virtual size_t | getLength () const |
void | operator= (mutable_buffer b) |
SerializableBuffer () | |
SerializableBuffer (mutable_buffer data) | |
virtual Writer & | serialize (Writer &writer) const |
virtual void | setData (mutable_buffer data) |
virtual | ~SerializableBuffer () |
Private Member Functions | |
void | deleteAllocatedBuffer () |
Private Attributes | |
char * | allocated_buffer_ |
mutable_buffer | data_ |
Generic buffer of data that can be serialized
Definition at line 45 of file serializable_buffer.h.
Construct an empty serializable buffer
data | Data to hold in the buffer |
Definition at line 53 of file serializable_buffer.h.
eip::serialization::SerializableBuffer::SerializableBuffer | ( | mutable_buffer | data | ) | [inline] |
Construct a serializable buffer for the given data buffer
data | Data to hold in the buffer |
Definition at line 59 of file serializable_buffer.h.
virtual eip::serialization::SerializableBuffer::~SerializableBuffer | ( | ) | [inline, virtual] |
Definition at line 61 of file serializable_buffer.h.
void eip::serialization::SerializableBuffer::deleteAllocatedBuffer | ( | ) | [inline, private] |
Helper to delete an allocated buffer if needed
Definition at line 166 of file serializable_buffer.h.
virtual Reader& eip::serialization::SerializableBuffer::deserialize | ( | Reader & | reader, |
size_t | length | ||
) | [inline, virtual] |
Deserialize buffer data from the given reader, up to the length given. Will use the buffer already allocated.
reader | Reader to use for deserialization |
length | Length expected for data |
std::length_error | if the given length is greater than allocated data buffer |
Implements eip::serialization::Serializable.
Definition at line 118 of file serializable_buffer.h.
virtual Reader& eip::serialization::SerializableBuffer::deserialize | ( | Reader & | reader | ) | [inline, virtual] |
Deserialize data into this buffer, using the size of the buffer already allocated
reader | Reader to use for deserialization |
std::length_error | if the buffer is overrun while deserializing |
Implements eip::serialization::Serializable.
Definition at line 148 of file serializable_buffer.h.
virtual mutable_buffer eip::serialization::SerializableBuffer::getData | ( | ) | const [inline, virtual] |
Get the data held in this buffer
Definition at line 80 of file serializable_buffer.h.
virtual size_t eip::serialization::SerializableBuffer::getLength | ( | ) | const [inline, virtual] |
Get the length of the current data buffer
Implements eip::serialization::Serializable.
Definition at line 71 of file serializable_buffer.h.
void eip::serialization::SerializableBuffer::operator= | ( | mutable_buffer | b | ) | [inline] |
Definition at line 154 of file serializable_buffer.h.
virtual Writer& eip::serialization::SerializableBuffer::serialize | ( | Writer & | writer | ) | const [inline, virtual] |
Serialize the buffer into the writer
writer | Writer to use for serialization |
std::length_error | if the buffer is too small for the header data |
Implements eip::serialization::Serializable.
Definition at line 103 of file serializable_buffer.h.
virtual void eip::serialization::SerializableBuffer::setData | ( | mutable_buffer | data | ) | [inline, virtual] |
Set the data for the buffer
data | Data to assign to the buffer |
Definition at line 89 of file serializable_buffer.h.
char* eip::serialization::SerializableBuffer::allocated_buffer_ [private] |
Definition at line 161 of file serializable_buffer.h.
mutable_buffer eip::serialization::SerializableBuffer::data_ [private] |
Definition at line 160 of file serializable_buffer.h.