dune-functions 2.9.0
Public Member Functions | Protected Attributes | List of all members
Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize > Class Template Reference

Base class for type-erased interface wrapper. More...

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

Inheritance diagram for Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >:
Inheritance graph

Public Member Functions

template<class T , disableCopyMove< TypeErasureBase, T > = 0>
 TypeErasureBase (T &&t)
 Construct wrapper from object. More...
 
 TypeErasureBase ()=default
 Default constructor. More...
 
Interface & asInterface ()
 Get mutable reference to wrapped object. More...
 
const Interface & asInterface () const
 Get reference to wrapped object. More...
 
const std::type_info & target_type () const
 Get type of stored object. More...
 

Protected Attributes

PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< Interface >, bufferSize > wrapped_
 

Detailed Description

template<class Interface, template< class > class Implementation, size_t bufferSize = 56>
class Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >

Base class for type-erased interface wrapper.

This is meant as a base class for the type-erased interface wrapper that is actually visible to the user. By deriving from this you get small object optimization for the internal polymorphic wrapper.

Constructor & Destructor Documentation

◆ TypeErasureBase() [1/2]

template<class Interface , template< class > class Implementation, size_t bufferSize = 56>
template<class T , disableCopyMove< TypeErasureBase, T > = 0>
Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >::TypeErasureBase ( T &&  t)
inline

Construct wrapper from object.

◆ TypeErasureBase() [2/2]

template<class Interface , template< class > class Implementation, size_t bufferSize = 56>
Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >::TypeErasureBase ( )
default

Default constructor.

Member Function Documentation

◆ asInterface() [1/2]

template<class Interface , template< class > class Implementation, size_t bufferSize = 56>
Interface & Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >::asInterface ( )
inline

Get mutable reference to wrapped object.

◆ asInterface() [2/2]

template<class Interface , template< class > class Implementation, size_t bufferSize = 56>
const Interface & Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >::asInterface ( ) const
inline

Get reference to wrapped object.

◆ target_type()

template<class Interface , template< class > class Implementation, size_t bufferSize = 56>
const std::type_info & Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >::target_type ( ) const
inline

Get type of stored object.

Member Data Documentation

◆ wrapped_

template<class Interface , template< class > class Implementation, size_t bufferSize = 56>
PolymorphicSmallObject<Imp::TypeErasureWrapperInterface<Interface>, bufferSize > Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >::wrapped_
protected

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