#include <serializable_primitive.h>
Public Member Functions | |
virtual Reader & | deserialize (Reader &reader, size_t length) |
virtual Reader & | deserialize (Reader &reader) |
virtual size_t | getLength () const |
SerializablePrimitive () | |
SerializablePrimitive (const T &d) | |
virtual Writer & | serialize (Writer &writer) const |
Public Attributes | |
T | data |
Data as the primitive type to be serialized or deserialized. |
Serialization of a generic primitive class that can be serialized as just the in memory data as is.
Definition at line 41 of file serializable_primitive.h.
eip::serialization::SerializablePrimitive< T >::SerializablePrimitive | ( | ) | [inline] |
Create a primitive with default values. Useful for deserialization.
Definition at line 51 of file serializable_primitive.h.
eip::serialization::SerializablePrimitive< T >::SerializablePrimitive | ( | const T & | d | ) | [inline] |
Create serializable version of the data given
d | data to use for serialization |
Definition at line 57 of file serializable_primitive.h.
virtual Reader& eip::serialization::SerializablePrimitive< T >::deserialize | ( | Reader & | reader, |
size_t | length | ||
) | [inline, virtual] |
Deserialization is always done with the length of the type in the template
reader | Reader to use for deserialization |
length | Ignored |
std::length_error | if the given length is greater than allocated data buffer |
Implements eip::serialization::Serializable.
Definition at line 88 of file serializable_primitive.h.
virtual Reader& eip::serialization::SerializablePrimitive< T >::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 101 of file serializable_primitive.h.
virtual size_t eip::serialization::SerializablePrimitive< T >::getLength | ( | ) | const [inline, virtual] |
Length to be serialized is the memory size of the type given
Implements eip::serialization::Serializable.
Definition at line 63 of file serializable_primitive.h.
virtual Writer& eip::serialization::SerializablePrimitive< T >::serialize | ( | Writer & | writer | ) | const [inline, virtual] |
Serialize the data instance into the writer.
writer | Writer to use for serialization |
std::length_error | if the buffer is too small |
Implements eip::serialization::Serializable.
Definition at line 74 of file serializable_primitive.h.
T eip::serialization::SerializablePrimitive< T >::data |
Data as the primitive type to be serialized or deserialized.
Definition at line 46 of file serializable_primitive.h.