Mantid
Loading...
Searching...
No Matches
ArrayLengthValidator.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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 +
7#pragma once
8
9#include "MantidKernel/DllConfig.h"
12
13#include <string>
14#include <vector>
15
16namespace Mantid {
17namespace Kernel {
18
21template <typename TYPE> class MANTID_KERNEL_DLL ArrayLengthValidator : public TypedValidator<std::vector<TYPE>> {
22public:
24 ArrayLengthValidator(const size_t len);
25 ArrayLengthValidator(const size_t lenmin, const size_t lenmax);
27
28 IValidator_sptr clone() const override;
29
31 bool hasLength() const;
33 bool hasMinLength() const;
35 bool hasMaxLength() const;
37 const size_t &getLength() const;
39 const size_t &getMinLength() const;
41 const size_t &getMaxLength() const;
43 void setLength(const size_t &value);
45 void clearLength();
47 void setLengthMin(const size_t &value);
49 void setLengthMax(const size_t &value);
51 void clearLengthMin();
53 void clearLengthMax();
54
55private:
56 std::string checkValidity(const std::vector<TYPE> &value) const override;
69};
70
71} // namespace Kernel
72} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
ArrayLenghtValidator : Validate length of an array property.
size_t m_arraySize
private variable containing the size of the array
~ArrayLengthValidator() override
Destructor.
bool m_hasArraySizeMax
private variable, true if size max is set, false if not
size_t m_arraySizeMin
private variable containing the minimum size of the array
size_t m_arraySizeMax
private variable containing the size max of the array
bool m_hasArraySizeMin
private variable, true if min size is set, false if not
bool m_hasArraySize
private variable, true if size is set, false if not
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.
Definition: IValidator.h:26
Helper class which provides the Collimation Length for SANS instruments.