Cbeam
|
Provides serialization and deserialization logic for standard map-like containers. More...
#include <map.hpp>
Static Public Member Functions | |
static void | serialize (const Map &map, container::buffer &stream) |
Serializes all key-value pairs of the map into a binary format appended to stream . | |
static void | deserialize (serialized_object &it, Map &map) |
Deserializes map data from the buffer into a Map instance, replacing its current contents. | |
Provides serialization and deserialization logic for standard map-like containers.
Map | A map-like container (e.g., std::map<Key,Value> ) that supports iteration via begin() and end() , and insertion via insert(...) . |
|
inlinestatic |
Deserializes map data from the buffer into a Map
instance, replacing its current contents.
The number of elements is read first, then each key-value pair is deserialized and inserted into the map. The iterator it
is advanced accordingly.
it | A reference to a serialized_object pointer indicating where to read from. |
map | The map object to populate with deserialized data. |
|
inlinestatic |
Serializes all key-value pairs of the map into a binary format appended to stream
.
The first thing written is the map size (number of elements), followed by each key and value serialized using traits
.
map | The map to serialize. |
stream | A buffer to which the map data is appended. |