11#include <boost/python/args.hpp>
12#include <boost/python/make_constructor.hpp>
13#include <boost/python/register_ptr_to_python.hpp>
16namespace PythonInterface {
38 const unsigned int direction,
54 const unsigned int direction,
73 const unsigned int direction,
95 static void define(
const char *pythonClassName) {
100 std::string basePropName = std::string(pythonClassName) +
"PropertyWithValue";
102 register_ptr_to_python<TypedWorkspaceProperty *>();
104 class_<TypedWorkspaceProperty, bases<PropertyWithValue<WorkspaceType_sptr>,
IWorkspaceProperty>,
105 boost::noncopyable>(pythonClassName, no_init)
106 .def(init<const std::string &, const std::string &, const unsigned int>(
107 args(
"name",
"defaultValue",
"direction")))
108 .def(init<const std::string &, const std::string &, const unsigned int, API::PropertyMode::Type>(
109 args(
"name",
"defaultValue",
"direction",
"optional")))
114 (arg(
"name"), arg(
"defaultValue"), arg(
"direction"), arg(
"validator"))))
116 args(
"name",
"defaultValue",
"direction",
"optional",
"validator")))
119 args(
"name",
"defaultValue",
"direction",
"optional",
"locking",
"validator")))
121 "Returns true if the property has been marked as optional")
123 .add_property(
"value", &
value);
double value
The value of the point.
An interface that is implemented by WorkspaceProperty.
A property class for workspaces.
bool isOptional() const override
Is the input workspace property optional (can be blank)?
IValidator is the basic interface for all validators for properties.
virtual IValidator_sptr clone() const =0
Make a copy of the present type of validator.
The concrete, templated class for properties.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Helper class which provides the Collimation Length for SANS instruments.
static void define(const char *pythonClassName)
A helper struct to export WorkspaceProperty<> types to Python.
Mantid::API::WorkspaceProperty< WorkspaceType > TypedWorkspaceProperty
The export type.
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 u...
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 t...
static void define(const char *pythonClassName)
Defines the necessary exports for a WorkspaceProperty<WorkspaceType>.
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 t...
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 t...
std::shared_ptr< WorkspaceType > WorkspaceType_sptr
Shared pointer to Worksapce type.