16#include <boost/python/dict.hpp>
18using boost::python::dict;
19using boost::python::object;
22using Kernel::PropertyManager;
25namespace PythonInterface::Registry {
36 if (ptrExtract.check()) {
38 }
else if (PyObject_TypeCheck(mapping.ptr(), &PyDict_Type)) {
41 throw std::invalid_argument(
"Property " + name +
" expects a dictionary");
55 const boost::python::api::object & ,
56 const unsigned int direction)
const {
58 std::unique_ptr<Kernel::Property> valueProp =
59 std::make_unique<Kernel::PropertyManagerProperty>(name,
createPropertyManager(dict(defaultValue)), direction);
Interface to PropertyManager.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
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 ob...
std::unique_ptr< Kernel::Property > create(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.
MANTID_KERNEL_DLL PropertyManager_sptr createPropertyManager(const Json::Value &keyValues)
Attempt to create a PropertyManager from the Json::Value.
std::shared_ptr< PropertyManager > PropertyManager_sptr
Typedef for a shared pointer to a PropertyManager.
Helper class which provides the Collimation Length for SANS instruments.