Mantid
Loading...
Searching...
No Matches
PreviewManager.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
8
9#include <boost/python/class.hpp>
10#include <boost/python/reference_existing_object.hpp>
11#include <boost/python/return_value_policy.hpp>
12
15using namespace boost::python;
16
17namespace {
18PreviewManagerImpl &instance() { return PreviewManager::Instance(); }
19} // namespace
20
22 class_<PreviewManagerImpl, boost::noncopyable>("PreviewManager", no_init)
23 .def("getPreview", &PreviewManagerImpl::getPreview, (arg("self"), arg("facility"), arg("technique"), arg("name")),
24 "Get the preview by the facility, technique and the name.", return_value_policy<reference_existing_object>())
25 .def("getPreviews", &PreviewManagerImpl::getPreviews, (arg("self"), arg("facility"), arg("technique") = ""),
26 "Get the names of the previews available for the facility and "
27 "technique.")
28 .def("Instance", instance, "Return a reference to the singleton instance",
29 return_value_policy<reference_existing_object>())
30 .staticmethod("Instance");
31}
void export_PreviewManager()
PreviewManager : Manages the raw data previews.
std::vector< std::string > getPreviews(const std::string &facility, const std::string &technique="") const
const IPreview & getPreview(const std::string &facility, const std::string &technique, const std::string &preview) const
Manage the lifetime of a class intended to be a singleton.