53 static_assert(std::is_standard_layout<T>::value && std::is_trivial<T>::value,
54 "A specialization of cbeam::serialization::traits must be implemented for types that are not both standard-layout and trivial.");
66 stream.
append(
reinterpret_cast<const char*
>(&val),
sizeof(val));
80 uint8_t* local_it =
reinterpret_cast<uint8_t*
>(it);
81 std::memcpy(&val, local_it,
sizeof(val));
82 local_it +=
sizeof(val);
Manages memory a byte buffer, offering dynamic appending. This class is designed for scenarios where ...
Definition buffer.hpp:50
virtual void append(const void *buffer_to_append, const std::size_t length_of_buffer)
append the given buffer to the end of the current buffer. If there is no current buffer yet,...
Definition buffer.hpp:96
Implements traits-based serialization for complex data types, including standard containers and custo...
Definition direct.hpp:38
void * serialized_object
Represents a serialized value in memory.
Definition traits.hpp:42
Defines the traits required for serializing and deserializing objects of type T.
Definition traits.hpp:52
static void serialize(const T &val, container::buffer &stream)
Required to serialize an object of type T into a shared_buffer stream.
Definition traits.hpp:63
static void deserialize(serialized_object &it, T &val)
Required to deserialize an object of type T from a serialized memory block, incrementing the iterator...
Definition traits.hpp:77