Mantid
Loading...
Searching...
No Matches
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 +
10#include <boost/python/class.hpp>
11
13using Mantid::Kernel::TypedValidator;
15using namespace boost::python;
16
19 TypedValidatorExporter<std::vector<std::string>>::define("StringTypedValidator");
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}
void export_ADSValidator()
This is the base TypedValidator for most of the WorkspaceValidators.
ADSValidator : a validator that requires the value of a property to be present in the ADS.
Definition: ADSValidator.h:21
void setOptional(const bool setOptional)
bool isMultipleSelectionAllowed() override
void setMultipleSelectionAllowed(const bool isMultiSelectionAllowed)
Declares a simple static struct to export a TypedValidator to Python.