Mantid
Loading...
Searching...
No Matches
CatalogManager.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 +
9
10#include <boost/python/class.hpp>
11#include <boost/python/def.hpp>
12#include <boost/python/list.hpp>
13#include <boost/python/register_ptr_to_python.hpp>
14
15#include <map>
16
17using namespace Mantid::API;
18using namespace boost::python;
19
21
23 boost::python::list sessions;
24 const auto vecSessions = self.getActiveSessions();
25 for (const auto &vecSession : vecSessions) {
26 sessions.append(vecSession);
27 }
28 return sessions;
29}
30
32 register_ptr_to_python<CatalogManagerImpl *>();
33
34 class_<CatalogManagerImpl, boost::noncopyable>("CatalogManagerImpl", no_init)
35 .def("numberActiveSessions", &CatalogManagerImpl::numberActiveSessions, "Number of active sessions open")
36 .def("getActiveSessions", &getActiveSessionsAsList, "Get the active sessions")
37 .def("Instance", &CatalogManager::Instance, return_value_policy<reference_existing_object>(),
38 "Returns a reference to the CatalogManger singleton")
39 .staticmethod("Instance");
40}
#define GET_POINTER_SPECIALIZATION(TYPE)
Definition: GetPointer.h:17
boost::python::list getActiveSessionsAsList(CatalogManagerImpl &self)
void export_CatalogManager()
This class is a singleton and is responsible for creating, destroying, and managing catalogs.
size_t numberActiveSessions() const
Returns the number of active sessions.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
Definition: NDArray.h:49