mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
eclmpiserializer: improve ptr handler
use has_serializeOp trait
This commit is contained in:
@@ -497,8 +497,6 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! \brief Handler for smart pointers.
|
//! \brief Handler for smart pointers.
|
||||||
//! \details If data is POD or a string, we pass it to the underlying serializer,
|
|
||||||
//! if not we assume a complex type.
|
|
||||||
template<class PtrType>
|
template<class PtrType>
|
||||||
void ptr(const PtrType& data)
|
void ptr(const PtrType& data)
|
||||||
{
|
{
|
||||||
@@ -508,8 +506,12 @@ protected:
|
|||||||
if (m_op == Operation::UNPACK && value) {
|
if (m_op == Operation::UNPACK && value) {
|
||||||
const_cast<PtrType&>(data).reset(new T1);
|
const_cast<PtrType&>(data).reset(new T1);
|
||||||
}
|
}
|
||||||
if (data)
|
if (data) {
|
||||||
data->serializeOp(*this);
|
if constexpr (has_serializeOp<T1>::value)
|
||||||
|
data->serializeOp(*this);
|
||||||
|
else
|
||||||
|
(*this)(*data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Parallel::Communication m_comm; //!< Communicator to broadcast using
|
Parallel::Communication m_comm; //!< Communicator to broadcast using
|
||||||
|
|||||||
Reference in New Issue
Block a user