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

A validator which checks that sample has the required properties. More...

#include <SampleValidator.h>

Inheritance diagram for Mantid::API::SampleValidator:
Mantid::API::MatrixWorkspaceValidator

Public Types

enum  Requirements { Shape = 0x1 , Material = 0x2 }
 Enumeration describing requirements. More...
 

Public Member Functions

std::string checkValidity (const MatrixWorkspace_sptr &value) const override
 Check if the workspace satisfies the validation requirements. More...
 
Kernel::IValidator_sptr clone () const override
 
std::string getType () const
 
 SampleValidator (const unsigned int flags=(Shape|Material))
 Construct a validator with a set of requirements. More...
 

Private Attributes

unsigned int m_requires
 

Detailed Description

A validator which checks that sample has the required properties.

Definition at line 17 of file SampleValidator.h.

Member Enumeration Documentation

◆ Requirements

Enumeration describing requirements.

Enumerator
Shape 
Material 

Definition at line 20 of file SampleValidator.h.

Constructor & Destructor Documentation

◆ SampleValidator()

Mantid::API::SampleValidator::SampleValidator ( const unsigned int  flags = (Shape | Material))

Construct a validator with a set of requirements.

Parameters
flagsA combination of SampleValidator::Requirements flags. Defaults to requiring both a shape and material

Definition at line 21 of file SampleValidator.cpp.

Member Function Documentation

◆ checkValidity()

std::string Mantid::API::SampleValidator::checkValidity ( const MatrixWorkspace_sptr value) const
override

Check if the workspace satisfies the validation requirements.

Parameters
valueA pointer to a MatrixWorkspace object
Returns
An empty string if the requirements are satisfied otherwise a string containing a message indicating the problem(s)

Definition at line 39 of file SampleValidator.cpp.

References m_requires, Shape, and value.

◆ clone()

Kernel::IValidator_sptr Mantid::API::SampleValidator::clone ( ) const
override
Returns
A copy of the current state of the object

Definition at line 31 of file SampleValidator.cpp.

◆ getType()

std::string Mantid::API::SampleValidator::getType ( ) const
Returns
A string type identifier for the object

Definition at line 26 of file SampleValidator.cpp.

Member Data Documentation

◆ m_requires

unsigned int Mantid::API::SampleValidator::m_requires
private

Definition at line 28 of file SampleValidator.h.

Referenced by checkValidity().


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