16#include <boost/python/call_method.hpp>
17#include <boost/python/converter/arg_from_python.hpp>
18#include <boost/python/extract.hpp>
28template <
typename ValueType,
typename Enable =
void>
53 std::unique_ptr<Kernel::Property>
create(
const std::string &name,
const boost::python::object &defaultValue,
54 const boost::python::object &validator,
55 const unsigned int direction)
const override {
56 using boost::python::extract;
59 const ValueType valueInC = extract<ValueType>(defaultValue)();
60 std::unique_ptr<Kernel::Property> valueProp;
62 valueProp = std::make_unique<PropertyWithValue<ValueType>>(name, valueInC, direction);
64 const IValidator *propValidator = extract<IValidator *>(validator);
65 valueProp = std::make_unique<PropertyWithValue<ValueType>>(name, valueInC, propValidator->
clone(), direction);
double value
The value of the point.
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Interface to PropertyManager.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
IValidator is the basic interface for all validators for properties.
virtual IValidator_sptr clone() const =0
Make a copy of the present type of validator.
The concrete, templated class for properties.
bool isNone(PyObject *ptr)
This class provides a base-class objects that are able to take a python object and set it on an algor...
This class provides a templated class object that is able to take a python object and perform operati...
ValueType HeldType
Type required by TypeRegistry framework.
void set(Kernel::IPropertyManager *alg, const std::string &name, const boost::python::object &value) const override
Set function to handle Python -> C++ calls and get the correct type.
std::unique_ptr< Kernel::Property > create(const std::string &name, const boost::python::object &defaultValue, const boost::python::object &validator, const unsigned int direction) const override
Create a PropertyWithValue from the given python object value.