Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Mantid::API::ADSValidator Class Reference

ADSValidator : a validator that requires the value of a property to be present in the ADS. More...

#include <ADSValidator.h>

Inheritance diagram for Mantid::API::ADSValidator:

Public Member Functions

 ADSValidator (const bool allowMultiSelection=true, const bool isOptional=false)
 Default constructor. Sets up an empty list of valid values. More...
 
std::vector< std::string > allowedValues () const override
 Returns the current contents of the AnalysisDataService for input workspaces. More...
 
Kernel::IValidator_sptr clone () const override
 Clone the validator. More...
 
bool isMultipleSelectionAllowed () override
 
bool isOptional () const
 
void setMultipleSelectionAllowed (const bool isMultiSelectionAllowed)
 
void setOptional (const bool setOptional)
 

Protected Member Functions

std::string checkValidity (const std::vector< std::string > &value) const override
 Checks if the string passed is in the ADS, or if all members are in the ADS. More...
 

Private Attributes

bool m_AllowMultiSelection
 if the validator should allow multiple selection More...
 
bool m_isOptional
 if the validator should an empty selection More...
 

Detailed Description

ADSValidator : a validator that requires the value of a property to be present in the ADS.

The type must be std::string

Definition at line 21 of file ADSValidator.h.

Constructor & Destructor Documentation

◆ ADSValidator()

Mantid::API::ADSValidator::ADSValidator ( const bool  allowMultiSelection = true,
const bool  isOptional = false 
)

Default constructor. Sets up an empty list of valid values.

Definition at line 17 of file ADSValidator.cpp.

Member Function Documentation

◆ allowedValues()

std::vector< std::string > Mantid::API::ADSValidator::allowedValues ( ) const
override

Returns the current contents of the AnalysisDataService for input workspaces.

For output workspaces, an empty set is returned

Returns
set of objects in AnalysisDataService

Definition at line 60 of file ADSValidator.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), isOptional(), and Mantid::Kernel::Sorted.

◆ checkValidity()

std::string Mantid::API::ADSValidator::checkValidity ( const std::vector< std::string > &  value) const
overrideprotected

Checks if the string passed is in the ADS, or if all members are in the ADS.

Parameters
value:: The value to test
Returns
"" if the value is on the list, or "The workspace is not in the workspace list"

Definition at line 39 of file ADSValidator.cpp.

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

◆ clone()

Kernel::IValidator_sptr Mantid::API::ADSValidator::clone ( ) const
override

Clone the validator.

Definition at line 22 of file ADSValidator.cpp.

◆ isMultipleSelectionAllowed()

bool Mantid::API::ADSValidator::isMultipleSelectionAllowed ( )
override

Definition at line 24 of file ADSValidator.cpp.

References m_AllowMultiSelection.

Referenced by export_ADSValidator().

◆ isOptional()

bool Mantid::API::ADSValidator::isOptional ( ) const

Definition at line 30 of file ADSValidator.cpp.

References m_isOptional.

Referenced by allowedValues(), and export_ADSValidator().

◆ setMultipleSelectionAllowed()

void Mantid::API::ADSValidator::setMultipleSelectionAllowed ( const bool  isMultiSelectionAllowed)

Definition at line 26 of file ADSValidator.cpp.

References m_AllowMultiSelection.

Referenced by export_ADSValidator().

◆ setOptional()

void Mantid::API::ADSValidator::setOptional ( const bool  setOptional)

Definition at line 32 of file ADSValidator.cpp.

References m_isOptional, and setOptional().

Referenced by export_ADSValidator(), and setOptional().

Member Data Documentation

◆ m_AllowMultiSelection

bool Mantid::API::ADSValidator::m_AllowMultiSelection
private

if the validator should allow multiple selection

Definition at line 50 of file ADSValidator.h.

Referenced by checkValidity(), isMultipleSelectionAllowed(), and setMultipleSelectionAllowed().

◆ m_isOptional

bool Mantid::API::ADSValidator::m_isOptional
private

if the validator should an empty selection

Definition at line 52 of file ADSValidator.h.

Referenced by checkValidity(), isOptional(), and setOptional().


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