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

SingleCountValidator : This validator checks that there is only a single entry per spectrum, the counts, so no Time-of-Flight data. More...

#include <SingleCountValidator.h>

Inheritance diagram for Mantid::API::SingleCountValidator:
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...
 
 SingleCountValidator (const bool &mustBeSingleCounts=true)
 Constructor. More...
 

Private Member Functions

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

Private Attributes

const bool m_mustBeSingleCount
 A flag indicating whether this validator requires that the workspace be contain only single counts or not. More...
 

Detailed Description

SingleCountValidator : This validator checks that there is only a single entry per spectrum, the counts, so no Time-of-Flight data.

Warning: only the first bin of the workspace is checked, for performance reasons.

Definition at line 18 of file SingleCountValidator.h.

Constructor & Destructor Documentation

◆ SingleCountValidator()

Mantid::API::SingleCountValidator::SingleCountValidator ( const bool &  mustBeSingleCount = true)
explicit

Constructor.

Parameters
mustBeSingleCount:: Flag indicating whether the check is that a workspace should contain single counts only (true, default) or should not contain single counts (false).

Definition at line 17 of file SingleCountValidator.cpp.

Member Function Documentation

◆ checkValidity()

std::string Mantid::API::SingleCountValidator::checkValidity ( const MatrixWorkspace_sptr ws) const
overrideprivate

Check for validity.

Checks if the workspace contains a single counts when it should not and vice-versa.

For perofrmance reasons this takes the first spectrum size only, instead of relying on MatrixWorkspace::blocksize().

Parameters
wsThe workspace to validate
Returns
A user level description if a problem exists, otherwise an empty string

Definition at line 30 of file SingleCountValidator.cpp.

References m_mustBeSingleCount.

◆ clone()

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

Clone the current state.

Definition at line 21 of file SingleCountValidator.cpp.

◆ getType()

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

Gets the type of the validator.

Definition at line 23 of file SingleCountValidator.h.

Member Data Documentation

◆ m_mustBeSingleCount

const bool Mantid::API::SingleCountValidator::m_mustBeSingleCount
private

A flag indicating whether this validator requires that the workspace be contain only single counts or not.

Definition at line 33 of file SingleCountValidator.h.

Referenced by checkValidity().


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