Merge pull request #4079 from akva2/summarystate_test

added: SummaryState mpiserializer test
This commit is contained in:
Bård Skaflestad 2022-09-06 12:01:21 +02:00 committed by GitHub
commit 3273ef04f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -246,6 +246,8 @@ public:
this->vector(d);
else if constexpr (is_ptr<Data>::value)
this->ptr(d);
else if constexpr (is_map<Data>::value)
this->map(d);
else if constexpr (has_serializeOp<Data>::value)
d.serializeOp(*this);
else
@ -464,6 +466,22 @@ protected:
constexpr static bool value = true;
};
//! \brief Predicate for maps
template<class T>
struct is_map {
constexpr static bool value = false;
};
template<class Key, class T, class Compare, class Allocator>
struct is_map<std::map<Key,T,Compare,Allocator>> {
constexpr static bool value = true;
};
template<class Key, class T, class Hash, class KeyEqual, class Allocator>
struct is_map<std::unordered_map<Key,T,Hash,KeyEqual,Allocator>> {
constexpr static bool value = true;
};
//! Detect existence of \c serializeOp member function
//!
//! Base case (no \c serializeOp member function)

View File

@ -662,6 +662,7 @@ TEST_FOR_TYPE(SICD)
TEST_FOR_TYPE(SolventDensityTable)
TEST_FOR_TYPE(SummaryConfig)
TEST_FOR_TYPE(SummaryConfigNode)
TEST_FOR_TYPE(SummaryState)
TEST_FOR_TYPE(Tabdims)
TEST_FOR_TYPE(TableColumn)
TEST_FOR_TYPE(TableContainer)