Mantid
|
This class provides a templated class object that is able to take a python object and perform operations with a given C type. More...
#include <TypedPropertyValueHandler.h>
Public Types | |
using | HeldType = ValueType |
Type required by TypeRegistry framework. More... | |
Public Member Functions | |
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. More... | |
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. More... | |
Public Member Functions inherited from Mantid::PythonInterface::Registry::PropertyValueHandler | |
virtual std::unique_ptr< Kernel::Property > | create (const std::string &name, const boost::python::object &value, const boost::python::object &validator, const unsigned int direction) const =0 |
Overload to create a Property type from the given value with no validation. More... | |
virtual void | set (Kernel::IPropertyManager *alg, const std::string &name, const boost::python::object &value) const =0 |
Overload to set the named property's value on the property manager. More... | |
virtual | ~PropertyValueHandler ()=default |
Virtual Destructor. More... | |
This class provides a templated class object that is able to take a python object and perform operations with a given C type.
Definition at line 29 of file TypedPropertyValueHandler.h.
using Mantid::PythonInterface::Registry::TypedPropertyValueHandler< ValueType, Enable >::HeldType = ValueType |
Type required by TypeRegistry framework.
Definition at line 31 of file TypedPropertyValueHandler.h.
|
inlineoverridevirtual |
Create a PropertyWithValue from the given python object value.
name | :: The name of the property |
defaultValue | :: The defaultValue of the property. The object attempts to extract a value of type ValueType from the python object |
validator | :: A python object pointing to a validator instance, which can be None. |
direction | :: The direction of the property |
Implements Mantid::PythonInterface::Registry::PropertyValueHandler.
Definition at line 53 of file TypedPropertyValueHandler.h.
References Mantid::Kernel::IValidator::clone(), and Mantid::PythonInterface::isNone().
|
inlineoverridevirtual |
Set function to handle Python -> C++ calls and get the correct type.
alg | :: A pointer to an IPropertyManager |
name | :: The name of the property |
value | :: A boost python object that stores the value |
Implements Mantid::PythonInterface::Registry::PropertyValueHandler.
Definition at line 39 of file TypedPropertyValueHandler.h.
References Mantid::Kernel::IPropertyManager::setProperty(), and value.