8#include <amdis/CreatorInterface.hpp>
15 template <
class BaseClass>
28 template <
class BaseClass>
32 using CreatorMapType = std::map< std::string, CreatorInterface<BaseClass>* >;
39 test_exit(!
creatorMap[key],
"There is already a creator for key {}", key);
50 warning(
"No creator for key `{}` defined (used in init-file parameter `{}`). Falling back to `default`.", key, initFileStr);
55 test_exit(creator,
"Undefined creator for `{}` (used in init-file parameter `{}`)", key, initFileStr);
73 static bool initialized;
76 template <
class BaseClass>
79 template <
class BaseClass>
Interface for the implementation of the factory method pattern. The creation of an object of a sub cl...
Definition: CreatorInterface.hpp:24
A CreatorMap is used to construct objects, which types depends on key words determined at run time....
Definition: CreatorMap.hpp:30
static CreatorInterface< BaseClass > * get(std::string key, std::string initFileStr)
Creates a object of the type corresponding to key.
Definition: CreatorMap.hpp:44
static void addCreator(std::string key, CreatorInterface< BaseClass > *creator)
Adds a new creator together with the given key to the map.
Definition: CreatorMap.hpp:36
static CreatorMapType creatorMap
STL map containing the pairs of keys and creators.
Definition: CreatorMap.hpp:71
Definition: CreatorMap.hpp:16