add bool parameter ComplexType to EclMpiSerializer::map

this is passed on to the serializeOp template for the underlying
type. used with maps over DynamicState where DynamicState is over
a non-complex type.
This commit is contained in:
Arne Morten Kvarving 2020-03-17 13:56:12 +01:00
parent e87ec7b5a4
commit f0bc3e3815

View File

@ -81,15 +81,20 @@ public:
}
}
template<template<class Key, class Data> class Map, class Key, class Data>
void map(Map<Key, Data>& data)
template<class Map, bool complexType = true>
void map(Map& data)
{
using Key = typename Map::key_type;
using Data = typename Map::mapped_type;
auto handle = [&](auto& d)
{
if constexpr (is_vector<Data>::value)
vector(d);
else if constexpr (is_shared_ptr<Data>::value)
shared_ptr(d);
else if constexpr (!complexType)
d.template serializeOp<EclMpiSerializer, false>(*this);
else
d.serializeOp(*this);
};