Add support for serializing std::optional

This commit is contained in:
Joakim Hove
2020-04-28 11:37:11 +02:00
parent 8b77d68d9c
commit 40d7cd4381
2 changed files with 50 additions and 2 deletions

View File

@@ -29,11 +29,12 @@
#include <dune/common/parallel/mpihelper.hh>
#include <optional>
#include <map>
#include <set>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <vector>
namespace Opm
{
@@ -81,6 +82,9 @@ std::size_t packSize(const T& data, Dune::MPIHelper::MPICommunicator comm)
template<class T1, class T2>
std::size_t packSize(const std::pair<T1,T2>& data, Dune::MPIHelper::MPICommunicator comm);
template<class T>
std::size_t packSize(const std::optional<T>& data, Dune::MPIHelper::MPICommunicator comm);
template<class T, class A>
std::size_t packSize(const std::vector<T,A>& data, Dune::MPIHelper::MPICommunicator comm);
@@ -158,6 +162,10 @@ template<class T1, class T2>
void pack(const std::pair<T1,T2>& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm);
template<class T>
void pack(const std::optional<T>& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm);
template<class T, class A>
void pack(const std::vector<T,A>& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm);
@@ -243,6 +251,10 @@ template<class T1, class T2>
void unpack(std::pair<T1,T2>& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm);
template<class T>
void unpack(std::optional<T>& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm);
template<class T, class A>
void unpack(std::vector<T,A>& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm);