Mantid
|
IValidator is the basic interface for all validators for properties. More...
#include <IValidator.h>
Public Member Functions | |
virtual std::vector< std::string > | allowedValues () const |
The set of allowed values that this validator may have, if a discrete set exists. More... | |
virtual std::string | check (const boost::any &) const =0 |
Checks the value based on the validator's rules. More... | |
virtual IValidator_sptr | clone () const =0 |
Make a copy of the present type of validator. More... | |
virtual std::string | getValueForAlias (const std::string &alias) const |
Implement this method for validators which wish to support aliasing for alloeed values. More... | |
virtual bool | isMultipleSelectionAllowed () |
Is Multiple Selection Allowed. More... | |
std::string | isValid (const char *value) const |
Deal with a C-style string by first converting it to a std::string so that boost::any can deal with it, calls isValid(std::string) More... | |
template<typename TYPE > | |
std::string | isValid (const TYPE &value) const |
Calls the validator. More... | |
IValidator ()=default | |
Constructor. More... | |
virtual | ~IValidator ()=default |
virtual Destructor More... | |
Private Member Functions | |
template<typename T > | |
std::string | runCheck (const T &value, const std::false_type &) const |
Calls the validator for a type that is not a pointer type. More... | |
template<typename T > | |
std::string | runCheck (const T &value, const std::true_type &) const |
Calls the validator for a type that is either a raw pointer or a std::shared pointer. More... | |
template<typename T > | |
std::string | runCheckWithDataItemPtr (const T &value, const std::false_type &) const |
Calls the validator for a pointer type that is NOT convertible to DataItem_sptr. More... | |
template<typename T > | |
std::string | runCheckWithDataItemPtr (const T &value, const std::true_type &) const |
Calls the validator for a pointer type that IS convertible to DataItem_sptr. More... | |
IValidator is the basic interface for all validators for properties.
Definition at line 43 of file IValidator.h.
|
default |
Constructor.
|
virtualdefault |
virtual Destructor
|
inlinevirtual |
The set of allowed values that this validator may have, if a discrete set exists.
Overridden in applicable concrete validators; the base class just returns an empty set.
Reimplemented in Mantid::Kernel::CompositeValidator.
Definition at line 77 of file IValidator.h.
|
pure virtual |
Checks the value based on the validator's rules.
Implemented in Mantid::Kernel::NullValidator, and Mantid::Kernel::CompositeValidator.
|
pure virtual |
Make a copy of the present type of validator.
Implemented in Mantid::Kernel::CompositeValidator, and Mantid::Kernel::NullValidator.
Referenced by Mantid::PythonInterface::Registry::TypedPropertyValueHandler< std::shared_ptr< T >, std::enable_if< std::is_base_of< API::Workspace, T >::value >::type >::create(), Mantid::PythonInterface::Registry::SequenceTypeHandler< ContainerType >::create(), Mantid::PythonInterface::Registry::TypedPropertyValueHandler< ValueType, Enable >::create(), Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::createPropertyWithLockFlag(), Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::createPropertyWithOptionalFlag(), Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::createPropertyWithValidator(), and Mantid::API::IFunction::declareAttribute().
|
inlinevirtual |
Implement this method for validators which wish to support aliasing for alloeed values.
alias | :: A string representation of an alias. |
Definition at line 92 of file IValidator.h.
References UNUSED_ARG.
|
inlinevirtual |
Is Multiple Selection Allowed.
Definition at line 82 of file IValidator.h.
|
inline |
Deal with a C-style string by first converting it to a std::string so that boost::any can deal with it, calls isValid(std::string)
value | :: The value to be checked |
Definition at line 67 of file IValidator.h.
References isValid(), and value.
Referenced by isValid().
|
inline |
Calls the validator.
value | :: The value to be checked |
Definition at line 58 of file IValidator.h.
References value.
|
inlineprivate |
Calls the validator for a type that is not a pointer type.
value | :: The value to be checked |
Definition at line 113 of file IValidator.h.
References value.
|
inlineprivate |
Calls the validator for a type that is either a raw pointer or a std::shared pointer.
Definition at line 123 of file IValidator.h.
References value.
|
inlineprivate |
Calls the validator for a pointer type that is NOT convertible to DataItem_sptr.
value | :: The value to be checked |
Definition at line 134 of file IValidator.h.
References value.
|
inlineprivate |
Calls the validator for a pointer type that IS convertible to DataItem_sptr.
value | :: The value to be checked |
Definition at line 143 of file IValidator.h.
References value.