Mantid
Loading...
Searching...
No Matches
PropertyWithValueFactory.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//-----------------------------------------------------------------------------
10// Includes
11//-----------------------------------------------------------------------------
12#include "MantidPythonInterface/kernel/DllConfig.h"
14#include <boost/python/list.hpp>
15#include <memory>
16
17namespace Mantid {
18//---------------------------------------------------------------------------
19// Forward declarations
20//---------------------------------------------------------------------------
21namespace Kernel {
22class Property;
23}
24
25namespace PythonInterface {
26namespace Registry {
31class PYTHON_KERNEL_DLL PropertyWithValueFactory {
32public:
33 static std::unique_ptr<Kernel::Property> create(const std::string &name, const boost::python::object &defaultValue,
34 const boost::python::object &validator, const unsigned int direction);
35
36 static std::unique_ptr<Kernel::Property> create(const std::string &name, const boost::python::object &defaultValue,
37 const unsigned int direction);
38
39 static std::unique_ptr<Kernel::Property> createTimeSeries(const std::string &name,
40 const boost::python::list &defaultValue);
41
42private:
44 static const PropertyValueHandler &lookup(PyObject *const object);
46 static const std::string isArray(PyObject *const object);
47};
48} // namespace Registry
49} // namespace PythonInterface
50} // namespace Mantid
std::string name
Definition Run.cpp:60
Defines a static factory class that creates PropertyWithValue instances from python objects.
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.
This class provides a base-class objects that are able to take a python object and set it on an algor...