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