Mantid
Loading...
Searching...
No Matches
Framework
PythonInterface
mantid
api
src
Exports
ADSValidator.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 "
MantidAPI/ADSValidator.h
"
8
#include "
MantidKernel/TypedValidator.h
"
9
#include "
MantidPythonInterface/core/TypedValidatorExporter.h
"
10
#include <boost/python/class.hpp>
11
12
using
Mantid::API::ADSValidator
;
13
using
Mantid::Kernel::TypedValidator;
14
using
Mantid::PythonInterface::TypedValidatorExporter
;
15
using namespace
boost::python
;
16
18
void
export_ADSValidator
() {
19
TypedValidatorExporter<std::vector<std::string>
>::define(
"StringVectorTypedValidator"
);
20
21
class_<ADSValidator, bases<TypedValidator<std::vector<std::string>>>, boost::noncopyable>(
22
"ADSValidator"
, init<>(
"Default constructor"
))
23
.def(init<const bool, const bool>(
"Constructor setting allowMultiple and isOptional."
,
24
args(
"allowMultipleSelection"
,
"isOptional"
)))
25
26
.def(
"isMultipleSelectionAllowed"
, &
ADSValidator::isMultipleSelectionAllowed
, (arg(
"self"
)),
27
"Are multiple workspaces allowed"
)
28
.def(
"setMultiSelectionAllowed"
, &
ADSValidator::setMultipleSelectionAllowed
,
29
(arg(
"self"
), arg(
"isMultiSelectionAllowed"
)),
"Set if multiple workspaces are allowed"
)
30
.def(
"isOptional"
, &
ADSValidator::isOptional
, (arg(
"self"
)),
"Is this optional"
)
31
.def(
"setOptional"
, &
ADSValidator::setOptional
, (arg(
"self"
), arg(
"setOptional"
)),
"Set if this is optional"
);
32
}
ADSValidator.h
export_ADSValidator
void export_ADSValidator()
This is the base TypedValidator for most of the WorkspaceValidators.
Definition
ADSValidator.cpp:18
TypedValidatorExporter.h
TypedValidator.h
Mantid::API::ADSValidator
ADSValidator : a validator that requires the value of a property to be present in the ADS.
Definition
ADSValidator.h:21
Mantid::API::ADSValidator::setOptional
void setOptional(const bool setOptional)
Definition
ADSValidator.cpp:32
Mantid::API::ADSValidator::isMultipleSelectionAllowed
bool isMultipleSelectionAllowed() override
Definition
ADSValidator.cpp:24
Mantid::API::ADSValidator::isOptional
bool isOptional() const
Definition
ADSValidator.cpp:30
Mantid::API::ADSValidator::setMultipleSelectionAllowed
void setMultipleSelectionAllowed(const bool isMultiSelectionAllowed)
Definition
ADSValidator.cpp:26
boost::python
Definition
NDArray.h:50
Mantid::PythonInterface::TypedValidatorExporter
Declares a simple static struct to export a TypedValidator to Python.
Definition
TypedValidatorExporter.h:18
Generated by
1.9.8