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 "
MantidAPI/IFunction.h
"
9
#include "
MantidPythonInterface/core/PropertyWithValueExporter.h
"
10
#include <boost/python/class.hpp>
11
12
using
Mantid::API::FunctionProperty
;
13
using
Mantid::API::IFunction
;
14
using
Mantid::Kernel::Direction
;
15
using
Mantid::Kernel::PropertyWithValue
;
16
using
Mantid::PythonInterface::PropertyWithValueExporter
;
17
using namespace
boost::python
;
18
19
void
export_FunctionProperty
() {
20
// FuncitonProperty has base PropertyWithValue<std::shared_ptr<IFunction>>
21
// which must be exported
22
using
HeldType = std::shared_ptr<IFunction>;
23
PropertyWithValueExporter<HeldType>::define
(
"FunctionPropertyWithValue"
);
24
25
class_<FunctionProperty, bases<PropertyWithValue<HeldType>>, boost::noncopyable>(
"FunctionProperty"
, no_init)
26
.def(
27
init<const std::string &, const unsigned int>((arg(
"self"
), arg(
"name"
), arg(
"direction"
) =
Direction::Input
),
28
"Constructs a FunctionProperty with the given name"
));
29
}
FunctionProperty.h
IFunction.h
PropertyWithValueExporter.h
export_FunctionProperty
void export_FunctionProperty()
Definition
FunctionProperty.cpp:19
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:167
Mantid::Kernel::PropertyWithValue
The concrete, templated class for properties.
Definition
PropertyWithValue.h:35
boost::python
Definition
NDArray.h:50
Mantid::Kernel::Direction
Describes the direction (within an algorithm) of a Property.
Definition
Property.h:51
Mantid::Kernel::Direction::Input
@ Input
An input workspace.
Definition
Property.h:54
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