12#include "MantidGeometry/DllConfig.h"
41 template <
class C>
static void subscribe(
const std::string &className);
43 static std::shared_ptr<Parameter>
create(
const std::string &className,
const std::string &name,
44 const std::string &visible =
"true");
56 using FactoryMap = std::map<std::string, std::unique_ptr<AbstractFactory>>;
66 auto it =
s_map.find(className);
67 if (!className.empty() && it ==
s_map.cend()) {
68 s_map[className] = std::make_unique<Kernel::Instantiator<C, Parameter>>();
70 throw std::runtime_error(
"Parameter type" + className +
" is already registered.\n");
The ParameterFactory class creates parameters for the instrument ParameterMap.
ParameterFactory()
Private default constructor.
ParameterFactory & operator=(const ParameterFactory &)
Private assignment operator.
ParameterFactory(const ParameterFactory &)
Private copy constructor.
std::map< std::string, std::unique_ptr< AbstractFactory > > FactoryMap
static void subscribe(const std::string &className)
Templated method for parameter subscription.
static FactoryMap s_map
The map holding the registered class names and their instantiators.
The base class for instantiators.
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
Helper class which provides the Collimation Length for SANS instruments.