Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
Mantid::Kernel::ArrayProperty< T > Class Template Reference

Support for a property that holds an array of values. More...

#include <ArrayProperty.h>

Inheritance diagram for Mantid::Kernel::ArrayProperty< T >:
Mantid::Kernel::PropertyWithValue< std::vector< T > > Mantid::Kernel::Property

Public Member Functions

 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. More...
 
 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: More...
 
 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. More...
 
 ArrayProperty (const std::string &name, std::vector< T > vec, const IValidator_sptr &validator=IValidator_sptr(new NullValidator), const unsigned int direction=Direction::Input)
 Constructor. More...
 
ArrayProperty< T > * clone () const override
 'Virtual copy constructor' More...
 
std::string setValue (const std::string &value) override
 Sets the values stored in the ArrayProperty from a string representation. More...
 
std::string value () const override
 Returns the values stored in the ArrayProperty. More...
 
- Public Member Functions inherited from Mantid::Kernel::PropertyWithValue< std::vector< T > >
std::vector< std::string > allowedValues () const override
 Returns the set of valid values for this property, if such a set exists. More...
 
PropertyWithValue< std::vector< T > > * 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 std::vector< T > & () const
 
bool operator!= (const PropertyWithValue< std::vector< T > > &rhs) const
 
virtual const std::vector< T > & operator() () const
 
PropertyWithValueoperator+= (Property const *right) override
 Add to this. More...
 
PropertyWithValueoperator= (const PropertyWithValue &right)
 
virtual PropertyWithValueoperator= (const std::vector< T > &value)
 
bool operator== (const PropertyWithValue< std::vector< T > > &rhs) const
 
 PropertyWithValue (const PropertyWithValue< std::vector< T > > &right)
 
 PropertyWithValue (const std::string &name, std::vector< T > defaultValue, const std::string &defaultValueStr, IValidator_sptr validator, const unsigned int direction)
 
 PropertyWithValue (std::string name, std::vector< T > defaultValue, const unsigned int direction)
 
 PropertyWithValue (std::string name, std::vector< T > 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 Member Functions

void visualStudioC4661Workaround ()
 
MANTID_KERNEL_DLL void visualStudioC4661Workaround ()
 
MANTID_KERNEL_DLL void visualStudioC4661Workaround ()
 

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< std::vector< T > >
std::vector< T > m_initialValue
 the property's default value which is also its initial value More...
 
std::vector< T > 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

template<typename T>
class Mantid::Kernel::ArrayProperty< T >

Support for a property that holds an array of values.

Implemented as a PropertyWithValue that holds a vector of the desired type. This class is really a convenience class to aid in the declaration of the property - there's no problem directly using a PropertyWithValue of vector type.

Author
Russell Taylor, Tessella Support Services plc
Date
27/02/2008

Definition at line 28 of file ArrayProperty.h.

Constructor & Destructor Documentation

◆ ArrayProperty() [1/5]

template<typename T >
Mantid::Kernel::ArrayProperty< T >::ArrayProperty ( const std::string &  name,
std::vector< T >  vec,
const IValidator_sptr validator = IValidator_sptr(new NullValidator),
const unsigned int  direction = Direction::Input 
)

Constructor.

Parameters
name:: The name to assign to the property
vec:: The initial vector of values to assign to the property.
validator:: The validator to use for this property, if required.
direction:: The direction (Input/Output/InOut) of this property

Definition at line 22 of file ArrayProperty.cpp.

◆ ArrayProperty() [2/5]

template<typename T >
Mantid::Kernel::ArrayProperty< T >::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.

empty) vector as its initial (default) value

Parameters
name:: The name to assign to the property
validator:: The validator to use for this property, if required
direction:: The direction (Input/Output/InOut) of this property

Definition at line 35 of file ArrayProperty.cpp.

◆ ArrayProperty() [3/5]

template<typename T >
Mantid::Kernel::ArrayProperty< T >::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.

Will lead to the property having a default-constructed (i.e. empty) vector as its initial (default) value and no validator

Parameters
name:: The name to assign to the property
direction:: The direction (Input/Output/InOut) of this property

Definition at line 46 of file ArrayProperty.cpp.

◆ ArrayProperty() [4/5]

template<typename T >
Mantid::Kernel::ArrayProperty< T >::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:

Inherits from the constructor of PropertyWithValue specifically made to handle a list of numeric values in a string format so that initial value is set correctly.

Parameters
name:: The name to assign to the property
values:: A comma-separated string containing the values to store in the property
validator:: The validator to use for this property, if required
direction:: The direction (Input/Output/InOut) of this property
Exceptions
std::invalid_argumentif the string passed is not compatible with the array type

Definition at line 65 of file ArrayProperty.cpp.

◆ ArrayProperty() [5/5]

template<typename T >
Mantid::Kernel::ArrayProperty< T >::ArrayProperty ( const ArrayProperty< T > &  other)

Definition at line 70 of file ArrayProperty.cpp.

Member Function Documentation

◆ clone()

template<typename T >
ArrayProperty< T > * Mantid::Kernel::ArrayProperty< T >::clone
overridevirtual

'Virtual copy constructor'

Implements Mantid::Kernel::Property.

Definition at line 73 of file ArrayProperty.cpp.

◆ setValue()

template<typename T >
std::string Mantid::Kernel::ArrayProperty< T >::setValue ( const std::string &  value)
overridevirtual

Sets the values stored in the ArrayProperty from a string representation.

Parameters
value:: The values to assign to the property, given as a comma-separated list
Returns
True if the assignment was successful

Implements Mantid::Kernel::Property.

Definition at line 89 of file ArrayProperty.cpp.

References value.

◆ value()

template<typename T >
std::string Mantid::Kernel::ArrayProperty< T >::value
overridevirtual

Returns the values stored in the ArrayProperty.

Returns
The stored values as a comma-separated list

Implements Mantid::Kernel::Property.

Definition at line 78 of file ArrayProperty.cpp.

References value.

◆ visualStudioC4661Workaround() [1/3]

template<typename T >
void Mantid::Kernel::ArrayProperty< T >::visualStudioC4661Workaround
private

Definition at line 95 of file ArrayProperty.cpp.

◆ visualStudioC4661Workaround() [2/3]

MANTID_KERNEL_DLL void Mantid::Kernel::ArrayProperty< int >::visualStudioC4661Workaround ( )
private

◆ visualStudioC4661Workaround() [3/3]

MANTID_KERNEL_DLL void Mantid::Kernel::ArrayProperty< int >::visualStudioC4661Workaround ( )
private

Definition at line 126 of file ArrayProperty.cpp.


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