Mantid
Loading...
Searching...
No Matches
PythonObjectTypeHandler.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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
10
11namespace Mantid {
12namespace PythonInterface {
13namespace Registry {
18struct DLLExport PythonObjectTypeHandler : public TypedPropertyValueHandler<boost::python::object> {
19
21
28 void set(Kernel::IPropertyManager *alg, std::string const &name, boost::python::object const &value) const override {
29 alg->setProperty(name, value);
30 }
31
33 std::unique_ptr<Kernel::Property> create(std::string const &name, boost::python::object const &defaultValue,
34 boost::python::object const &validator,
35 unsigned int const direction) const override;
36};
37} // namespace Registry
38} // namespace PythonInterface
39} // namespace Mantid
std::string name
Definition Run.cpp:60
double value
The value of the point.
Definition FitMW.cpp:51
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition System.h:37
Interface to PropertyManager.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
Helper class which provides the Collimation Length for SANS instruments.
A specialisation of PropertyValueHandler to handle passing a python object directly to a PythonObject...
void set(Kernel::IPropertyManager *alg, std::string const &name, boost::python::object const &value) const override
Call to set a named property where the value is some container type.
This class provides a templated class object that is able to take a python object and perform operati...