dune-functions  2.5-dev
Public Member Functions | Protected Types | Protected Attributes | List of all members
Dune::Functions::Imp::TypeErasureWrapperBase< Interface, T > Class Template Referenceabstract

Base implementation of the internal wrapper interface. More...

#include <dune/functions/common/typeerasure.hh>

Inheritance diagram for Dune::Functions::Imp::TypeErasureWrapperBase< Interface, T >:
Inheritance graph

Public Member Functions

template<class TT , disableCopyMove< TypeErasureWrapperBase, TT > = 0>
 TypeErasureWrapperBase (TT &&t)
 
T & get ()
 Get mutable reference stored object. More...
 
const T & get () const
 Get reference stored object. More...
 
virtual const std::type_info & target_type () const =0
 
virtual TypeErasureWrapperInterface< Interface > * clone () const=0
 Clones the object. More...
 
virtual TypeErasureWrapperInterface< Interface > * clone (void *buffer) const=0
 Clones the object into buffer. More...
 
virtual TypeErasureWrapperInterface< Interface > * move (void *buffer)=0
 Move object into buffer. More...
 

Protected Types

using Wrapped = T
 

Protected Attributes

Wrapped wrapped_
 

Detailed Description

template<class Interface, class T>
class Dune::Functions::Imp::TypeErasureWrapperBase< Interface, T >

Base implementation of the internal wrapper interface.

This class derives from the foundation interfaces and the user defined interfaces provided by the interface parameter. It will store any suitable type T to do the type erasure.

The implementation of the foundation and user interface is provided by classed derived of this one.

Template Parameters
InterfaceClass defininig the internal abstract virtual interface
TA type modelleding the desired interface

Member Typedef Documentation

§ Wrapped

template<class Interface , class T >
using Dune::Functions::Imp::TypeErasureWrapperBase< Interface, T >::Wrapped = T
protected

Constructor & Destructor Documentation

§ TypeErasureWrapperBase()

template<class Interface , class T >
template<class TT , disableCopyMove< TypeErasureWrapperBase, TT > = 0>
Dune::Functions::Imp::TypeErasureWrapperBase< Interface, T >::TypeErasureWrapperBase ( TT &&  t)
inline

Member Function Documentation

§ clone() [1/2]

virtual TypeErasureWrapperInterface< Interface > * Dune::Functions::PolymorphicType< TypeErasureWrapperInterface< Interface > >::clone ( ) const
pure virtualinherited

Clones the object.

clone() needs to be redefined by an implementation class, with the return type covariantly adapted. This will return a new copy of *this via a pointer to newly allocated memory. Remember to delete the resulting pointer.

§ clone() [2/2]

virtual TypeErasureWrapperInterface< Interface > * Dune::Functions::PolymorphicType< TypeErasureWrapperInterface< Interface > >::clone ( void *  buffer) const
pure virtualinherited

Clones the object into buffer.

clone(buffer) needs to be redefined by an implementation class, with the return type covariantly adapted. This will return a copy of this created in the given buffer using placement-new with copy construction. You must not delete the returned pointer since it points to the given buffer (however with the proper type instead of void).

§ get() [1/2]

template<class Interface , class T >
T& Dune::Functions::Imp::TypeErasureWrapperBase< Interface, T >::get ( )
inline

Get mutable reference stored object.

§ get() [2/2]

template<class Interface , class T >
const T& Dune::Functions::Imp::TypeErasureWrapperBase< Interface, T >::get ( ) const
inline

Get reference stored object.

§ move()

virtual TypeErasureWrapperInterface< Interface > * Dune::Functions::PolymorphicType< TypeErasureWrapperInterface< Interface > >::move ( void *  buffer)
pure virtualinherited

Move object into buffer.

move(buffer) needs to be redefined by an implementation class, with the return type covariantly adapted. This will return a copy of this created in the given buffer using placement-new with move construction. You must not delete the returned pointer since it points to the given buffer (however with the proper type instead of void).

§ target_type()

template<class Interface>
virtual const std::type_info& Dune::Functions::Imp::TypeErasureWrapperInterface< Interface >::target_type ( ) const
pure virtualinherited

Member Data Documentation

§ wrapped_

template<class Interface , class T >
Wrapped Dune::Functions::Imp::TypeErasureWrapperBase< Interface, T >::wrapped_
protected

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