|
Mantid
|
Property manager helper class. More...
#include <PropertyManager.h>
Public Member Functions | |
| ::Json::Value | asJson (bool withDefaultValues=false) const override |
| Return the property manager serialized as a json object. | |
| std::string | asString (bool withDefaultValues=false) const override |
| Return the property manager serialized as a string. | |
| void | clear () override final |
| Clears the whole property map. | |
| PropertyManager * | cloneInTimeROI (const Kernel::TimeROI &timeROI) |
| Create a partial copy of this object such that every time series property is cloned according to the input TimeROI. | |
| void | declareOrReplaceProperty (std::unique_ptr< Property > p, const std::string &doc="") override |
| Add or replace a property in the list of managed properties. | |
| void | declareProperty (const std::string &name, const char *value, const std::string &doc, IValidator_sptr validator=std::make_shared< NullValidator >(), const unsigned int direction=Direction::Input) |
| Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). | |
| void | declareProperty (const std::string &name, const char *value, const unsigned int direction) |
| Add a property of string type to the list of managed properties. | |
| void | declareProperty (const std::string &name, const char *value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc=std::string(), const unsigned int direction=Direction::Input) |
| Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, const std::string &doc, const unsigned int direction=Direction::Input) |
| Add a property to the list of managed properties with no validator. | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, const unsigned int direction) |
| Add a property of the template type to the list of managed properties. | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc="", const unsigned int direction=Direction::Input) |
| Add a property of the template type to the list of managed properties. | |
| void | declareProperty (std::unique_ptr< Property > p, const std::string &doc="") override |
| Add a property to the list of managed properties. | |
| virtual void | declareProperty (std::unique_ptr< Property > p, const std::string &doc="")=0 |
| Function to declare properties (i.e. store them) | |
| bool | existsProperty (const std::string &name) const override |
| Checks whether the named property is already in the list of managed property. | |
| void | filterByProperty (Mantid::Kernel::LogFilter *logFilter, const std::vector< std::string > &excludedFromFiltering=std::vector< std::string >()) override |
| Filter the managed properties by the given boolean property mask. | |
| std::vector< std::string > | getDeclaredPropertyNames () const noexcept override |
| Return the list of declared property names. | |
| Property * | getPointerToProperty (const std::string &name) const override |
| Get a property by name. | |
| const std::vector< Property * > & | getProperties () const override |
| Get the list of managed properties. | |
| TypedValue | getProperty (const std::string &name) const override |
| Get the value of a property. | |
| std::string | getPropertyValue (const std::string &name) const override |
| Get the value of a property as a string. | |
| bool | operator!= (const PropertyManager &other) const |
| PropertyManager & | operator+= (const PropertyManager &rhs) |
| Addition operator. | |
| PropertyManager & | operator= (const PropertyManager &) |
| Assignment operator - performs a deep copy. | |
| bool | operator== (const PropertyManager &other) const |
| size_t | propertyCount () const override |
| Count the number of properties under management. | |
| PropertyManager () | |
| Default constructor. | |
| PropertyManager (const PropertyManager &) | |
| copy constructor | |
| void | removeDataOutsideTimeROI (const Kernel::TimeROI &timeROI) |
| For time series properties, remove time values outside of TimeROI regions, each defined as [roi_begin,roi_end]. | |
| void | removeProperty (const std::string &name, const bool delproperty=true) override |
| removes the property from properties map | |
| void | resetProperties () override |
| Reset property values back to initial values (blank or default values) | |
| void | setProperties (const ::Json::Value &jsonValue, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) override |
| Set the ordered list of properties by a json value collection. | |
| void | setProperties (const ::Json::Value &jsonValue, IPropertyManager *targetPropertyManager, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) |
| Set the ordered list of properties by a json value collection. | |
| void | setProperties (const std::string &propertiesJson, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) override |
| Set the ordered list of properties by one string of values, separated by semicolons. | |
| void | setProperties (const std::string &propertiesJson, IPropertyManager *targetPropertyManager, const std::unordered_set< std::string > &ignoreProperties, bool createMissing=false) |
| Set the ordered list of properties by one string of values, separated by semicolons. | |
| void | setPropertiesWithString (const std::string &propertiesString, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >()) override |
| Sets all the declared properties from a string. | |
| void | setPropertyOrdinal (const int &index, const std::string &value) override |
| Set the value of a property by an index N.B. | |
| void | setPropertyValue (const std::string &name, const std::string &value) override |
| Set the value of a property by string N.B. | |
| void | setPropertyValueFromJson (const std::string &name, const Json::Value &value) override |
| Set the value of a property by Json::Value. | |
| std::unique_ptr< Property > | takeProperty (const size_t index) override |
| removes the property from the properties map and returns a pointer to it | |
| bool | validateProperties () const override |
| Validates all the properties in the collection. | |
| virtual | ~PropertyManager () override |
| Virtual destructor. | |
Public Member Functions inherited from Mantid::Kernel::IPropertyManager | |
| void | declareProperty (const std::string &name, const char *value, const std::string &doc, IValidator_sptr validator=std::make_shared< NullValidator >(), const unsigned int direction=Direction::Input) |
| Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). | |
| void | declareProperty (const std::string &name, const char *value, const unsigned int direction) |
| Add a property of string type to the list of managed properties. | |
| void | declareProperty (const std::string &name, const char *value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc=std::string(), const unsigned int direction=Direction::Input) |
| Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, const std::string &doc, const unsigned int direction=Direction::Input) |
| Add a property to the list of managed properties with no validator. | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, const unsigned int direction) |
| Add a property of the template type to the list of managed properties. | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc="", const unsigned int direction=Direction::Input) |
| Add a property of the template type to the list of managed properties. | |
| std::vector< Property * > | getPropertiesInGroup (const std::string &group) const |
| Get the list of managed properties in a given group. | |
| IPropertyManager * | setProperty (const std::string &name, const char *value) |
| Specialised version of setProperty template method to handle const char *. | |
| IPropertyManager * | setProperty (const std::string &name, const std::string &value) |
| Specialised version of setProperty template method to handle std::string. | |
| template<typename T > | |
| IPropertyManager * | setProperty (const std::string &name, const T &value) |
| Templated method to set the value of a PropertyWithValue. | |
| template<typename T > | |
| IPropertyManager * | setProperty (const std::string &name, std::unique_ptr< T > value) |
| Templated method to set the value of a PropertyWithValue from a std::unique_ptr. | |
| void | setPropertyGroup (const std::string &name, const std::string &group) |
| Set the group for a given property. | |
| void | setPropertySettings (const std::string &name, std::unique_ptr< IPropertySettings > settings) |
| void | updatePropertyValues (const IPropertyManager &other) |
| Update values of the existing properties. | |
| virtual | ~IPropertyManager ()=default |
Static Public Member Functions | |
| static std::string | getInvalidValuesFilterLogName (const std::string &logName) |
| Gets the correct log name for the matching invalid values log for a given log name. | |
| static std::string | getLogNameFromInvalidValuesFilter (const std::string &logName) |
| static bool | isAnInvalidValuesFilterLog (const std::string &logName) |
| Determine if the log's name has a substring indicating it should not be filtered. | |
Static Public Attributes | |
| static const std::string | INVALID_VALUES_SUFFIX = "_invalid_values" |
Protected Member Functions | |
| Property * | getPointerToPropertyOrdinal (const int &index) const override |
| Get a property by an index. | |
| Property * | getPointerToPropertyOrNull (const std::string &name) const |
| Get a property by name. | |
Protected Member Functions inherited from Mantid::Kernel::IPropertyManager | |
| virtual void | afterPropertySet (const std::string &) |
| Override this method to perform a custom action right after a property was set. | |
| template<typename T > | |
| T | getValue (const std::string &name) const |
| Templated method to get the value of a property. | |
| template<> | |
| MANTID_KERNEL_DLL PropertyManager_sptr | getValue (const std::string &name) const |
| template<> | |
| MANTID_KERNEL_DLL PropertyManager_const_sptr | getValue (const std::string &name) const |
Private Types | |
| using | PropertyMap = std::map< std::string, std::unique_ptr< Property > > |
| typedef for the map holding the properties | |
Private Member Functions | |
| void | setPropertiesWithJSONString (const std::string &propertiesString, const std::unordered_set< std::string > &ignoreProperties) |
| Sets all the declared properties from a string. | |
| void | setPropertiesWithSimpleString (const std::string &propertiesString, const std::unordered_set< std::string > &ignoreProperties) |
| Sets all the declared properties from a string. | |
Private Attributes | |
| std::vector< Property * > | m_orderedProperties |
| Stores the order in which the properties were declared. | |
| PropertyMap | m_properties |
| The properties under management. | |
Friends | |
| class | PropertyManagerOwner |
Property manager helper class.
This class is used by algorithms and services for helping to manage their own set of properties.
N.B. ONCE YOU HAVE DECLARED A PROPERTY TO THE MANAGER IT IS OWNED BY THIS CLASS (declareProperty sinks the unique_ptr passed in.)
Property values of any type except std::string can be extracted using getProperty(). For assignment of string properties it is necessary to use getPropertyValue().
Definition at line 44 of file PropertyManager.h.
|
private |
typedef for the map holding the properties
Definition at line 133 of file PropertyManager.h.
| Mantid::Kernel::PropertyManager::PropertyManager | ( | ) |
Default constructor.
Definition at line 65 of file PropertyManager.cpp.
Referenced by cloneInTimeROI().
| Mantid::Kernel::PropertyManager::PropertyManager | ( | const PropertyManager & | other | ) |
copy constructor
| other | :: the PropertyManager to copy |
Definition at line 70 of file PropertyManager.cpp.
References m_orderedProperties, and m_properties.
|
overridevirtual |
|
overridevirtual |
Return the property manager serialized as a json object.
Note that this method does not serialize WorkspaceProperties with workspaces not in the ADS.
| withDefaultValues | :: If true then the value of default parameters will be included |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 564 of file PropertyManager.cpp.
References count, getPointerToPropertyOrdinal(), Mantid::Kernel::Property::getSettings(), Mantid::Kernel::Property::isDefault(), Mantid::Kernel::IPropertySettings::isEnabled(), Mantid::Kernel::Property::isValueSerializable(), Mantid::Kernel::Property::name(), propertyCount(), and Mantid::Kernel::Property::valueAsJson().
Referenced by asString(), and Mantid::Kernel::encodeAsJson().
|
overridevirtual |
Return the property manager serialized as a string.
The format is propName=value,propName=value,propName=value
| withDefaultValues | :: If true then the value of default parameters will be included |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 550 of file PropertyManager.cpp.
References asJson().
Referenced by Mantid::Geometry::CompositeBraggScatterer::clone(), and Mantid::Geometry::IsotropicAtomBraggScatterer::clone().
|
finaloverridevirtual |
Clears the whole property map.
Implements Mantid::Kernel::IPropertyManager.
Definition at line 720 of file PropertyManager.cpp.
References m_orderedProperties, and m_properties.
Referenced by operator=(), and ~PropertyManager().
| PropertyManager * Mantid::Kernel::PropertyManager::cloneInTimeROI | ( | const Kernel::TimeROI & | timeROI | ) |
Create a partial copy of this object such that every time series property is cloned according to the input TimeROI.
A partially cloned time series property should include all time values enclosed by the ROI regions, each defined as [roi_begin,roi_end], plus the values immediately before and after an ROI region, if available. Properties that are not time series will be cloned with no changes.
| timeROI | :: time region of interest, i.e. time boundaries used to determine which time series values should be included in the copy. |
Definition at line 185 of file PropertyManager.cpp.
References m_orderedProperties, m_properties, and PropertyManager().
|
overridevirtual |
Add or replace a property in the list of managed properties.
| p | :: The property object to add (sinks the unique_ptr) |
| doc | :: A description of the property that may be displayed to users |
| std::invalid_argument | if the property declared has an empty name. |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 242 of file PropertyManager.cpp.
References m_orderedProperties, and m_properties.
|
inline |
Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string).
The validator, if provided, needs to be a string validator.
| name | :: The name to assign to the property |
| value | :: The initial value to assign to the property |
| doc | :: The (optional) documentation string |
| validator | :: Pointer to the (optional) validator. Ownership will be taken over. |
| direction | :: The (optional) direction of the property, in, out or inout |
| Exception::ExistsError | if a property with the given name already exists |
| std::invalid_argument | if the name argument is empty |
| std::invalid_argument | if value is a nullptr |
Definition at line 166 of file IPropertyManager.h.
|
inline |
Add a property of string type to the list of managed properties.
| name | :: The name to assign to the property |
| value | :: The initial value to assign to the property |
| direction | :: The direction of the property, in, out or inout |
| Exception::ExistsError | if a property with the given name already exists |
| std::invalid_argument | if the name argument is empty |
Definition at line 183 of file IPropertyManager.h.
|
inline |
Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string).
The validator, if provided, needs to be a string validator.
| name | :: The name to assign to the property |
| value | :: The initial value to assign to the property |
| validator | :: Pointer to the (optional) validator. Ownership will be taken over. |
| doc | :: The (optional) documentation string |
| direction | :: The (optional) direction of the property, in, out or inout |
| Exception::ExistsError | if a property with the given name already exists |
| std::invalid_argument | if the name argument is empty |
| std::invalid_argument | if value is a nullptr |
Definition at line 137 of file IPropertyManager.h.
|
inline |
Add a property to the list of managed properties with no validator.
| name | :: The name to assign to the property |
| value | :: The initial value to assign to the property |
| doc | :: The documentation string |
| direction | :: The (optional) direction of the property, in (default), out or inout |
| Exception::ExistsError | if a property with the given name already exists |
| std::invalid_argument | if the name argument is empty |
Definition at line 98 of file IPropertyManager.h.
|
inline |
Add a property of the template type to the list of managed properties.
| name | :: The name to assign to the property |
| value | :: The initial value to assign to the property |
| direction | :: The direction of the property, in, out or inout |
| Exception::ExistsError | if a property with the given name already exists |
| std::invalid_argument | if the name argument is empty |
Definition at line 113 of file IPropertyManager.h.
|
inline |
Add a property of the template type to the list of managed properties.
| name | :: The name to assign to the property |
| value | :: The initial value to assign to the property |
| validator | :: Pointer to the (optional) validator. |
| doc | :: The (optional) documentation string |
| direction | :: The (optional) direction of the property, in, out or inout |
| Exception::ExistsError | if a property with the given name already exists |
| std::invalid_argument | if the name argument is empty |
Definition at line 81 of file IPropertyManager.h.
|
overridevirtual |
Add a property to the list of managed properties.
| p | :: The property object to add (sinks the unique_ptr) |
| doc | :: A description of the property that may be displayed to users |
| Exception::ExistsError | if a property with the given name already exists |
| std::invalid_argument | if the property declared has an empty name. |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 221 of file PropertyManager.cpp.
References m_orderedProperties, and m_properties.
Referenced by Mantid::Geometry::BraggScattererInCrystalStructure::declareProperties(), Mantid::Geometry::IsotropicAtomBraggScatterer::declareScattererProperties(), Mantid::DataHandling::SetSample::exec(), Mantid::DataHandling::SetSample::materialSettingsEnsureLegacyCompatibility(), Mantid::API::Run::mergeMergables(), operator+=(), Mantid::Geometry::CompositeBraggScatterer::redeclareProperties(), and Mantid::API::AlgorithmRuntimeProps::setPropertyValue().
|
virtual |
Function to declare properties (i.e. store them)
Implements Mantid::Kernel::IPropertyManager.
|
overridevirtual |
Checks whether the named property is already in the list of managed property.
| name | :: The name of the property (case insensitive) |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 500 of file PropertyManager.cpp.
References m_properties, and name.
Referenced by Mantid::DataHandling::SetSample::createCylinderLikeXML(), Mantid::DataHandling::SetSample::createFlatPlateHolderXML(), Mantid::DataHandling::SetSample::createFlatPlateXML(), Mantid::DataHandling::SetSample::exec(), filterByProperty(), Mantid::DataHandling::SetSample::materialSettingsEnsureLegacyCompatibility(), Mantid::Geometry::CompositeBraggScatterer::redeclareProperties(), removeProperty(), Mantid::DataHandling::SetSample::setMaterial(), Mantid::API::AlgorithmRuntimeProps::setPropertyValue(), and Mantid::DataHandling::SetSample::tryCreateXMLFromArgsOnly().
|
overridevirtual |
Filter the managed properties by the given boolean property mask.
It replaces all time series properties with filtered time series properties
| logFilter | :: A LogFilter instance to filter each log on |
| excludedFromFiltering | :: A string list of properties that will be excluded from filtering |
Reimplemented from Mantid::Kernel::IPropertyManager.
Definition at line 138 of file PropertyManager.cpp.
References Mantid::Kernel::LogFilter::addFilter(), existsProperty(), Mantid::Kernel::LogFilter::filter(), getInvalidValuesFilterLogName(), getPointerToProperty(), isAnInvalidValuesFilterLog(), m_orderedProperties, m_properties, and Mantid::Kernel::Property::name().
|
overridevirtualnoexcept |
Return the list of declared property names.
Implements Mantid::Kernel::IPropertyManager.
Definition at line 650 of file PropertyManager.cpp.
References getProperties().
|
static |
Gets the correct log name for the matching invalid values log for a given log name.
Definition at line 43 of file PropertyManager.cpp.
References INVALID_VALUES_SUFFIX.
Referenced by export_PropertyManager(), filterByProperty(), and Mantid::API::LogManager::getInvalidValuesFilterLogName().
|
static |
Definition at line 46 of file PropertyManager.cpp.
References INVALID_VALUES_SUFFIX, and isAnInvalidValuesFilterLog().
Referenced by export_PropertyManager().
|
overridevirtual |
Get a property by name.
| name | :: The name of the property (case insensitive) |
| Exception::NotFoundError | if the named property is unknown |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 601 of file PropertyManager.cpp.
References m_properties, and name.
Referenced by filterByProperty(), getPropertyValue(), operator+=(), removeProperty(), setPropertyValue(), and setPropertyValueFromJson().
|
overrideprotectedvirtual |
Get a property by an index.
| index | :: The name of the property (case insensitive) |
| std::runtime_error | if the property index is too high |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 630 of file PropertyManager.cpp.
References index, and m_orderedProperties.
Referenced by asJson(), and setPropertyOrdinal().
|
protected |
Get a property by name.
| name | :: The name of the property (case insensitive) |
Definition at line 615 of file PropertyManager.cpp.
References m_properties, and name.
|
overridevirtual |
Get the list of managed properties.
The properties will be stored in the order that they were declared.
Implements Mantid::Kernel::IPropertyManager.
Definition at line 643 of file PropertyManager.cpp.
References m_orderedProperties.
Referenced by Mantid::CurveFitting::Algorithms::Fit::copyMinimizerOutput(), getDeclaredPropertyNames(), Mantid::Geometry::CompositeBraggScatterer::getPropertyCountMap(), Mantid::API::Run::mergeMergables(), and resetProperties().
|
overridevirtual |
Get the value of a property.
Allows you to assign directly to a variable of the property's type (if a supported type).
*** This method does NOT work for assigning to an existing std::string. In this case you have to use getPropertyValue() instead. Note that you can, though, construct a local string variable by writing, e.g. std::string s = getProperty("myProperty"). ***
| name | :: The name of the property |
| std::runtime_error | If an attempt is made to assign a property to a different type |
| Exception::NotFoundError | If the property requested does not exist |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 676 of file PropertyManager.cpp.
References name.
Referenced by Mantid::Geometry::BraggScattererInCrystalStructure::afterPropertySet(), Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::convergenceCheck(), Mantid::DataHandling::SetSample::createSphereXML(), Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::finalize(), Mantid::Geometry::IsotropicAtomBraggScatterer::getOccupancy(), Mantid::API::AlgorithmRuntimeProps::getProperty(), Mantid::Geometry::IsotropicAtomBraggScatterer::getU(), Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::initChainsAndParameters(), Mantid::CurveFitting::FuncMinimisers::TrustRegionMinimizer::initialize(), Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::initSimulatedAnnealing(), Mantid::Geometry::BraggScatterer::isPropertyExposedToComposite(), Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::iterate(), Mantid::CurveFitting::FuncMinimisers::LevenbergMarquardtMDMinimizer::iterate(), Mantid::CurveFitting::FuncMinimisers::DampedGaussNewtonMinimizer::iterate(), Mantid::CurveFitting::FuncMinimisers::LevenbergMarquardtMinimizer::iterate(), Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::jumpUpdate(), Mantid::DataHandling::SetSample::materialSettingsEnsureLegacyCompatibility(), Mantid::API::Run::mergeMergables(), Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::outputPDF(), and Mantid::DataHandling::SetSample::setMaterial().
|
overridevirtual |
Get the value of a property as a string.
| name | :: The name of the property (case insensitive) |
| Exception::NotFoundError | if the named property is unknown |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 537 of file PropertyManager.cpp.
References getPointerToProperty(), name, and Mantid::Kernel::Property::value().
Referenced by Mantid::Geometry::IsotropicAtomBraggScatterer::afterScattererPropertySet(), Mantid::DataHandling::SetSample::createCylinderLikeXML(), Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::finalize(), Mantid::Geometry::CompositeBraggScatterer::propagateProperty(), Mantid::Geometry::CompositeBraggScatterer::redeclareProperties(), Mantid::DataHandling::SetSample::setMaterial(), Mantid::DataHandling::SetSample::tryCreateXMLFromArgsOnly(), and Mantid::DataHandling::SetSample::validateGeometry().
|
static |
Determine if the log's name has a substring indicating it should not be filtered.
Definition at line 55 of file PropertyManager.cpp.
References INVALID_VALUES_SUFFIX.
Referenced by export_PropertyManager(), filterByProperty(), and getLogNameFromInvalidValuesFilter().
| bool Mantid::Kernel::PropertyManager::operator!= | ( | const PropertyManager & | other | ) | const |
Definition at line 593 of file PropertyManager.cpp.
References operator==().
| PropertyManager & Mantid::Kernel::PropertyManager::operator+= | ( | const PropertyManager & | rhs | ) |
Addition operator.
| rhs | :: The object that is being added to this. |
Definition at line 108 of file PropertyManager.cpp.
References declareProperty(), getPointerToProperty(), and rhs.
| PropertyManager & Mantid::Kernel::PropertyManager::operator= | ( | const PropertyManager & | other | ) |
Assignment operator - performs a deep copy.
| other | :: the PropertyManager to copy |
Definition at line 84 of file PropertyManager.cpp.
References clear(), m_orderedProperties, and m_properties.
| bool Mantid::Kernel::PropertyManager::operator== | ( | const PropertyManager & | other | ) | const |
Definition at line 581 of file PropertyManager.cpp.
References m_properties, and value.
Referenced by operator!=().
|
overridevirtual |
Count the number of properties under management.
Implements Mantid::Kernel::IPropertyManager.
Definition at line 529 of file PropertyManager.cpp.
References m_orderedProperties.
Referenced by asJson().
| void Mantid::Kernel::PropertyManager::removeDataOutsideTimeROI | ( | const Kernel::TimeROI & | timeROI | ) |
For time series properties, remove time values outside of TimeROI regions, each defined as [roi_begin,roi_end].
However, keep the values immediately before and after each ROI region, if available.
| timeROI | :: a series of time regions used to determine which values to remove or to keep |
Definition at line 206 of file PropertyManager.cpp.
References m_orderedProperties, and removeDataOutsideTimeROI().
Referenced by removeDataOutsideTimeROI().
|
overridevirtual |
removes the property from properties map
Removes the property from properties map.
| name | :: name of the property to be removed. |
| delproperty | :: if true, delete the named property |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 685 of file PropertyManager.cpp.
References existsProperty(), getPointerToProperty(), m_orderedProperties, m_properties, and name.
Referenced by Mantid::Geometry::CompositeBraggScatterer::redeclareProperties().
|
overridevirtual |
Reset property values back to initial values (blank or default values)
Implements Mantid::Kernel::IPropertyManager.
Definition at line 263 of file PropertyManager.cpp.
References getProperties().
|
overridevirtual |
Set the ordered list of properties by a json value collection.
| jsonValue | :: The jsonValue of property values |
| ignoreProperties | :: A set of names of any properties NOT to set from the propertiesArray |
| createMissing | :: If the property does not exist then create it |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 318 of file PropertyManager.cpp.
References setProperties().
| void Mantid::Kernel::PropertyManager::setProperties | ( | const ::Json::Value & | jsonValue, |
| IPropertyManager * | targetPropertyManager, | ||
| const std::unordered_set< std::string > & | ignoreProperties = std::unordered_set<std::string>(), |
||
| bool | createMissing = false |
||
| ) |
Set the ordered list of properties by a json value collection.
| jsonValue | :: The jsonValue of property values |
| ignoreProperties | :: A set of names of any properties NOT to set from the propertiesArray |
| targetPropertyManager | :: the propertymanager to make the changes to, most of the time this will be *this |
| createMissing | :: If the property does not exist then create it |
Definition at line 333 of file PropertyManager.cpp.
References Mantid::Kernel::IPropertyManager::declareOrReplaceProperty(), Mantid::Kernel::decodeAsProperty(), Mantid::Kernel::IPropertyManager::setPropertyValue(), Mantid::Kernel::IPropertyManager::setPropertyValueFromJson(), and value.
|
overridevirtual |
Set the ordered list of properties by one string of values, separated by semicolons.
The string should be a json formatted collection of name value pairs
| propertiesJson | :: The string of property values |
| ignoreProperties | :: A set of names of any properties NOT to set from the propertiesArray |
| createMissing | :: If the property does not exist then create it |
| invalid_argument | if error in parameters |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 282 of file PropertyManager.cpp.
References setProperties().
Referenced by setProperties(), setProperties(), setProperties(), setPropertiesWithJSONString(), and setPropertiesWithSimpleString().
| void Mantid::Kernel::PropertyManager::setProperties | ( | const std::string & | propertiesJson, |
| IPropertyManager * | targetPropertyManager, | ||
| const std::unordered_set< std::string > & | ignoreProperties, | ||
| bool | createMissing = false |
||
| ) |
Set the ordered list of properties by one string of values, separated by semicolons.
The string should be a json formatted collection of name value pairs
| propertiesJson | :: The string of property values |
| ignoreProperties | :: A set of names of any properties NOT to set from the propertiesArray |
| targetPropertyManager | :: the propertymanager to make the changes to, most of the time this will be *this |
| createMissing | :: If the property does not exist then create it |
| invalid_argument | if error in parameters |
Definition at line 300 of file PropertyManager.cpp.
References setProperties().
|
private |
Sets all the declared properties from a string.
| propertiesString | :: A JSON code string. |
| ignoreProperties | :: A set of names of any properties NOT to set from the propertiesArray |
Definition at line 388 of file PropertyManager.cpp.
References setProperties().
Referenced by setPropertiesWithString().
|
private |
Sets all the declared properties from a string.
| propertiesString | :: A list of name = value pairs separated by a semicolon |
| ignoreProperties | :: A set of names of any properties NOT to set from the propertiesArray |
Definition at line 405 of file PropertyManager.cpp.
References n, setProperties(), Mantid::Kernel::StringTokenizer::TOK_TRIM, and value.
Referenced by setPropertiesWithString().
|
overridevirtual |
Sets all the declared properties from a string.
| propertiesString | :: Either a list of name = value pairs separated by a semicolon or a JSON code string. |
| ignoreProperties | :: A set of names of any properties NOT to set from the propertiesArray |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 367 of file PropertyManager.cpp.
References setPropertiesWithJSONString(), and setPropertiesWithSimpleString().
|
overridevirtual |
Set the value of a property by an index N.B.
bool properties must be set using 1/0 rather than true/false
| index | :: The index of the property to assign |
| value | :: The value to assign to the property |
| std::runtime_error | if the property index is too high |
| std::invalid_argument | If the value is not valid for the property given |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 484 of file PropertyManager.cpp.
References Mantid::Kernel::IPropertyManager::afterPropertySet(), getPointerToPropertyOrdinal(), index, Mantid::Kernel::Property::name(), Mantid::Kernel::Property::setValue(), Mantid::Kernel::Property::type(), and value.
|
overridevirtual |
Set the value of a property by string N.B.
bool properties must be set using 1/0 rather than true/false
| name | :: The name of the property (case insensitive) |
| value | :: The value to assign to the property |
| Exception::NotFoundError | if the named property is unknown |
| std::invalid_argument | If the value is not valid for the property given |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 446 of file PropertyManager.cpp.
References Mantid::Kernel::IPropertyManager::afterPropertySet(), getPointerToProperty(), name, and value.
Referenced by Mantid::API::AlgorithmRuntimeProps::setPropertyValue().
|
overridevirtual |
Set the value of a property by Json::Value.
| name | :: The name of the property (case insensitive) |
| value | :: The value to assign to the property |
| Exception::NotFoundError | if the named property is unknown |
| std::invalid_argument | If the value is not valid for the property given |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 464 of file PropertyManager.cpp.
References Mantid::Kernel::IPropertyManager::afterPropertySet(), getPointerToProperty(), name, and value.
|
overridevirtual |
removes the property from the properties map and returns a pointer to it
Removes a property from the properties map by index and return a pointer to it.
| index | :: index of the property to be removed |
Implements Mantid::Kernel::IPropertyManager.
Definition at line 703 of file PropertyManager.cpp.
References index, m_orderedProperties, and m_properties.
|
overridevirtual |
Validates all the properties in the collection.
Implements Mantid::Kernel::IPropertyManager.
Definition at line 510 of file PropertyManager.cpp.
References error, Mantid::Kernel::Logger::error(), Mantid::Kernel::DateAndTimeHelpers::g_log, and m_properties.
|
friend |
Definition at line 121 of file PropertyManager.h.
|
static |
Definition at line 46 of file PropertyManager.h.
Referenced by getInvalidValuesFilterLogName(), getLogNameFromInvalidValuesFilter(), and isAnInvalidValuesFilterLog().
|
private |
Stores the order in which the properties were declared.
Definition at line 137 of file PropertyManager.h.
Referenced by clear(), cloneInTimeROI(), declareOrReplaceProperty(), declareProperty(), filterByProperty(), getPointerToPropertyOrdinal(), getProperties(), operator=(), propertyCount(), PropertyManager(), removeDataOutsideTimeROI(), removeProperty(), and takeProperty().
|
private |
The properties under management.
Definition at line 135 of file PropertyManager.h.
Referenced by clear(), cloneInTimeROI(), declareOrReplaceProperty(), declareProperty(), existsProperty(), filterByProperty(), getPointerToProperty(), getPointerToPropertyOrNull(), operator=(), operator==(), PropertyManager(), removeProperty(), takeProperty(), and validateProperties().