Loading...
Searching...
No Matches
Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize > Class Template Reference
Utility » Utilities for type-erasure

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

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

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

## Public Member Functions

template<class T, disableCopyMove< TypeErasureBase, T > = 0>
| TypeErasureBase (T &&t)
| Construct wrapper from object.
| TypeErasureBase ()=default
| Default constructor.
Interface & | asInterface ()
| Get mutable reference to wrapped object.
const Interface & | asInterface () const
| Get reference to wrapped object.
| operator bool () const noexcept
| Query whether there is a stored object.
const std::type_info & | target_type () const
| Get type of stored object.

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

## operator bool()

template<class Interface, template< class > class Implementation, size_t bufferSize = 56>

Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >::operator bool | ( |  | ) | const

inline explicit noexcept

Query whether there is a stored 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:

- typeerasure.hh