mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-20 11:48:25 -06:00
Merge pull request #4050 from akva2/eclmpiserializer_ptr
eclmpiserializer: improve ptr handler
This commit is contained in:
commit
dff553db59
@ -495,8 +495,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)
|
||||||
{
|
{
|
||||||
@ -506,8 +504,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
|
||||||
|
Loading…
Reference in New Issue
Block a user