40 const unsigned int direction = Direction::Input);
48 std::string
value()
const override;
49 std::string
valueAsPrettyStr(
const size_t maxLength = 0,
const bool collapseLists =
true)
const override;
57 std::string
setDataItem(
const std::shared_ptr<DataItem> &data)
override;
62 virtual operator const TYPE &()
const;
const std::vector< double > & rhs
double value
The value of the point.
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
The Logger class is in charge of the publishing messages from the framework through various channels.
NullValidator is a validator that doesn't.
The concrete, templated class for properties.
bool isDefault() const override
Overriden function that returns if property has the same value that it was initialised with,...
int size() const override
Return the size of this property.
static Logger g_logger
Static reference to the logger class.
std::string setTypedValue(const U &value, const std::true_type &)
std::string setValue(const std::string &value) override
Set the value of the property via a string.
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
Returns the value of the property as a pretty printed string.
Json::Value valueAsJson() const override
Returns the value of the property as a Json::Value.
bool operator==(const PropertyWithValue< TYPE > &rhs) const
IValidator_sptr m_validator
Visitor validator class.
bool isMultipleSelectionAllowed() override
Is Multiple Selection Allowed.
PropertyWithValue(std::string name, TYPE defaultValue, const unsigned int direction)
PropertyWithValue(const PropertyWithValue< TYPE > &right)
PropertyWithValue(std::string name, TYPE defaultValue, IValidator_sptr validator=IValidator_sptr(new NullValidator), const unsigned int direction=Direction::Input)
PropertyWithValue< TYPE > * clone() const override
'Virtual copy constructor'
virtual PropertyWithValue & operator=(const TYPE &value)
const TYPE getValueForAlias(const TYPE &alias) const
PropertyWithValue(const std::string &name, TYPE defaultValue, const std::string &defaultValueStr, IValidator_sptr validator, const unsigned int direction)
PropertyWithValue & operator=(const PropertyWithValue &right)
std::string setValueFromJson(const Json::Value &value) override
Set the value of the property via a Json object.
PropertyWithValue()=default
Private default constructor.
virtual const TYPE & operator()() const
IValidator_sptr getValidator() const
virtual void replaceValidator(IValidator_sptr newValidator)
std::string setTypedValue(const U &value, const std::false_type &)
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.
void saveProperty(::NeXus::File *file) override
std::string value() const override
Returns the value of the property as a string.
std::string isValid() const override
Overridden function that checks whether the property, if not overriden returns "".
PropertyWithValue & operator+=(Property const *right) override
Add to this.
bool operator!=(const PropertyWithValue< TYPE > &rhs) const
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 the value of the property via a DataItem pointer.
std::string getDefault() const override
Get the default value for the property which is the value the property was initialised with.
Base class for properties.
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.
Helper class which provides the Collimation Length for SANS instruments.