Mantid
|
#include <PythonObjectInstantiator.h>
Public Member Functions | |
std::shared_ptr< IFunction > | createInstance () const |
Specialization for IFunction. More... | |
std::shared_ptr< Base > | createInstance () const override |
Creates an instance of the object as shared_ptr to the Base type. More... | |
Base * | createUnwrappedInstance () const override |
Creates an instance of the object as raw pointer to the Base type. More... | |
PythonObjectInstantiator (const boost::python::object &classObject) | |
Constructor taking a Python class object wrapped as a boost::python:object. More... | |
Public Member Functions inherited from Mantid::Kernel::AbstractInstantiator< Base > | |
AbstractInstantiator ()=default | |
Creates the AbstractInstantiator. More... | |
virtual std::shared_ptr< Base > | createInstance (Args... args) const=0 |
Creates an instance of a concrete subclass of Base. More... | |
virtual Base * | createUnwrappedInstance (Args... args) const=0 |
Creates an instance of a concrete subclass of Base, which is not wrapped in a shared_ptr. More... | |
virtual | ~AbstractInstantiator ()=default |
Destroys the AbstractInstantiator. More... | |
Private Attributes | |
boost::python::object | m_classObject |
The class name. More... | |
Base | A pointer to the C++ type that is stored in within the created python object |
Definition at line 46 of file PythonObjectInstantiator.h.
|
inline |
Constructor taking a Python class object wrapped as a boost::python:object.
Definition at line 49 of file PythonObjectInstantiator.h.
std::shared_ptr< IFunction > Mantid::PythonInterface::PythonObjectInstantiator< IFunction >::createInstance | ( | ) | const |
Specialization for IFunction.
Fit functions defined in python need to be wrapped in FunctionWrapper without asking the user to do additional actions. The instantiator lets the fit function class object know that an instance will be created by the FunctionFactory and it needs to be a subclass of IFunction and not a FunctionWrapper.
Definition at line 50 of file FunctionFactory.cpp.
|
override |
Creates an instance of the object as shared_ptr to the Base type.
Definition at line 66 of file PythonObjectInstantiator.h.
|
override |
Creates an instance of the object as raw pointer to the Base type.
std::runtime_error | as we're unable to extract a non-shared ptr from the wrapped object |
Definition at line 94 of file PythonObjectInstantiator.h.
|
private |
The class name.
Definition at line 59 of file PythonObjectInstantiator.h.