Mantid
Loading...
Searching...
No Matches
Macros | Functions
ArrayProperty.cpp File Reference
#include "MantidKernel/ArrayProperty.h"
#include "MantidKernel/NullValidator.h"
#include "MantidPythonInterface/core/Converters/ContainerDtype.h"
#include "MantidPythonInterface/core/Converters/NDArrayToVector.h"
#include "MantidPythonInterface/core/Converters/PySequenceToVector.h"
#include "MantidPythonInterface/core/NDArray.h"
#include "MantidPythonInterface/core/Policies/VectorToNumpy.h"
#include <boost/python/class.hpp>
#include <boost/python/list.hpp>
#include <boost/python/default_call_policies.hpp>
#include <boost/python/make_constructor.hpp>

Go to the source code of this file.

Macros

#define EXPORT_ARRAY_PROP(type, prefix)
 

Functions

void export_ArrayProperty ()
 

Macro Definition Documentation

◆ EXPORT_ARRAY_PROP

#define EXPORT_ARRAY_PROP (   type,
  prefix 
)
Value:
class_<ArrayProperty<type>, bases<PropertyWithValue<std::vector<type>>>, boost::noncopyable>( \
#prefix "ArrayProperty", no_init) \
.def(init<const std::string &, const unsigned int>( \
(arg("self"), arg("name"), arg("direction") = Direction::Input), \
"Construct an ArrayProperty of type " #type)) \
\
.def(init<const std::string &, IValidator_sptr, const unsigned int>( \
(arg("self"), arg("name"), arg("validator"), arg("direction") = Direction::Input), \
"Construct an ArrayProperty of type " #type " with a validator")) \
\
.def(init<const std::string &, const std::string &, IValidator_sptr, const unsigned int>( \
(arg("self"), arg("name"), arg("values"), arg("validator") = IValidator_sptr(new NullValidator), \
arg("direction") = Direction::Input), \
"Construct an ArrayProperty of type " #type " with a validator giving the values as a string")) \
.def("__init__", \
make_constructor(&createArrayPropertyFromList<type>, default_call_policies(), \
(arg("name"), arg("values"), arg("validator") = IValidator_sptr(new NullValidator), \
arg("direction") = Direction::Input))) \
.def("__init__", \
make_constructor(&createArrayPropertyFromNDArray<type>, default_call_policies(), \
(arg("name"), arg("values"), arg("validator") = IValidator_sptr(new NullValidator), \
arg("direction") = Direction::Input))) \
.def("dtype", &dtype<type>, arg("self")) \
.add_property("value", make_function(&ArrayProperty<type>::operator(), return_cloned_numpy()));

Definition at line 67 of file ArrayProperty.cpp.

Function Documentation

◆ export_ArrayProperty()

void export_ArrayProperty ( )

Definition at line 123 of file ArrayProperty.cpp.

References EXPORT_ARRAY_PROP.