15#include <boost/python/register_ptr_to_python.hpp>
22 typename std::enable_if<std::is_base_of<API::Workspace, T>::value>::type>
39 if (
value == boost::python::object())
58 const
boost::python::
object &validator,
59 const
unsigned int direction)
const override {
60 using boost::python::extract;
65 std::unique_ptr<Property> valueProp;
67 valueProp = std::make_unique<PropertyWithValue<PropertyValueType>>(
name, valueInC, direction);
69 const IValidator *propValidator = extract<IValidator *>(validator);
71 std::make_unique<PropertyWithValue<PropertyValueType>>(
name, valueInC, propValidator->
clone(), direction);
94 register_ptr_to_python<IType_sptr>();
95 register_ptr_to_python<IType_wptr>();
97 TypeRegistry::subscribe<TypedPropertyValueHandler<IType_sptr>>();
double value
The value of the point.
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
#define GNU_DIAG_OFF(x)
This is a collection of macros for turning compiler warnings off in a controlled manner.
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.
Base class for properties.
bool isNone(const PyObject *ptr)
This class provides a base-class objects that are able to take a python object and set it on an algor...
Encapsulates the registration required for an interface type T that sits on top of a Kernel::DataItem...
std::weak_ptr< IType > IType_wptr
RegisterWorkspacePtrToPython()
Constructor.
std::shared_ptr< IType > IType_sptr
std::shared_ptr< T > PropertyValueType
Convenience typedef.
T PointeeType
Convenience typedef.
std::shared_ptr< T > 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.
This class provides a templated class object that is able to take a python object and perform operati...