AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
CreatorMap< BaseClass > Class Template Reference

A CreatorMap is used to construct objects, which types depends on key words determined at run time. For example the LinearSolverInterfaceMap can create the different solver types depending on the solver parameter of the init file. The benefit of such creator maps is, that you can extend them only by writing an creator class for your own new class and give the creator together with a key word to the map. More...

#include <CreatorMap.hpp>

Public Types

using CreatorMapType = std::map< std::string, CreatorInterface< BaseClass > * >
 

Static Public Member Functions

static void addCreator (std::string key, CreatorInterface< BaseClass > *creator)
 Adds a new creator together with the given key to the map.
 
static CreatorInterface< BaseClass > * get (std::string key, std::string initFileStr)
 Creates a object of the type corresponding to key.
 

Static Protected Member Functions

static void init ()
 

Static Protected Attributes

static CreatorMapType creatorMap
 STL map containing the pairs of keys and creators.
 
static bool initialized = false
 

Detailed Description

template<class BaseClass>
class AMDiS::CreatorMap< BaseClass >

A CreatorMap is used to construct objects, which types depends on key words determined at run time. For example the LinearSolverInterfaceMap can create the different solver types depending on the solver parameter of the init file. The benefit of such creator maps is, that you can extend them only by writing an creator class for your own new class and give the creator together with a key word to the map.


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