Mantid
Loading...
Searching...
No Matches
Private Member Functions | List of all members
Mantid::PythonInterface::Registry::MappingTypeHandler Class Referencefinal

Defines a handler class for converting a Python mapping type object to a C++ PropertyManager type. More...

#include <MappingTypeHandler.h>

Inheritance diagram for Mantid::PythonInterface::Registry::MappingTypeHandler:
Mantid::PythonInterface::Registry::PropertyValueHandler

Private Member Functions

std::unique_ptr< Kernel::Propertycreate (const std::string &name, const boost::python::api::object &defaultValue, const boost::python::api::object &validator, const unsigned int direction) const override
 Always throws a runtime_error. More...
 
void set (Kernel::IPropertyManager *alg, const std::string &name, const boost::python::api::object &mapping) const override
 Sets the named property in the PropertyManager by extracting a new PropertyManager from the Python object. More...
 

Additional Inherited Members

- Public Member Functions inherited from Mantid::PythonInterface::Registry::PropertyValueHandler
virtual std::unique_ptr< Kernel::Propertycreate (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...
 

Detailed Description

Defines a handler class for converting a Python mapping type object to a C++ PropertyManager type.

Definition at line 19 of file MappingTypeHandler.h.

Member Function Documentation

◆ create()

std::unique_ptr< Kernel::Property > Mantid::PythonInterface::Registry::MappingTypeHandler::create ( const std::string &  name,
const boost::python::api::object &  defaultValue,
const boost::python::api::object &  validator,
const unsigned int  direction 
) const
overrideprivate

Always throws a runtime_error.

Use the PropertyManagerProperty directly

Parameters
nameThe name of the property
defaultValueA default value for the property.
validatorA python object pointing to a validator instance, which can be None.
directionThe direction of the property
Returns
A pointer to a newly constructed property instance

Definition at line 54 of file MappingTypeHandler.cpp.

References Mantid::Kernel::createPropertyManager().

◆ set()

void Mantid::PythonInterface::Registry::MappingTypeHandler::set ( Kernel::IPropertyManager alg,
const std::string &  name,
const boost::python::api::object &  mapping 
) const
overrideprivate

Sets the named property in the PropertyManager by extracting a new PropertyManager from the Python object.

Parameters
algA pointer to the PropertyManager containing the named property
nameThe name of the property to update
mappingThe new value of the property

Definition at line 34 of file MappingTypeHandler.cpp.

References Mantid::Kernel::createPropertyManager(), and Mantid::Kernel::IPropertyManager::setProperty().


The documentation for this class was generated from the following files: