version 3.11-dev
Loading...
Searching...
No Matches
packing.hh File Reference

Helpers to (de)serialize trivially-copyable values into a byte buffer (e.g. for point-to-point or collective MPI communication).

#include <vector>
#include <cstring>
#include <type_traits>

Go to the source code of this file.

Namespaces

namespace  Dumux
namespace  Dumux::Detail

Functions

template<class T>
void Dumux::Detail::packValue (std::vector< char > &buf, const T &value)
 Append the raw bytes of a trivially-copyable value to a byte buffer.
template<class T>
Dumux::Detail::unpackValue (const char *&cursor)
 Read a trivially-copyable value from a byte buffer and advance the cursor.