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
9#include "MantidPythonInterface/kernel/DllConfig.h"
11
12namespace Mantid {
13namespace PythonInterface {
14namespace Registry {
19struct PYTHON_KERNEL_DLL PythonObjectTypeHandler : public TypedPropertyValueHandler<boost::python::object> {
20
22
29 void set(Kernel::IPropertyManager *alg, std::string const &name, boost::python::object const &value) const override {
30 alg->setProperty(name, value);
31 }
32
34 std::unique_ptr<Kernel::Property> create(std::string const &name, boost::python::object const &defaultValue,
35 boost::python::object const &validator,
36 unsigned int const direction) const override;
37};
38} // namespace Registry
39} // namespace PythonInterface
40} // namespace Mantid
std::string name
Definition Run.cpp:60
double value
The value of the point.
Definition FitMW.cpp:51
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...