Mantid
Loading...
Searching...
No Matches
PropertyManagerProperty.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 +
9
14
15#include <boost/python/class.hpp>
16#include <boost/python/dict.hpp>
17
18#include <boost/python/default_call_policies.hpp>
19#include <boost/python/make_constructor.hpp>
20
26using namespace boost::python;
27
29 const boost::python::dict &value,
30 const unsigned int &direction) {
32}
33
35 // export base class
36 using BaseValueType = PropertyManager_sptr;
37 PropertyWithValueExporter<BaseValueType>::define("PropertyManagerPropertyWithValue");
38
39 // leaf class type
40 using BaseClassType = PropertyManagerProperty::BaseClass;
41 class_<PropertyManagerProperty, bases<BaseClassType>, boost::noncopyable>("PropertyManagerProperty", no_init)
42 .def(init<const std::string &, const unsigned int>(
43 (arg("self"), arg("name"), arg("direction") = Direction::Input), "Construct an PropertyManagerProperty"))
44 .def("__init__", make_constructor(&createPropertyManagerPropertyWithDict, default_call_policies(),
45 (arg("name"), arg("value"), arg("direction") = Direction::Input)));
46
47 // type handler for alg.setProperty calls
48 Registry::TypeRegistry::subscribe(typeid(BaseValueType), new Registry::MappingTypeHandler);
49}
double value
The value of the point.
Definition: FitMW.cpp:51
PropertyManagerProperty * createPropertyManagerPropertyWithDict(const std::string &name, const boost::python::dict &value, const unsigned int &direction)
void export_PropertyManagerProperty()
PropertyWithValue< PropertyManager_sptr > BaseClass
Defines a handler class for converting a Python mapping type object to a C++ PropertyManager type.
std::shared_ptr< PropertyManager > PropertyManager_sptr
Typedef for a shared pointer to a PropertyManager.
std::shared_ptr< Kernel::PropertyManager > createPropertyManager(const boost::python::dict &mapping)
Create a C++ PropertyMananager from a Python dictionary.
Describes the direction (within an algorithm) of a Property.
Definition: Property.h:50
@ Input
An input workspace.
Definition: Property.h:53
A helper struct to export PropertyWithValue<> types to Python.
static void define(const char *pythonClassName)