|
DIY
3.0
data-parallel out-of-core C++ library
|
Main interface to serialization, meant to be specialized for the types that require special handling. diy::save() and diy::load() call the static member functions of this class.
More...
#include <diy/serialization.hpp>
Static Public Member Functions | |
| static void | save (BinaryBuffer &bb, const T &x) |
| static void | load (BinaryBuffer &bb, T &x) |
Main interface to serialization, meant to be specialized for the types that require special handling. diy::save() and diy::load() call the static member functions of this class.
The default (unspecialized) version copies sizeof(T) bytes from &x to or from bb via its diy::BinaryBuffer::save_binary() and diy::BinaryBuffer::load_binary() functions. This works out perfectly for plain old data (e.g., simple structs). To save a more complicated type, one has to specialize diy::Serialization<T> for that type. Specializations are already provided for std::vector<T>, std::map<K,V>, and std::pair<T,U>. As a result one can quickly add a specialization of one's own
1.8.6