18#define DECLARE_PARAMETER(classname, classtype) \
20 Mantid::Kernel::RegistrationHelper register_par_##classname( \
21 ((Mantid::Geometry::ParameterFactory::subscribe<Mantid::Geometry::ParameterType<classtype>>(#classname)), 0)); \
31 std::ostringstream str;
38 std::ostringstream str;
39 str << std::setprecision(std::numeric_limits<double>::digits10);
46 std::ostringstream str;
47 str << std::setprecision(std::numeric_limits<double>::digits10);
65 if (pos == std::string::npos) {
71 return std::string(
"");
84 const std::string &visible) {
85 std::shared_ptr<Parameter> p;
86 FactoryMap::const_iterator it =
s_map.find(className);
87 if (it !=
s_map.end())
88 p = it->second->createInstance();
90 throw std::runtime_error(
"ParameterFactory:" + className +
" is not registered.\n");
92 p->m_type = className;
93 p->m_visible = visible ==
"true" ? true :
false;
const std::string & m_value
#define DECLARE_PARAMETER(classname, classtype)
Store information about a fitting parameter such as its value if it is constrained or tied.
static std::shared_ptr< Parameter > create(const std::string &className, const std::string &name, const std::string &visible="true")
Creates an instance of a parameter.
std::map< std::string, std::unique_ptr< AbstractFactory > > FactoryMap
static FactoryMap s_map
The map holding the registered class names and their instantiators.
std::string asString() const override
Returns the value of the property as a string.
std::string m_description
whether the parameter should be visible in InstrumentViewer
virtual std::string getShortDescription() const
get short description