Mantid
Loading...
Searching...
No Matches
WorkspaceHasDxValidator.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2020 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 +
8
9namespace Mantid::API {
10
13 return std::make_shared<WorkspaceHasDxValidator>(*this);
14}
15
19 for (size_t i = 0; i < ws->getNumberHistograms(); ++i) {
20 if (!ws->hasDx(i)) {
21 return "The workspace must have Dx values set";
22 }
23 }
24 return "";
25}
26
27} // namespace Mantid::API
std::string checkValidity(MatrixWorkspace_sptr const &ws) const override
Return an error string if not all histograms in ws have Dx, otherwise an empty string.
Kernel::IValidator_sptr clone() const override
Return a deep clone of this validator.
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