dune-functions  2.5.0
Public Member Functions | List of all members
Dune::Functions::Imp::TypeErasureWrapperInterface< Interface > Class Template Referenceabstract

The internal wrapper interface for type erasure. More...

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

Inheritance diagram for Dune::Functions::Imp::TypeErasureWrapperInterface< Interface >:
Inheritance graph

Public Member Functions

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...
 

Detailed Description

template<class Interface>
class Dune::Functions::Imp::TypeErasureWrapperInterface< Interface >

The internal wrapper interface for type erasure.

This class adds some foundation interfaces needed for proper dynamic polymorphism and type erasure.

The actual application interface has to be provided by the user.

Template Parameters
InterfaceClass defininig the internal abstract virtual interface

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).

§ 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 virtual

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