Opm::AdditionalObjectDeleter< T > Class Template Reference

A custom deleter that will delete an additional object, too. More...

#include <AdditionalObjectDeleter.hpp>

Public Member Functions

 AdditionalObjectDeleter ()
 empty constructor. More...
 
 AdditionalObjectDeleter (T &additional_object)
 Constructor taking the object that needs to deleted. More...
 
template<class T1 >
void operator() (T1 *pt)
 Delete an object and the additional one. More...
 

Detailed Description

template<class T>
class Opm::AdditionalObjectDeleter< T >

A custom deleter that will delete an additional object, too.

In dune-istl most parallel preconditioners hold a reference to a sequential preconditioner. In CPRPreconditioner and NewtonIterationBlackoilInterleaved we use unique_ptr for the memory management. Ergo we need to construct the sequential preconditioner with new and make sure that it gets deleted together with the enclosing parallel preconditioner. Therefore this deleter stores a pointer to it and deletes it during destruction.

Template Parameters
Thetype of the additional object to be deleted.

Constructor & Destructor Documentation

template<class T >
Opm::AdditionalObjectDeleter< T >::AdditionalObjectDeleter ( )
inline

empty constructor.

template<class T >
Opm::AdditionalObjectDeleter< T >::AdditionalObjectDeleter ( T &  additional_object)
inline

Constructor taking the object that needs to deleted.

Member Function Documentation

template<class T >
template<class T1 >
void Opm::AdditionalObjectDeleter< T >::operator() ( T1 *  pt)
inline

Delete an object and the additional one.


The documentation for this class was generated from the following file: