Mantid
Loading...
Searching...
No Matches
LibraryManager.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include <filesystem>
13#include <string>
14#include <unordered_map>
15#include <vector>
16
17#include "MantidKernel/DllConfig.h"
20
21namespace Mantid {
22namespace Kernel {
29class MANTID_KERNEL_DLL LibraryManagerImpl {
30public:
31 enum LoadLibraries { Recursive, NonRecursive };
32 int openLibraries(const std::string &libpath, LoadLibraries loadingBehaviour,
33 const std::vector<std::string> &excludes);
35 LibraryManagerImpl &operator=(const LibraryManagerImpl &) = delete;
36
37private:
39
44
47 int openLibraries(const std::filesystem::path &libpath, LoadLibraries loadingBehaviour,
48 const std::vector<std::string> &excludes);
50 bool shouldBeLoaded(const std::string &filename, const std::vector<std::string> &excludes) const;
52 bool isLoaded(const std::string &filename) const;
54 bool isExcluded(const std::string &filename, const std::vector<std::string> &excludes) const;
56 int openLibrary(const std::filesystem::path &filepath, const std::string &cacheKey);
57
59 std::unordered_map<std::string, LibraryWrapper> m_openedLibs;
60};
61
62EXTERN_MANTID_KERNEL template class MANTID_KERNEL_DLL Mantid::Kernel::SingletonHolder<LibraryManagerImpl>;
64
65} // namespace Kernel
66} // namespace Mantid
Class for opening shared libraries.
~LibraryManagerImpl()=default
Private Destructor.
LibraryManagerImpl(const LibraryManagerImpl &)=delete
std::unordered_map< std::string, LibraryWrapper > m_openedLibs
Storage for the LibraryWrappers.
Manage the lifetime of a class intended to be a singleton.
Mantid::Kernel::SingletonHolder< LibraryManagerImpl > LibraryManager
Helper class which provides the Collimation Length for SANS instruments.
Policy class controlling creation of the singleton Implementation classes should mark their default c...