Mantid
Loading...
Searching...
No Matches
Framework
PythonInterface
core
inc
MantidPythonInterface
core
TypedValidatorExporter.h
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2012 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/TypedValidator.h
"
10
#include <boost/python/class.hpp>
11
12
namespace
Mantid
{
13
namespace
PythonInterface {
18
template
<
typename
Type>
struct
TypedValidatorExporter
{
19
static
void
define
(
const
char
*pythonClassName) {
20
using namespace
boost::python
;
21
using
Mantid::Kernel::IValidator
;
22
using
Mantid::Kernel::TypedValidator;
23
24
class_<TypedValidator<Type>, bases<IValidator>, boost::noncopyable>(pythonClassName, no_init)
25
.def(
"isValid"
, &IValidator::isValid<Type>, (arg(
"self"
), arg(
"value"
)),
26
"Returns an empty string if the value is considered valid, "
27
"otherwise a string defining the error is returned."
);
28
}
29
};
30
31
#define EXPORT_TYPEDVALIDATOR(Type)
32
}
// namespace PythonInterface
33
}
// namespace Mantid
TypedValidator.h
Mantid::Kernel::IValidator
IValidator is the basic interface for all validators for properties.
Definition
IValidator.h:43
Mantid
Helper class which provides the Collimation Length for SANS instruments.
Definition
AbsorptionCorrection.h:18
boost::python
Definition
NDArray.h:50
Mantid::PythonInterface::TypedValidatorExporter
Declares a simple static struct to export a TypedValidator to Python.
Definition
TypedValidatorExporter.h:18
Mantid::PythonInterface::TypedValidatorExporter::define
static void define(const char *pythonClassName)
Definition
TypedValidatorExporter.h:19
Generated by
1.9.8