dune-functions
2.5.0
|
Base implementation of the internal wrapper interface. More...
#include <dune/functions/common/typeerasure.hh>
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_ |
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.
Interface | Class defininig the internal abstract virtual interface |
T | A type modelleding the desired interface |
|
protected |
|
inline |
|
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.
|
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).
|
inline |
Get mutable reference stored object.
|
inline |
Get reference stored object.
|
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).
|
pure virtualinherited |
|
protected |