Mantid
Loading...
Searching...
No Matches
Framework
PythonInterface
mantid
api
src
Exports
FunctionProperty.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/FunctionProperty.h
"
8
#include "
MantidPythonInterface/core/PropertyWithValueExporter.h
"
9
#include <boost/python/class.hpp>
10
11
using
Mantid::API::FunctionProperty
;
12
using
Mantid::API::IFunction
;
13
using
Mantid::Kernel::Direction
;
14
using
Mantid::Kernel::PropertyWithValue
;
15
using
Mantid::PythonInterface::PropertyWithValueExporter
;
16
using namespace
boost::python
;
17
18
void
export_FunctionProperty
() {
19
// FuncitonProperty has base PropertyWithValue<std::shared_ptr<IFunction>>
20
// which must be exported
21
using
HeldType = std::shared_ptr<IFunction>;
22
PropertyWithValueExporter<HeldType>::define
(
"FunctionPropertyWithValue"
);
23
24
class_<FunctionProperty, bases<PropertyWithValue<HeldType>>, boost::noncopyable>(
"FunctionProperty"
, no_init)
25
.def(
26
init<const std::string &, const unsigned int>((arg(
"self"
), arg(
"name"
), arg(
"direction"
) =
Direction::Input
),
27
"Constructs a FunctionProperty with the given name"
));
28
}
FunctionProperty.h
PropertyWithValueExporter.h
export_FunctionProperty
void export_FunctionProperty()
Definition
FunctionProperty.cpp:18
Mantid::API::FunctionProperty
A property class for functions.
Definition
FunctionProperty.h:29
Mantid::API::IFunction
This is an interface to a fitting function - a semi-abstarct class.
Definition
IFunction.h:166
Mantid::Kernel::PropertyWithValue
The concrete, templated class for properties.
Definition
PropertyWithValue.h:32
boost::python
Definition
NDArray.h:50
Mantid::Kernel::Direction
Describes the direction (within an algorithm) of a Property.
Definition
Property.h:50
Mantid::Kernel::Direction::Input
@ Input
An input workspace.
Definition
Property.h:53
Mantid::PythonInterface::PropertyWithValueExporter
A helper struct to export PropertyWithValue<> types to Python.
Definition
PropertyWithValueExporter.h:53
Mantid::PythonInterface::PropertyWithValueExporter::define
static void define(const char *pythonClassName)
Definition
PropertyWithValueExporter.h:54
Generated by
1.9.8