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