Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
Mantid::Kernel::PropertyManagerProperty Class Referencefinal

#include <PropertyManagerProperty.h>

Inheritance diagram for Mantid::Kernel::PropertyManagerProperty:
Mantid::Kernel::PropertyWithValue< PropertyManager_sptr > Mantid::Kernel::Property

Public Types

using BaseClass = PropertyWithValue< PropertyManager_sptr >
 
using ValueType = PropertyManager_sptr
 

Public Member Functions

PropertyManagerPropertyclone () const override
 'Virtual copy constructor' More...
 
std::string getDefault () const override
 
PropertyManagerPropertyoperator= (const PropertyManagerProperty &)=default
 
 PropertyManagerProperty (const PropertyManagerProperty &)=default
 
 PropertyManagerProperty (const std::string &name, const ValueType &defaultValue, unsigned int direction=Direction::Input)
 Constructor taking an initial value. More...
 
 PropertyManagerProperty (const std::string &name, unsigned int direction=Direction::Input)
 Constructor with a default empty pointer. More...
 
std::string setValue (const std::string &strValue) override
 Overwrite the current value. More...
 
std::string setValueFromJson (const Json::Value &value) override
 Sets the value of the property from a Json object. More...
 
std::string value () const override
 
Json::Value valueAsJson () const override
 Create a Json::Value objectValue from the PropertyManager. More...
 
- Public Member Functions inherited from Mantid::Kernel::PropertyWithValue< PropertyManager_sptr >
std::vector< std::string > allowedValues () const override
 Returns the set of valid values for this property, if such a set exists. More...
 
PropertyWithValue< PropertyManager_sptr > * clone () const override
 'Virtual copy constructor' More...
 
std::string getDefault () const override
 Get the default value for the property which is the value the property was initialised with. More...
 
IValidator_sptr getValidator () const
 
bool isDefault () const override
 Overriden function that returns if property has the same value that it was initialised with, if applicable. More...
 
bool isMultipleSelectionAllowed () override
 Is Multiple Selection Allowed. More...
 
std::string isValid () const override
 Overridden function that checks whether the property, if not overriden returns "". More...
 
virtual operator const PropertyManager_sptr & () const
 
bool operator!= (const PropertyWithValue< PropertyManager_sptr > &rhs) const
 
virtual const PropertyManager_sptroperator() () const
 
PropertyWithValueoperator+= (Property const *right) override
 Add to this. More...
 
virtual PropertyWithValueoperator= (const PropertyManager_sptr &value)
 
PropertyWithValueoperator= (const PropertyWithValue &right)
 
bool operator== (const PropertyWithValue< PropertyManager_sptr > &rhs) const
 
 PropertyWithValue (const PropertyWithValue< PropertyManager_sptr > &right)
 
 PropertyWithValue (const std::string &name, PropertyManager_sptr defaultValue, const std::string &defaultValueStr, IValidator_sptr validator, const unsigned int direction)
 
 PropertyWithValue (std::string name, PropertyManager_sptr defaultValue, const unsigned int direction)
 
 PropertyWithValue (std::string name, PropertyManager_sptr defaultValue, IValidator_sptr validator=IValidator_sptr(new NullValidator), const unsigned int direction=Direction::Input)
 
virtual void replaceValidator (IValidator_sptr newValidator)
 
MANTID_KERNEL_DLL void saveProperty (::NeXus::File *file)
 
MANTID_KERNEL_DLL void saveProperty (::NeXus::File *file)
 
MANTID_KERNEL_DLL void saveProperty (::NeXus::File *file)
 
MANTID_KERNEL_DLL void saveProperty (::NeXus::File *file)
 
MANTID_KERNEL_DLL void saveProperty (::NeXus::File *file)
 
MANTID_KERNEL_DLL void saveProperty (::NeXus::File *file)
 
MANTID_KERNEL_DLL void saveProperty (::NeXus::File *file)
 
MANTID_KERNEL_DLL void saveProperty (::NeXus::File *file)
 
MANTID_KERNEL_DLL void saveProperty (::NeXus::File *file)
 
void saveProperty (::NeXus::File *file) override
 
std::string setDataItem (const std::shared_ptr< DataItem > &data) override
 Set the value of the property via a DataItem pointer. More...
 
std::string setValue (const std::string &value) override
 Set the value of the property via a string. More...
 
std::string setValueFromJson (const Json::Value &value) override
 Set the value of the property via a Json object. More...
 
int size () const override
 Return the size of this property. More...
 
std::string value () const override
 Returns the value of the property as a string. More...
 
Json::Value valueAsJson () const override
 Returns the value of the property as a Json::Value. More...
 
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. More...
 
- Public Member Functions inherited from Mantid::Kernel::Property
virtual std::vector< std::string > allowedValues () const
 Returns the set of valid values for this property, if such a set exists. More...
 
bool autoTrim () const
 Returns if the property is set to automatically trim string unput values of whitespace. More...
 
void clearSettings ()
 Deletes the PropertySettings object contained. More...
 
virtual Propertyclone () const =0
 'Virtual copy constructor' More...
 
virtual const PropertyHistory createHistory () const
 Create a PropertyHistory object representing the current state of the Property. More...
 
void createTemporaryValue ()
 Create a temporary value for this property. More...
 
unsigned int direction () const
 returns the direction of the property More...
 
const std::string & documentation () const
 Get the property's documentation string. More...
 
virtual void filterByTime (const Types::Core::DateAndTime &start, const Types::Core::DateAndTime &stop)
 Filter out a property by time. More...
 
virtual std::string getDefault () const =0
 Get the default value for the property which is the value the property was initialised with. More...
 
const std::string & getGroup ()
 
virtual size_t getMemorySize () const
 
IPropertySettingsgetSettings ()
 
bool hasTemporaryValue () const
 Property is using a temporary value for this property. More...
 
virtual bool isDefault () const =0
 Overriden function that returns if property has the same value that it was initialised with, if applicable. More...
 
virtual bool isMultipleSelectionAllowed ()
 Is Multiple Selection Allowed. More...
 
virtual std::string isValid () const
 Overridden function that checks whether the property, if not overriden returns "". More...
 
virtual bool isValueSerializable () const
 Whether the string returned by value() can be used for serialization. More...
 
virtual Propertymerge (Property *)
 Just returns the property (*this) unless overridden. More...
 
const std::string & name () const
 Get the property's name. More...
 
virtual Propertyoperator+= (Property const *rhs)=0
 Add to this. More...
 
bool remember () const
 Whether to save input values. More...
 
virtual void saveProperty (::NeXus::File *)
 
void setAutoTrim (const bool &setting)
 Sets if the property is set to automatically trim string unput values of whitespace. More...
 
virtual std::string setDataItem (const std::shared_ptr< DataItem > &)=0
 Set the value of the property via a DataItem pointer. More...
 
void setDocumentation (const std::string &documentation)
 Sets the user level description of the property. More...
 
void setGroup (const std::string &group)
 Set the group this property belongs to. More...
 
void setRemember (bool)
 Set wheter to remeber this property input. More...
 
void setSettings (std::unique_ptr< IPropertySettings > settings)
 Set the PropertySettings object. More...
 
virtual void setUnits (const std::string &unit)
 Sets the units of the property, as a string. More...
 
virtual std::string setValue (const std::string &)=0
 Set the value of the property via a string. More...
 
virtual std::string setValueFromJson (const Json::Value &)=0
 Set the value of the property via a Json object. More...
 
virtual std::string setValueFromProperty (const Property &right)=0
 Set the value of the property via a reference to another property. More...
 
virtual int size () const
 Return the size of this property. More...
 
virtual void splitByTime (std::vector< SplittingInterval > &splitter, std::vector< Property * > outputs, bool isProtonCharge=true) const
 Split a property by time. More...
 
const std::string type () const
 Returns the type of the property as a string. More...
 
const std::type_info * type_info () const
 Get the property type_info. More...
 
virtual const std::string & units () const
 Returns the units of the property, if any, as a string. More...
 
virtual std::string value () const =0
 Returns the value of the property as a string. More...
 
virtual Json::Value valueAsJson () const =0
 Returns the value of the property as a Json::Value. More...
 
virtual std::string valueAsPrettyStr (const size_t maxLength=0, const bool collapseLists=true) const
 Returns the value of the property as a pretty printed string. More...
 
virtual ~Property ()
 Virtual destructor. More...
 

Private Attributes

std::string m_dataServiceKey
 
std::string m_defaultAsStr
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::Kernel::Property
 Property (const Property &right)
 Copy constructor. More...
 
 Property (std::string name, const std::type_info &type, const unsigned int &direction=Direction::Input)
 Constructor. More...
 
- Protected Attributes inherited from Mantid::Kernel::PropertyWithValue< PropertyManager_sptr >
PropertyManager_sptr m_initialValue
 the property's default value which is also its initial value More...
 
PropertyManager_sptr m_value
 The value of the property. More...
 
- Protected Attributes inherited from Mantid::Kernel::Property
std::string m_name
 The name of the property. More...
 

Detailed Description

Definition at line 15 of file PropertyManagerProperty.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 18 of file PropertyManagerProperty.h.

◆ ValueType

Definition at line 19 of file PropertyManagerProperty.h.

Constructor & Destructor Documentation

◆ PropertyManagerProperty() [1/3]

Mantid::Kernel::PropertyManagerProperty::PropertyManagerProperty ( const std::string &  name,
unsigned int  direction = Direction::Input 
)

Constructor with a default empty pointer.

Parameters
nameThe name of the property
directionDirection of the property

Definition at line 26 of file PropertyManagerProperty.cpp.

◆ PropertyManagerProperty() [2/3]

Mantid::Kernel::PropertyManagerProperty::PropertyManagerProperty ( const std::string &  name,
const ValueType defaultValue,
unsigned int  direction = Direction::Input 
)

Constructor taking an initial value.

Parameters
nameThe name of the property
defaultValueA default value for the property
directionDirection of the property

Definition at line 35 of file PropertyManagerProperty.cpp.

References m_defaultAsStr, and Mantid::Kernel::Property::name().

◆ PropertyManagerProperty() [3/3]

Mantid::Kernel::PropertyManagerProperty::PropertyManagerProperty ( const PropertyManagerProperty )
default

Member Function Documentation

◆ clone()

PropertyManagerProperty * Mantid::Kernel::PropertyManagerProperty::clone ( ) const
inlineoverridevirtual

'Virtual copy constructor'

Implements Mantid::Kernel::Property.

Definition at line 29 of file PropertyManagerProperty.h.

◆ getDefault()

std::string Mantid::Kernel::PropertyManagerProperty::getDefault ( ) const
overridevirtual
Returns
The string representation of the default value

Implements Mantid::Kernel::Property.

Definition at line 65 of file PropertyManagerProperty.cpp.

References m_defaultAsStr.

◆ operator=()

PropertyManagerProperty & Mantid::Kernel::PropertyManagerProperty::operator= ( const PropertyManagerProperty )
default

◆ setValue()

std::string Mantid::Kernel::PropertyManagerProperty::setValue ( const std::string &  strValue)
overridevirtual

Overwrite the current value.

The string is expected to contain either:

  • the key to a PropertyManager stored in the PropertyManagerDataService
  • or json-serialized data, where the properties must already exist on the containing PropertyManager
    Parameters
    strValueA string assumed to contain serialized Json
    Returns
    If an error occurred then this contains an error message, otherwise an empty string

Implements Mantid::Kernel::Property.

Definition at line 76 of file PropertyManagerProperty.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), m_dataServiceKey, and value().

◆ setValueFromJson()

std::string Mantid::Kernel::PropertyManagerProperty::setValueFromJson ( const Json::Value &  value)
overridevirtual

Sets the value of the property from a Json object.

Parameters
valueA Json objectValue
Returns
An empty string indicating success otherwise a help message indicating what error has occurred

Implements Mantid::Kernel::Property.

Definition at line 117 of file PropertyManagerProperty.cpp.

References Mantid::Kernel::createPropertyManager(), std::to_string(), and value().

◆ value()

std::string Mantid::Kernel::PropertyManagerProperty::value ( ) const
overridevirtual
Returns
The value of the property represented as a string

Implements Mantid::Kernel::Property.

Definition at line 48 of file PropertyManagerProperty.cpp.

References m_dataServiceKey.

Referenced by setValue(), and setValueFromJson().

◆ valueAsJson()

Json::Value Mantid::Kernel::PropertyManagerProperty::valueAsJson ( ) const
overridevirtual

Create a Json::Value objectValue from the PropertyManager.

Implements Mantid::Kernel::Property.

Definition at line 59 of file PropertyManagerProperty.cpp.

Member Data Documentation

◆ m_dataServiceKey

std::string Mantid::Kernel::PropertyManagerProperty::m_dataServiceKey
private

Definition at line 38 of file PropertyManagerProperty.h.

Referenced by setValue(), and value().

◆ m_defaultAsStr

std::string Mantid::Kernel::PropertyManagerProperty::m_defaultAsStr
private

Definition at line 39 of file PropertyManagerProperty.h.

Referenced by getDefault(), and PropertyManagerProperty().


The documentation for this class was generated from the following files: