|
Mantid
|
IndexProperty : Implementation of a property type which returns a SpectrumIndexSet provided an input vector of integers or a string. More...
#include <IndexProperty.h>
Public Member Functions | |
| IndexProperty * | clone () const override |
| 'Virtual copy constructor' | |
| Indexing::IndexInfo | getFilteredIndexInfo () const |
| Return IndexInfo created from workspace but containing selected spectra. | |
| Indexing::SpectrumIndexSet | getIndices () const |
| IndexProperty (const IndexProperty &)=default | |
| IndexProperty (const std::string &name, const IWorkspaceProperty &workspaceProp, const IndexTypeProperty &indexTypeProp, const Kernel::IValidator_sptr &validator=Kernel::IValidator_sptr(new Kernel::NullValidator)) | |
| bool | isDefault () const override |
| Overriden function that returns if property has the same value that it was initialised with, if applicable. | |
| std::string | isValid () const override |
| Overridden function that checks whether the property, if not overriden returns "". | |
| operator Indexing::SpectrumIndexSet () const | |
| IndexProperty & | operator= (const IndexProperty &)=delete |
| IndexProperty & | operator= (const std::string &rhs) |
Public Member Functions inherited from Mantid::Kernel::ArrayProperty< int64_t > | |
| ArrayProperty (const ArrayProperty &) | |
| ArrayProperty (const std::string &name, const IValidator_sptr &validator, const unsigned int direction=Direction::Input) | |
| Constructor Will lead to the property having a default-constructed (i.e. | |
| ArrayProperty (const std::string &name, const std::string &values, const IValidator_sptr &validator=IValidator_sptr(new NullValidator), const unsigned int direction=Direction::Input) | |
| Constructor from which you can set the property's values through a string: | |
| ArrayProperty (const std::string &name, const unsigned int direction=Direction::Input) | |
| Constructor that's useful for output properties or inputs with an empty default and no validator. | |
| ArrayProperty (const std::string &name, std::vector< int64_t > vec, const IValidator_sptr &validator=IValidator_sptr(new NullValidator), const unsigned int direction=Direction::Input) | |
| Constructor. | |
| std::string | setValue (const std::string &value) override |
| Sets the values stored in the ArrayProperty from a string representation. | |
| std::string | value () const override |
| Returns the values stored in the ArrayProperty. | |
Public Member Functions inherited from Mantid::Kernel::PropertyWithValue< TYPE > | |
| std::vector< std::string > | allowedValues () const override |
| Returns the set of valid values for this property, if such a set exists. | |
| PropertyWithValue< TYPE > * | clone () const override |
| 'Virtual copy constructor' | |
| std::string | getDefault () const override |
| Get the value the property was initialised with -its default value. | |
| IValidator_sptr | getValidator () const |
| Returns the validator as a constant variable so it cannot be changed. | |
| bool | isDefault () const override |
| Indicates if the property's value is the same as it was when it was set N.B. | |
| bool | isMultipleSelectionAllowed () override |
| Returns the set of valid values for this property, if such a set exists. | |
| std::string | isValid () const override |
| Check the value chosen for the property is OK, unless overidden it just calls the validator's isValid() N.B. | |
| virtual | operator const TYPE & () const |
| Allows you to get the value of the property simply by typing its name. | |
| bool | operator!= (const PropertyWithValue< TYPE > &rhs) const |
| Deep comparison (not equal). | |
| virtual const TYPE & | operator() () const |
| Allows you to get the value of the property via an expression like myProperty() | |
| PropertyWithValue & | operator+= (Property const *right) override |
| Add the value of another property. | |
| PropertyWithValue & | operator= (const PropertyWithValue &right) |
| Copy assignment operator assigns only the value and the validator not the name, default (initial) value, etc. | |
| virtual PropertyWithValue & | operator= (const TYPE &value) |
| Assignment operator. | |
| bool | operator== (const PropertyWithValue< TYPE > &rhs) const |
| Deep comparison. | |
| PropertyWithValue ()=delete | |
| PropertyWithValue (const PropertyWithValue< TYPE > &right) | |
| Copy constructor Note the default value of the copied object is the initial value of original. | |
| PropertyWithValue (const std::string &name, const TYPE &defaultValue, const std::string &defaultValueStr, IValidator_sptr validator, const unsigned int direction) | |
| Constructor. | |
| PropertyWithValue (std::string name, TYPE defaultValue, const unsigned int direction) | |
| Constructor. | |
| PropertyWithValue (std::string name, TYPE defaultValue, IValidator_sptr validator=IValidator_sptr(new NullValidator), const unsigned int direction=Direction::Input) | |
| Constructor. | |
| virtual void | replaceValidator (IValidator_sptr newValidator) |
| Replace the current validator with the given one. | |
| 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 a property value via a DataItem. | |
| std::string | setValue (const std::string &value) override |
| Set the value of the property from a string representation. | |
| std::string | setValueFromJson (const Json::Value &value) override |
| Set the value of the property from a Json representation. | |
| int | size () const override |
| Get the size of the property. | |
| std::string | value () 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. | |
| std::string | valueAsPrettyStr (const size_t maxLength=0, const bool collapseLists=true) const override |
| Get the value of the property as a string. | |
Public Member Functions inherited from Mantid::Kernel::Property | |
| bool | autoTrim () const |
| Returns if the property is set to automatically trim string unput values of whitespace. | |
| void | clearSettings () |
| Deletes the PropertySettings object contained. | |
| virtual const PropertyHistory | createHistory () const |
| Create a PropertyHistory object representing the current state of the Property. | |
| void | createTemporaryValue () |
| Create a temporary value for this property. | |
| unsigned int | direction () const |
| returns the direction of the property | |
| bool | disableReplaceWSButton () const |
| Returns if the property is set to disable the creation of the "Replace Workspace" button. | |
| const std::string & | documentation () const |
| Get the property's documentation string. | |
| const std::string & | getGroup () |
| virtual size_t | getMemorySize () const |
| IPropertySettings * | getSettings () |
| const IPropertySettings * | getSettings () const |
| bool | hasTemporaryValue () const |
| Property is using a temporary value for this property. | |
| bool | isDynamicDefault () const |
| Returns a flag indicating that the property's value has been set programmatically, for example, if the property has a default value which depends on the value of an upstream property. | |
| virtual bool | isValueSerializable () const |
| Whether the string returned by value() can be used for serialization. | |
| virtual Property & | merge (Property *) |
| Just returns the property (*this) unless overridden. | |
| const std::string & | name () const |
| Get the property's name. | |
| bool | remember () const |
| Whether to save input values. | |
| void | setAutoTrim (const bool &setting) |
| Sets if the property is set to automatically trim string unput values of whitespace. | |
| void | setDisableReplaceWSButton (const bool &disable) |
| Sets the property to disable the creation of the "Replace Workspace" button. | |
| void | setDocumentation (const std::string &documentation) |
| Sets the user level description of the property. | |
| void | setGroup (const std::string &group) |
| Set the group this property belongs to. | |
| void | setIsDynamicDefault (const bool &flag) |
| Set or clear the flag indicating whether or not the property's value has been set programmatically. | |
| void | setName (const std::string &name) |
| Set the property's name. | |
| void | setRemember (bool) |
| Set wheter to remeber this property input. | |
| void | setSettings (std::unique_ptr< IPropertySettings > settings) |
| Set the PropertySettings object. | |
| virtual void | setUnits (const std::string &unit) |
| Sets the units of the property, as a string. | |
| const std::string | type () const |
| Returns the type of the property as a string. | |
| const std::type_info * | type_info () const |
| Get the property type_info. | |
| virtual const std::string & | units () const |
| Returns the units of the property, if any, as a string. | |
| virtual | ~Property () |
| Virtual destructor. | |
Static Public Member Functions | |
| static std::string | generatePropertyName (const std::string &name="") |
Private Member Functions | |
| const Indexing::IndexInfo & | getIndexInfoFromWorkspace () const |
Private Attributes | |
| const IndexTypeProperty & | m_indexTypeProp |
| Indexing::SpectrumIndexSet | m_indices |
| bool | m_indicesExtracted |
| std::string | m_validString |
| const IWorkspaceProperty & | m_workspaceProp |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::Kernel::Property | |
| Property (const Property &right) | |
| Copy constructor. | |
| Property (std::string name, const std::type_info &type, const unsigned int &direction=Direction::Input) | |
| Constructor. | |
Protected Attributes inherited from Mantid::Kernel::PropertyWithValue< TYPE > | |
| TYPE | m_initialValue |
| the property's default value which is also its initial value | |
| TYPE | m_value |
| The value of the property. | |
Protected Attributes inherited from Mantid::Kernel::Property | |
| std::string | m_name |
| The name of the property. | |
IndexProperty : Implementation of a property type which returns a SpectrumIndexSet provided an input vector of integers or a string.
The constructor accepts a WorkspaceProperty and an IndexTypeProperty which are used to validate user input and access the IndexInfo which manages spectrum index information within the workspace.
Definition at line 30 of file IndexProperty.h.
| Mantid::API::IndexProperty::IndexProperty | ( | const std::string & | name, |
| const IWorkspaceProperty & | workspaceProp, | ||
| const IndexTypeProperty & | indexTypeProp, | ||
| const Kernel::IValidator_sptr & | validator = Kernel::IValidator_sptr(new Kernel::NullValidator) |
||
| ) |
Definition at line 17 of file IndexProperty.cpp.
|
default |
|
overridevirtual |
'Virtual copy constructor'
Reimplemented from Mantid::Kernel::ArrayProperty< int64_t >.
Definition at line 22 of file IndexProperty.cpp.
|
static |
Definition at line 112 of file IndexProperty.cpp.
References Mantid::Kernel::Property::name().
Referenced by Mantid::API::Algorithm::declareWorkspaceInputProperties(), Mantid::API::Algorithm::doSetInputProperties(), and Mantid::API::Algorithm::getWorkspaceAndIndices().
| Indexing::IndexInfo Mantid::API::IndexProperty::getFilteredIndexInfo | ( | ) | const |
Return IndexInfo created from workspace but containing selected spectra.
The selected spectra are the same as in the SpectrumIndexSet returned by this property and the order is guaranteed to be consistent. That is, if the Nth entry in the SpectrumIndexSet is M, the spectrum with index M in the input workspace is equal to the spectrum with index N in the returned IndexInfo.
Definition at line 96 of file IndexProperty.cpp.
References getIndexInfoFromWorkspace(), m_indexTypeProp, Mantid::Kernel::PropertyWithValue< TYPE >::m_value, Mantid::API::IndexTypeProperty::selectedType(), Mantid::API::SpectrumNum, and Mantid::API::WorkspaceIndex.
|
private |
Definition at line 114 of file IndexProperty.cpp.
References Mantid::API::IWorkspaceProperty::getWorkspace(), and m_workspaceProp.
Referenced by getFilteredIndexInfo(), and getIndices().
| Indexing::SpectrumIndexSet Mantid::API::IndexProperty::getIndices | ( | ) | const |
Definition at line 53 of file IndexProperty.cpp.
References getIndexInfoFromWorkspace(), m_indexTypeProp, m_indices, m_indicesExtracted, Mantid::Kernel::PropertyWithValue< TYPE >::m_value, MSVC_DIAG_OFF, MSVC_DIAG_ON, Mantid::API::IndexTypeProperty::selectedType(), Mantid::API::SpectrumNum, Mantid::Kernel::Property::type(), and Mantid::API::WorkspaceIndex.
Referenced by isValid().
|
overridevirtual |
Overriden function that returns if property has the same value that it was initialised with, if applicable.
Implements Mantid::Kernel::Property.
Definition at line 24 of file IndexProperty.cpp.
References Mantid::Kernel::PropertyWithValue< TYPE >::m_value.
|
overridevirtual |
Overridden function that checks whether the property, if not overriden returns "".
Overridden functions checks whether the property has a valid value.
Reimplemented from Mantid::Kernel::Property.
Definition at line 26 of file IndexProperty.cpp.
References error, getIndices(), Mantid::API::IWorkspaceProperty::getWorkspace(), and m_workspaceProp.
| Mantid::API::IndexProperty::operator Indexing::SpectrumIndexSet | ( | ) | const |
Definition at line 51 of file IndexProperty.cpp.
|
delete |
| IndexProperty & Mantid::API::IndexProperty::operator= | ( | const std::string & | rhs | ) |
Definition at line 46 of file IndexProperty.cpp.
References rhs, and Mantid::Kernel::ArrayProperty< int64_t >::setValue().
|
private |
Definition at line 58 of file IndexProperty.h.
Referenced by getFilteredIndexInfo(), and getIndices().
|
mutableprivate |
Definition at line 59 of file IndexProperty.h.
Referenced by getIndices().
|
mutableprivate |
Definition at line 60 of file IndexProperty.h.
Referenced by getIndices().
|
private |
Definition at line 61 of file IndexProperty.h.
|
private |
Definition at line 57 of file IndexProperty.h.
Referenced by getIndexInfoFromWorkspace(), and isValid().