Mantid
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType > Struct Template Reference

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 TypedWorkspacePropertycreatePropertyWithLockFlag (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 TypedWorkspacePropertycreatePropertyWithOptionalFlag (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 TypedWorkspacePropertycreatePropertyWithValidator (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...
 

Detailed Description

template<typename WorkspaceType>
struct Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >

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.

Member Typedef Documentation

◆ TypedWorkspaceProperty

template<typename WorkspaceType >
using Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::TypedWorkspaceProperty = Mantid::API::WorkspaceProperty<WorkspaceType>

The export type.

Definition at line 24 of file WorkspacePropertyExporter.h.

◆ WorkspaceType_sptr

template<typename WorkspaceType >
using Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::WorkspaceType_sptr = std::shared_ptr<WorkspaceType>

Shared pointer to Worksapce type.

Definition at line 26 of file WorkspacePropertyExporter.h.

Member Function Documentation

◆ createPropertyWithLockFlag()

template<typename WorkspaceType >
static TypedWorkspaceProperty * Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::createPropertyWithLockFlag ( const std::string &  name,
const std::string &  wsName,
const unsigned int  direction,
API::PropertyMode::Type  optional,
API::LockMode::Type  locking,
Kernel::IValidator validator 
)
inlinestatic

Factory function to act as a constructor so that the validator can be cloned rather than passing in the python owned object.

Parameters
name:: The name of the property
wsName:: A default value
direction:: The direction,
See also
Direction enum
Parameters
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().

◆ createPropertyWithOptionalFlag()

template<typename WorkspaceType >
static TypedWorkspaceProperty * Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::createPropertyWithOptionalFlag ( const std::string &  name,
const std::string &  wsName,
const unsigned int  direction,
API::PropertyMode::Type  optional,
Kernel::IValidator validator 
)
inlinestatic

Factory function to act as a constructor so that the validator can be cloned rather than passing in the python owned object.

Parameters
name:: The name of the property
wsName:: A default value
direction:: The direction,
See also
Direction enum
Parameters
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().

◆ createPropertyWithValidator()

template<typename WorkspaceType >
static TypedWorkspaceProperty * Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::createPropertyWithValidator ( const std::string &  name,
const std::string &  wsName,
const unsigned int  direction,
Kernel::IValidator validator 
)
inlinestatic

Factory function to act as a constructor so that the validator can be cloned rather than passing in the python owned object.

Parameters
name:: The name of the property
wsName:: A default value
direction:: The direction,
See also
Direction enum
Parameters
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().

◆ define()

template<typename WorkspaceType >
static void Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::define ( const char *  pythonClassName)
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

Parameters
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.

◆ value()

template<typename WorkspaceType >
static Mantid::API::Workspace_sptr Mantid::PythonInterface::WorkspacePropertyExporter< WorkspaceType >::value ( const TypedWorkspaceProperty self)
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.


The documentation for this struct was generated from the following file: