AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
CreatorInterface< BaseClass > Class Template Referenceabstract

Interface for the implementation of the factory method pattern. The creation of an object of a sub class of BaseClass is deligated to a corresponding sub class of Creator<BaseClass>. So it is possible to manage a CreatorMap, which can be extended at run-time. An example is the LinearSolverInterfaceMap: If you write your own LinearSolverInterface sub class and a corresponding Creator<LinearSolverInterface<T> >, you can add the creator together with a key string to the LinearSolverInterfaceMap. Then you can create an LinearSolverInterface depending of a key string read from the init file, which can also be your own new solver. More...

#include <CreatorInterface.hpp>

Inherited by CreatorInterfaceName< BaseClass >.

Public Member Functions

virtual std::unique_ptr< BaseClass > create ()=0
 Must be implemented by sub classes of CreatorInterface. Creates a new instance of the sub class of BaseClass. More...
 

Detailed Description

template<class BaseClass>
class AMDiS::CreatorInterface< BaseClass >

Interface for the implementation of the factory method pattern. The creation of an object of a sub class of BaseClass is deligated to a corresponding sub class of Creator<BaseClass>. So it is possible to manage a CreatorMap, which can be extended at run-time. An example is the LinearSolverInterfaceMap: If you write your own LinearSolverInterface sub class and a corresponding Creator<LinearSolverInterface<T> >, you can add the creator together with a key string to the LinearSolverInterfaceMap. Then you can create an LinearSolverInterface depending of a key string read from the init file, which can also be your own new solver.

Member Function Documentation

◆ create()

virtual std::unique_ptr< BaseClass > create ( )
pure virtual

Must be implemented by sub classes of CreatorInterface. Creates a new instance of the sub class of BaseClass.

Implemented in CreatorInterfaceName< BaseClass >, CreatorInterfaceName< LinearSolverInterface< M, X, Y > >, and CreatorInterfaceName< Super >.


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