Mantid
Loading...
Searching...
No Matches
Framework
PythonInterface
mantid
api
src
Exports
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 +
7
#include "
MantidAPI/CatalogManager.h
"
8
#include "
MantidPythonInterface/core/GetPointer.h
"
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
17
using namespace
Mantid::API
;
18
using namespace
boost::python
;
19
20
GET_POINTER_SPECIALIZATION
(
CatalogManagerImpl
)
21
22
boost
::python::list
getActiveSessionsAsList
(
CatalogManagerImpl
&self) {
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
31
void
export_CatalogManager
() {
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
}
CatalogManager.h
GetPointer.h
GET_POINTER_SPECIALIZATION
#define GET_POINTER_SPECIALIZATION(TYPE)
Definition
GetPointer.h:17
getActiveSessionsAsList
boost::python::list getActiveSessionsAsList(CatalogManagerImpl &self)
Definition
CatalogManager.cpp:22
export_CatalogManager
void export_CatalogManager()
Definition
CatalogManager.cpp:31
Mantid::API::CatalogManagerImpl
This class is a singleton and is responsible for creating, destroying, and managing catalogs.
Definition
CatalogManager.h:24
Mantid::API::CatalogManagerImpl::numberActiveSessions
size_t numberActiveSessions() const
Returns the number of active sessions.
Definition
CatalogManager.cpp:107
Mantid::API
Definition
AbsorptionCorrection.h:20
boost::python
Definition
NDArray.h:50
boost
Definition
NDArray.h:49
Generated by
1.9.8