Cbeam
|
Specialization of traits
for cbeam::container::xpod::type
.
More...
#include <xpod.hpp>
Static Public Member Functions | |
static void | serialize (const container::xpod::type &val, container::buffer &stream) |
Serialize the given xpod::type variant into the buffer stream . | |
static void | deserialize (serialized_object &it, container::xpod::type &val) |
Deserialize an xpod::type variant from the buffer pointed to by it . | |
static void | serialize (const container::xpod::type &val, container::buffer &stream) |
Required to serialize an object of type T into a shared_buffer stream. | |
static void | deserialize (serialized_object &it, container::xpod::type &val) |
Required to deserialize an object of type T from a serialized memory block, incrementing the iterator it . | |
Specialization of traits
for cbeam::container::xpod::type
.
The variant can hold: long long
, double
, bool
, memory::pointer
, or std::string
. During serialization, we first store the variant index (1 byte), then the corresponding data in a type-dependent format.
|
inlinestatic |
Required to deserialize an object of type T from a serialized memory block, incrementing the iterator it
.
it | A reference to a pointer to the serialized memory block. |
val | A reference to the object of type T, where the deserialized data will be stored. |
This method should deserialize an object of type T from a serialized memory block, incrementing the iterator it
to point to the next part of the serialized data. It should handle different types of data, managing memory and type conversion as needed.
|
inlinestatic |
Deserialize an xpod::type variant from the buffer pointed to by it
.
Reads a single byte to determine the active index, then reads the corresponding data into val
. Advances it
to point past the consumed data.
it | The iterator (raw pointer) position in the serialized data. |
val | The xpod::type variant to populate. |
cbeam::error::runtime_error | if the variant index is invalid. |
|
inlinestatic |
Required to serialize an object of type T into a shared_buffer stream.
val | The object to serialize. |
stream | The shared_buffer stream into which the object is serialized. |
This method should take an object of type T and serialize it into a container::buffer
stream. by using its append
method.
|
inlinestatic |
Serialize the given xpod::type variant into the buffer stream
.
The serialization stores: 1) A single byte (valIndex) representing which type is active. 2) The associated data for that type.
val | The variant to serialize. |
stream | The buffer to which data is appended. |