TRIQS/h5 1.3.0
C++ interface to HDF5
|
Serialize/Deserialize an object to/from a byte buffer using HDF5's memory file.
Example 3: Serialization shows a simple example how this interface could be used in practice.
Functions | |
template<typename T > | |
T | h5::deserialize (std::vector< std::byte > const &buf) |
Deserialize an object from a byte buffer. | |
template<typename T > | |
std::vector< std::byte > | h5::serialize (T const &x) |
Serialize an object to a byte buffer. | |
|
nodiscard |
#include <h5/serialization.hpp>
Deserialize an object from a byte buffer.
It first creates a buffered memory file from the given byte buffer and then reads the object from the file.
T | Type of the object. |
buf | Byte buffer containing the serialized object. |
Definition at line 64 of file serialization.hpp.
|
nodiscard |
#include <h5/serialization.hpp>
Serialize an object to a byte buffer.
It first writes the object to a buffered memory file and then returns the underlying byte buffer.
T | Type of the object. |
x | Object to be serialized. |
Definition at line 48 of file serialization.hpp.