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 <string>
13#include <unordered_map>
14#include <vector>
15
16#include "MantidKernel/DllConfig.h"
19
20namespace Poco {
21class File;
22class Path;
23} // namespace Poco
24
25namespace Mantid {
26namespace Kernel {
33class MANTID_KERNEL_DLL LibraryManagerImpl {
34public:
35 enum LoadLibraries { Recursive, NonRecursive };
36 int openLibraries(const std::string &libpath, LoadLibraries loadingBehaviour,
37 const std::vector<std::string> &excludes);
39 LibraryManagerImpl &operator=(const LibraryManagerImpl &) = delete;
40
41private:
43
48
51 int openLibraries(const Poco::File &libpath, LoadLibraries loadingBehaviour,
52 const std::vector<std::string> &excludes);
54 bool shouldBeLoaded(const std::string &filename, const std::vector<std::string> &excludes) const;
56 bool isLoaded(const std::string &filename) const;
58 bool isExcluded(const std::string &filename, const std::vector<std::string> &excludes) const;
60 int openLibrary(const Poco::File &filepath, const std::string &cacheKey);
61
63 std::unordered_map<std::string, LibraryWrapper> m_openedLibs;
64};
65
66EXTERN_MANTID_KERNEL template class MANTID_KERNEL_DLL Mantid::Kernel::SingletonHolder<LibraryManagerImpl>;
68
69} // namespace Kernel
70} // 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.
Helper class which provides the Collimation Length for SANS instruments.
Definition: Algorithm.h:30
Policy class controlling creation of the singleton Implementation classes should mark their default c...