Mantid
Loading...
Searching...
No Matches
RawCountValidator.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9
10namespace Mantid::API {
11
17RawCountValidator::RawCountValidator(const bool &mustNotBeDistribution)
18 : m_mustNotBeDistribution(mustNotBeDistribution) {}
19
21Kernel::IValidator_sptr RawCountValidator::clone() const { return std::make_shared<RawCountValidator>(*this); }
22
30 if (!value->isDistribution())
31 return "";
32 else
33 return "A workspace containing numbers of counts is required here";
34 } else {
35 if (value->isDistribution())
36 return "";
37 else
38 return "A workspace of numbers of counts is not allowed here";
39 }
40}
41
42} // namespace Mantid::API
double value
The value of the point.
Definition: FitMW.cpp:51
const bool m_mustNotBeDistribution
A flag indicating whether this validator requires that the workspace must be a distribution (false) o...
RawCountValidator(const bool &mustNotBeDistribution=true)
Constructor.
std::string checkValidity(const MatrixWorkspace_sptr &value) const override
Check for validity.
Kernel::IValidator_sptr clone() const override
Clone the current state.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.
Definition: IValidator.h:26