Mantid
Loading...
Searching...
No Matches
SampleEnvironment.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9
10#include <boost/python/class.hpp>
11#include <boost/python/register_ptr_to_python.hpp>
12
14using namespace boost::python;
15
17
19 register_ptr_to_python<std::shared_ptr<SampleEnvironment>>();
20
21 class_<SampleEnvironment>("SampleEnvironment", no_init)
22 .def("getContainer", &SampleEnvironment::getContainer, (args("self")), "Returns the Container or Can",
23 return_value_policy<reference_existing_object>())
24 .def("getComponent", &SampleEnvironment::getComponent, (args("self", "index")),
25 "Returns the requested IObject. Index 0 is considered the container",
26 return_value_policy<reference_existing_object>())
27 .def("nelements", &SampleEnvironment::nelements, (args("self")),
28 "Returns the number of elements the environment is composed of.");
29}
#define GET_POINTER_SPECIALIZATION(TYPE)
Definition: GetPointer.h:17
void export_SampleEnvironment()
Defines a single instance of a SampleEnvironment.
const Container & getContainer() const
const IObject & getComponent(const size_t index) const
Returns the requested IObject.