28 throw std::runtime_error(
"BUG: not prepared to copy parameters of " +
getName());
42 std::ostringstream result;
44 result << *P_pool <<
"\n";
50 return m_pool->addParameter(
55 const std::string& units)
64 if (name.find(
'*') == std::string::npos && name.find(
'/') == std::string::npos) {
65 m_pool->setParameterValue(name, value);
68 if (name.find(
'*') != std::string::npos)
71 P_pool->setParameterValue(name, value);
85 return m_pool->parameter(name);
90 m_pool->removeParameter(name);
102 return base_name +
"X";
107 return base_name +
"Y";
112 return base_name +
"Z";
Defines many exception classes in namespace Exceptionss.
Defines class IParameterized.
Defines class ParameterPool.
Defines class RealParameter.
T z() const
Returns z-component in cartesian coordinate system.
T y() const
Returns y-component in cartesian coordinate system.
T x() const
Returns x-component in cartesian coordinate system.
Manages a local parameter pool, and a tree of child pools.
RealParameter & registerParameter(const std::string &name, double *parpointer)
IParameterized(const std::string &name="")
std::string parametersToString() const
Returns multiline string representing available parameters.
RealParameter * parameter(const std::string &name) const
Returns parameter with given 'name'.
static std::string XComponentName(const std::string &base_name)
void removeParameter(const std::string &name)
const std::string & getName() const
void removeVector(const std::string &base_name)
void setVectorValue(const std::string &base_name, kvector_t value)
virtual void onChange()
Action to be taken in inherited class when a parameter has changed.
std::unique_ptr< ParameterPool > m_pool
parameter pool (kind of pointer-to-implementation)
ParameterPool * parameterPool() const
Returns pointer to the parameter pool.
void registerVector(const std::string &base_name, kvector_t *p_vec, const std::string &units="nm")
virtual ParameterPool * createParameterTree() const
Creates new parameter pool, with all local parameters and those of its children.
static std::string YComponentName(const std::string &base_name)
virtual ~IParameterized()
void setParameterValue(const std::string &name, double value)
static std::string ZComponentName(const std::string &base_name)
Container with parameters for IParameterized object.
int setMatchedParametersValue(const std::string &wildcards, double value)
Sets value of the nonzero parameters that match pattern ('*' allowed), or throws.
Wraps a parameter of type double.
RealParameter & setUnit(const std::string &name)