Mantid
|
Defines a static factory class that creates PropertyWithValue instances from python objects. More...
#include <PropertyWithValueFactory.h>
Static Public Member Functions | |
static std::unique_ptr< Kernel::Property > | create (const std::string &name, const boost::python::object &defaultValue, const boost::python::object &validator, const unsigned int direction) |
Creates a PropertyWithValue<Type> instance from the given information. More... | |
static std::unique_ptr< Kernel::Property > | create (const std::string &name, const boost::python::object &defaultValue, const unsigned int direction) |
Creates a PropertyWithValue<Type> instance from the given information. More... | |
static std::unique_ptr< Kernel::Property > | createTimeSeries (const std::string &name, const boost::python::list &defaultValue) |
Creates a TimeSeriesProperty<Type> instance from the given information. More... | |
Static Private Member Functions | |
static const std::string | isArray (PyObject *const object) |
Return a string based on the python array type. More... | |
static const PropertyValueHandler & | lookup (PyObject *const object) |
Return a handler that maps the python type to a C++ type. More... | |
Defines a static factory class that creates PropertyWithValue instances from python objects.
Definition at line 30 of file PropertyWithValueFactory.h.
|
static |
Creates a PropertyWithValue<Type> instance from the given information.
The python type is mapped to a C type using the mapping defined by initPythonTypeMap()
name | :: The name of the property |
defaultValue | :: A default value for this property. |
validator | :: A validator object |
direction | :: Specifies whether the property is Input, InOut or Output |
Definition at line 117 of file PropertyWithValueFactory.cpp.
References lookup().
Referenced by create(), Mantid::PythonInterface::Registry::createPropertyManager(), and Mantid::PythonInterface::AlgorithmAdapter< BaseAlgorithm >::declarePyAlgProperty().
|
static |
Creates a PropertyWithValue<Type> instance from the given information.
The python type is mapped to a C type using the mapping defined by initPythonTypeMap()
name | :: The name of the property |
defaultValue | :: A default value for this property. |
direction | :: Specifies whether the property is Input, InOut or Output |
Definition at line 134 of file PropertyWithValueFactory.cpp.
References create().
|
static |
Creates a TimeSeriesProperty<Type> instance from the given information.
The python type is mapped to a C type
name | :: The name of the property |
defaultValue | :: A default value for this property. |
Decide which kind of TimeSeriesProperty to return Need to use a different method to check for boolean values since extract<> seems to get confused sometimes.
Definition at line 148 of file PropertyWithValueFactory.cpp.
References obj.
|
staticprivate |
Return a string based on the python array type.
Return a string for the array type to check the map for.
object | :: Python object to check if it's an array |
Definition at line 210 of file PropertyWithValueFactory.cpp.
References GNU_DIAG_OFF, and GNU_DIAG_ON.
Referenced by lookup().
|
staticprivate |
Return a handler that maps the python type to a C++ type.
object | :: A pointer to a PyObject that represents the type |
Definition at line 183 of file PropertyWithValueFactory.cpp.
References isArray().
Referenced by create().