Mantid
|
A helper struct to export WorkspaceProperty<> types to Python. More...
#include <WorkspacePropertyExporter.h>
Public Types | |
using | TypedWorkspaceProperty = Mantid::API::WorkspaceProperty< WorkspaceType > |
The export type. More... | |
using | WorkspaceType_sptr = std::shared_ptr< WorkspaceType > |
Shared pointer to Worksapce type. More... | |
Static Public Member Functions | |
static TypedWorkspaceProperty * | createPropertyWithLockFlag (const std::string &name, const std::string &wsName, const unsigned int direction, API::PropertyMode::Type optional, API::LockMode::Type locking, Kernel::IValidator *validator) |
Factory function to act as a constructor so that the validator can be cloned rather than passing in the python owned object. More... | |
static TypedWorkspaceProperty * | createPropertyWithOptionalFlag (const std::string &name, const std::string &wsName, const unsigned int direction, API::PropertyMode::Type optional, Kernel::IValidator *validator) |
Factory function to act as a constructor so that the validator can be cloned rather than passing in the python owned object. More... | |
static TypedWorkspaceProperty * | createPropertyWithValidator (const std::string &name, const std::string &wsName, const unsigned int direction, Kernel::IValidator *validator) |
Factory function to act as a constructor so that the validator can be cloned rather than passing in the python owned object. More... | |
static void | define (const char *pythonClassName) |
Defines the necessary exports for a WorkspaceProperty<WorkspaceType>. More... | |
static Mantid::API::Workspace_sptr | value (const TypedWorkspaceProperty &self) |
Ensure the stored type is always a Workspace_sptr This allows a reference to a Workspace_sptr to be used withh boost::python::extract. More... | |
A helper struct to export WorkspaceProperty<> types to Python.
It also exports a new PropertyWithValue<WorkspaceType> type as this is required to for the base class.
Definition at line 22 of file WorkspacePropertyExporter.h.
using Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::TypedWorkspaceProperty = Mantid::API::WorkspaceProperty<WorkspaceType> |
The export type.
Definition at line 24 of file WorkspacePropertyExporter.h.
using Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::WorkspaceType_sptr = std::shared_ptr<WorkspaceType> |
Shared pointer to Worksapce type.
Definition at line 26 of file WorkspacePropertyExporter.h.
|
inlinestatic |
Factory function to act as a constructor so that the validator can be cloned rather than passing in the python owned object.
name | :: The name of the property |
wsName | :: A default value |
direction | :: The direction, |
validator | :: A pointer validator object |
optional | :: If true then the workspace is optional |
locking | :: If true then the workspace will be locked before running an algorithm |
Definition at line 72 of file WorkspacePropertyExporter.h.
References Mantid::Kernel::IValidator::clone().
Referenced by Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::define().
|
inlinestatic |
Factory function to act as a constructor so that the validator can be cloned rather than passing in the python owned object.
name | :: The name of the property |
wsName | :: A default value |
direction | :: The direction, |
optional | :: If true then the workspace is optional |
validator | :: A pointer validator object |
Definition at line 53 of file WorkspacePropertyExporter.h.
References Mantid::Kernel::IValidator::clone().
Referenced by Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::define().
|
inlinestatic |
Factory function to act as a constructor so that the validator can be cloned rather than passing in the python owned object.
name | :: The name of the property |
wsName | :: A default value |
direction | :: The direction, |
validator | :: A pointer validator object |
Definition at line 37 of file WorkspacePropertyExporter.h.
References Mantid::Kernel::IValidator::clone().
Referenced by Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::define().
|
inlinestatic |
Defines the necessary exports for a WorkspaceProperty<WorkspaceType>.
This includes a PropertyWithValue<WorkspaceType_sptr> whose name is formed by appending "PropertyWithValue" to the given class name
pythonClassName | :: The name of the class in python |
Definition at line 95 of file WorkspacePropertyExporter.h.
References Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::createPropertyWithLockFlag(), Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::createPropertyWithOptionalFlag(), Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::createPropertyWithValidator(), Mantid::PythonInterface::PropertyWithValueExporter< HeldType, ValueReturnPolicy >::define(), Mantid::API::WorkspaceProperty< TYPE >::isOptional(), and value.
|
inlinestatic |
Ensure the stored type is always a Workspace_sptr This allows a reference to a Workspace_sptr to be used withh boost::python::extract.
Definition at line 85 of file WorkspacePropertyExporter.h.