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

A validator which checks that a workspace contains histogram data (the default) or point data as required. More...

#include <HistogramValidator.h>

Inheritance diagram for Mantid::API::HistogramValidator:
Mantid::API::MatrixWorkspaceValidator

Public Member Functions

Kernel::IValidator_sptr clone () const override
 Clone the current state. More...
 
std::string getType () const
 Gets the type of the validator. More...
 
 HistogramValidator (const bool &mustBeHistogram=true)
 Constructor. More...
 

Private Member Functions

std::string checkValidity (const MatrixWorkspace_sptr &value) const override
 Check for validity. More...
 

Private Attributes

const bool m_mustBeHistogram
 A flag indicating whether this validator requires that the workspace be a histogram (true) or not. More...
 

Detailed Description

A validator which checks that a workspace contains histogram data (the default) or point data as required.

Definition at line 18 of file HistogramValidator.h.

Constructor & Destructor Documentation

◆ HistogramValidator()

Mantid::API::HistogramValidator::HistogramValidator ( const bool &  mustBeHistogram = true)
explicit

Constructor.

Parameters
mustBeHistogram:: Flag indicating whether the check is that a workspace should contain histogram data (true, default) or shouldn't (false).

Definition at line 18 of file HistogramValidator.cpp.

Member Function Documentation

◆ checkValidity()

std::string Mantid::API::HistogramValidator::checkValidity ( const MatrixWorkspace_sptr value) const
overrideprivate

Check for validity.

Checks if the workspace contains a histogram when it shouldn't and vice-versa.

Parameters
value:: The workspace to test
Returns
A user level description if a problem exists or ""

Definition at line 29 of file HistogramValidator.cpp.

References m_mustBeHistogram, and value.

◆ clone()

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

Clone the current state.

Definition at line 22 of file HistogramValidator.cpp.

◆ getType()

std::string Mantid::API::HistogramValidator::getType ( ) const
inline

Gets the type of the validator.

Definition at line 23 of file HistogramValidator.h.

Member Data Documentation

◆ m_mustBeHistogram

const bool Mantid::API::HistogramValidator::m_mustBeHistogram
private

A flag indicating whether this validator requires that the workspace be a histogram (true) or not.

Definition at line 33 of file HistogramValidator.h.

Referenced by checkValidity().


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