Mantid
Loading...
Searching...
No Matches
MandatoryValidator.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 +
8#include <boost/python/class.hpp>
9#include <string>
10
13using namespace boost::python;
14
15namespace {
17#define EXPORT_MANDATORYVALIDATOR(ElementType, prefix) \
18 class_<MandatoryValidator<ElementType>, bases<IValidator>, boost::noncopyable>(#prefix "MandatoryValidator");
19} // namespace
20
22 EXPORT_MANDATORYVALIDATOR(double, Float);
24 EXPORT_MANDATORYVALIDATOR(std::string, String);
25
26 // Array types
27 EXPORT_MANDATORYVALIDATOR(std::vector<double>, FloatArray);
28 EXPORT_MANDATORYVALIDATOR(std::vector<long>, IntArray);
29 EXPORT_MANDATORYVALIDATOR(std::vector<std::string>, StringArray);
30}
#define EXPORT_MANDATORYVALIDATOR(ElementType, prefix)
A macro for generating exports for each type.
void export_MandatoryValidator()
IValidator is the basic interface for all validators for properties.
Definition: IValidator.h:43
Validator to check that a property is not left empty.