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

A validator to check whether a given algorithm has a named property. More...

#include <AlgorithmHasProperty.h>

Inheritance diagram for Mantid::API::AlgorithmHasProperty:

Public Member Functions

 AlgorithmHasProperty (std::string propName)
 Constructor. More...
 
Kernel::IValidator_sptr clone () const override
 Make a copy of the present type of validator. More...
 
std::string getType () const
 Get a string representation of the type. More...
 

Protected Member Functions

std::string checkValidity (const std::shared_ptr< IAlgorithm > &value) const override
 Checks the value based on the validator's rules. More...
 

Private Attributes

std::string m_propName
 Store the property name. More...
 

Detailed Description

A validator to check whether a given algorithm has a named property.

The algorithm's property must be valid for the validator to pass.

Author
Martyn Gigg, Tessella plc
Date
30/03/2011

Definition at line 24 of file AlgorithmHasProperty.h.

Constructor & Destructor Documentation

◆ AlgorithmHasProperty()

Mantid::API::AlgorithmHasProperty::AlgorithmHasProperty ( std::string  propName)

Constructor.

Definition at line 16 of file AlgorithmHasProperty.cpp.

Member Function Documentation

◆ checkValidity()

std::string Mantid::API::AlgorithmHasProperty::checkValidity ( const std::shared_ptr< IAlgorithm > &  value) const
overrideprotected

Checks the value based on the validator's rules.

Parameters
value:: The input algorithm to check
Returns
An error message to display to users or an empty string on no error

Definition at line 33 of file AlgorithmHasProperty.cpp.

References Mantid::Kernel::Property::isValid(), m_propName, value, and Mantid::Kernel::Property::value().

◆ clone()

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

Make a copy of the present type of validator.

Definition at line 25 of file AlgorithmHasProperty.cpp.

◆ getType()

std::string Mantid::API::AlgorithmHasProperty::getType ( ) const

Get a string representation of the type.

Returns
A string containing the validator type

Definition at line 22 of file AlgorithmHasProperty.cpp.

Member Data Documentation

◆ m_propName

std::string Mantid::API::AlgorithmHasProperty::m_propName
private

Store the property name.

Definition at line 35 of file AlgorithmHasProperty.h.

Referenced by checkValidity().


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