13#include <boost/python/bases.hpp>
14#include <boost/python/class.hpp>
15#include <boost/python/return_by_value.hpp>
16#include <boost/python/return_value_policy.hpp>
22 if (std::is_same<HeldType, std::string>::value) {
24 std::string val = self.
value();
25 ss <<
"S" << val.size();
26 std::string ret_val = ss.str();
34namespace PythonInterface {
39template <
typename HeldType,
typename ValueReturnPolicy = boost::python::return_by_value>
41 static void define(
const char *pythonClassName) {
45 class_<PropertyWithValue<HeldType>, bases<Property>, boost::noncopyable>(
46 pythonClassName, init<std::string, HeldType>((arg(
"self"), arg(
"name"), arg(
"value"))))
47 .add_property(
"value",
49 .def(
"dtype", &dtype<HeldType>, arg(
"self"));
std::string dtype(Mantid::Kernel::PropertyWithValue< HeldType > &self)
The concrete, templated class for properties.
std::string value() const override
Returns the value of the property as a string.
std::string dtype(const Container< HeldType > &)
Helper class which provides the Collimation Length for SANS instruments.
A helper struct to export PropertyWithValue<> types to Python.
static void define(const char *pythonClassName)