9#include "MantidKernel/DllConfig.h"
47 std::string
value()
const override;
48 std::string
valueAsPrettyStr(
const size_t maxLength = 0,
const bool collapseLists =
true)
const override;
52 int size()
const override;
56 std::string
setDataItem(
const std::shared_ptr<DataItem> &data)
override;
61 virtual operator const TYPE &()
const;
62 std::string
isValid()
const override;
79 template <
typename U> std::string
setTypedValue(
const U &
value,
const std::true_type &);
81 template <
typename U> std::string
setTypedValue(
const U &
value,
const std::false_type &);
116#if defined(_WIN32) || defined(__clang__) && defined(__APPLE__)
const std::vector< double > & rhs
The Logger class is in charge of the publishing messages from the framework through various channels.
The concrete, templated class for properties.
virtual void replaceValidator(IValidator_sptr newValidator)
Replace the current validator with the given one.
bool isDefault() const override
Indicates if the property's value is the same as it was when it was set N.B.
int size() const override
Get the size of the property.
static Logger g_logger
Static reference to the logger class.
PropertyWithValue & operator=(const PropertyWithValue &right)
Copy assignment operator assigns only the value and the validator not the name, default (initial) val...
std::string setTypedValue(const U &value, const std::true_type &)
Helper function for setValue(DataItem_sptr).
std::string setValue(const std::string &value) override
Set the value of the property from a string representation.
PropertyWithValue & operator+=(Property const *right) override
Add the value of another property.
TYPE m_initialValue
the property's default value which is also its initial value
std::string valueAsPrettyStr(const size_t maxLength=0, const bool collapseLists=true) const override
Get the value of the property as a string.
Json::Value valueAsJson() const override
Attempt to construct a Json::Value object from the plain value.
bool operator==(const PropertyWithValue< TYPE > &rhs) const
Deep comparison.
IValidator_sptr m_validator
Visitor validator class.
bool isMultipleSelectionAllowed() override
Returns the set of valid values for this property, if such a set exists.
void saveProperty(Nexus::File *file) override
PropertyWithValue< TYPE > * clone() const override
'Virtual copy constructor'
PropertyWithValue()=delete
const TYPE getValueForAlias(const TYPE &alias) const
Return value for a given alias.
virtual const TYPE & operator()() const
Allows you to get the value of the property via an expression like myProperty()
std::string setValueFromJson(const Json::Value &value) override
Set the value of the property from a Json representation.
IValidator_sptr getValidator() const
Returns the validator as a constant variable so it cannot be changed.
std::vector< std::string > allowedValues() const override
Returns the set of valid values for this property, if such a set exists.
TYPE m_value
The value of the property.
std::string value() const override
Get the value of the property as a string.
std::string isValid() const override
Check the value chosen for the property is OK, unless overidden it just calls the validator's isValid...
bool operator!=(const PropertyWithValue< TYPE > &rhs) const
Deep comparison (not equal).
std::string setValueFromProperty(const Property &right) override
Set the value of the property via a reference to another property.
std::string setDataItem(const std::shared_ptr< DataItem > &data) override
Set a property value via a DataItem.
std::string getDefault() const override
Get the value the property was initialised with -its default value.
Base class for properties.
unsigned int direction() const
returns the direction of the property
const std::string & name() const
Get the property's name.
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.
MANTID_KERNEL_EXTERN_TEMPLATE(PropertyWithValue< Matrix< float > >)
Helper class which provides the Collimation Length for SANS instruments.
@ Input
An input workspace.