DUNE PDELab (2.8)
Wrap a Dune::VirtualFunction into a callable object. More...
#include <dune/functions/common/callable.hh>
Public Member Functions | |
CallableFunctionWrapper (const F &f) | |
Instanciate from reference to f. More... | |
CallableFunctionWrapper (const std::shared_ptr< const F > &f) | |
Instanciate from std::shared_ptr to f. More... | |
Range | operator() (const Domain &x) const |
Forward operator() to F::evaluate() More... | |
Detailed Description
class Dune::Functions::CallableFunctionWrapper< F >
Wrap a Dune::VirtualFunction into a callable object.
- Template Parameters
-
F Some function deriving from Dune::VirtualFunction
This class provides an operator() that forwards to the evaluate method. In order to allow this F::RangeType must be default constructible. This class is copyable and ownership policy of the wrapped function (see constructors) will be the same for all copies.
This models the Concept::DifferentiableFunction<Range(Domain), DerivativeTraits> concept.
Using this wrapper you can e.g. pass a Dune::VirtualFunction<D,R> to the standard wrapper std::function<R(D)>.
Constructor & Destructor Documentation
◆ CallableFunctionWrapper() [1/2]
|
inline |
Instanciate from reference to f.
The CallableFunctionWrapper will not take ownership of the provided function.
References Dune::stackobject_to_shared_ptr().
◆ CallableFunctionWrapper() [2/2]
|
inline |
Instanciate from std::shared_ptr to f.
The CallableFunctionWrapper will share ownership with the provided function.
Member Function Documentation
◆ operator()()
|
inline |
Forward operator() to F::evaluate()
This uses the default constructor of F::RangeType
The documentation for this class was generated from the following file:
- dune/functions/common/callable.hh