29 return std::make_shared<WorkspaceUnitValidator>(*
this);
40 if (
value->axes() == 0)
41 return "A single valued workspace has no unit, which is required for "
48 return (unit && (!std::dynamic_pointer_cast<const Kernel::Units::Empty>(unit)) ?
""
49 :
"The workspace must have units");
53 if ((!unit) || (unit->unitID().compare(
m_unitID))) {
54 return "The workspace must have units of " +
m_unitID;
double value
The value of the point.
An interface for those validators that require the MatrixWorkspace interface.
const std::string m_unitID
The name of the required unit.
std::string checkValidity(const MatrixWorkspace_sptr &value) const override
Check for validity.
WorkspaceUnitValidator(std::string unitID="")
Constructor.
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< const Unit > Unit_const_sptr
Shared pointer to the Unit base class (const version)
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.