Mantid
|
A specialisation of PropertyValueHander to handle coercing a Python value into a C++ sequence/array property. More...
#include <SequenceTypeHandler.h>
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 |
Call to create a name property where the value is some container type. More... | |
void | set (Kernel::IPropertyManager *alg, const std::string &name, const boost::python::object &value) const override |
Call to set a named property where the value is some container type. More... | |
Public Member Functions inherited from Mantid::PythonInterface::Registry::TypedPropertyValueHandler< ContainerType > | |
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... | |
Additional Inherited Members | |
Public Types inherited from Mantid::PythonInterface::Registry::TypedPropertyValueHandler< ContainerType > | |
using | HeldType = ContainerType |
Type required by TypeRegistry framework. More... | |
A specialisation of PropertyValueHander to handle coercing a Python value into a C++ sequence/array property.
The template type ContainerType should contain a type called value_type indicating the element type.
Definition at line 19 of file SequenceTypeHandler.h.
|
overridevirtual |
Call to create a name property where the value is some container type.
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 ContainerType 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 81 of file SequenceTypeHandler.cpp.
References Mantid::Kernel::IValidator::clone(), and Mantid::PythonInterface::isNone().
|
overridevirtual |
Call to set a named property where the value is some container type.
Set function to handle Python -> C++ calls to a property manager 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 container values |
Implements Mantid::PythonInterface::Registry::PropertyValueHandler.
Definition at line 46 of file SequenceTypeHandler.cpp.
References Mantid::PythonInterface::NDArray::check(), Mantid::Kernel::IPropertyManager::setProperty(), and value.