Skip to content
Snippets Groups Projects
Commit 20c53865 authored by Christian Engwer's avatar Christian Engwer
Browse files

Merge branch 'feature/parameterizedobjectfactory' into 'master'

Feature/parameterizedobjectfactory

the idea is to have a generic factory which can be extended by the user at run time and maps a key (usually an `std::string`) to a constructor-call (usually taking a `Dune::ParameterTree`).

We want something like a plugin-system, to instantiate implementations of an abstract interface. Usually a factory can only create a hard-coded list of objects. The proposed ParameterizedObjectFactory different modules (or the user) can register implementations of the interface, without modifying the factory code.

Example:
```C++
using V = Dune::BlockVector<Dune::FieldVector<double,2>>;
using M = Dune::BCRSMatrix<Dune::FieldMatrix<double,2,2>>;

using PreconditionerFactory = 
  Dune::ParameterizedObjectFactory<Dune::Preconditioner<V,V>(const M&, const Dune::ParameterTree&)>;

PreconditionerFactory::define<Dune::SeqGS<M,V,V>>("Gauss-Seidel");
```


See merge request !3
parents bf4b5fdb 446e35bb
No related branches found
No related tags found
2 merge requests!212Fix link to build system doc,!3Feature/parameterizedobjectfactory
Pipeline #
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment