Mantid
Loading...
Searching...
No Matches
CatalogManager.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 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#pragma once
8
11
12#include <map>
13#include <string>
14
15namespace Mantid {
16namespace API {
24class MANTID_API_DLL CatalogManagerImpl {
25public:
30 CatalogSession_sptr login(const std::string &username, const std::string &password, const std::string &endpoint,
31 const std::string &facility);
33 ICatalog_sptr getCatalog(const std::string &sessionID);
36 void destroyCatalog(const std::string &sessionID);
38 std::vector<CatalogSession_sptr> getActiveSessions();
40 size_t numberActiveSessions() const;
41
42private:
45 CatalogManagerImpl() = default;
46 virtual ~CatalogManagerImpl() = default;
47
48 // Holds a list of active catalogs and uses their sessionId as unique
49 // identifier.
50 std::map<CatalogSession_sptr, ICatalog_sptr> m_activeCatalogs;
51};
52
54} // namespace API
55} // namespace Mantid
56
57namespace Mantid {
58namespace Kernel {
59EXTERN_MANTID_API template class MANTID_API_DLL Kernel::SingletonHolder<Mantid::API::CatalogManagerImpl>;
60}
61} // namespace Mantid
This class is a singleton and is responsible for creating, destroying, and managing catalogs.
CatalogManagerImpl(const CatalogManagerImpl &)=delete
virtual ~CatalogManagerImpl()=default
std::map< CatalogSession_sptr, ICatalog_sptr > m_activeCatalogs
CatalogManagerImpl & operator=(const CatalogManagerImpl &)=delete
Manage the lifetime of a class intended to be a singleton.
std::shared_ptr< CatalogSession > CatalogSession_sptr
std::shared_ptr< ICatalog > ICatalog_sptr
Definition: ICatalog.h:55
Helper class which provides the Collimation Length for SANS instruments.
Policy class controlling creation of the singleton Implementation classes should mark their default c...