Newer
Older
#ifndef MANTID_KERNEL_LIBRARY_MANAGER_H_
Russell Taylor
committed
#define MANTID_KERNEL_LIBRARY_MANAGER_H_
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include <string>
#include <map>
#include "MantidKernel/SingletonHolder.h"
Gigg, Martyn Anthony
committed
#include "MantidKernel/DllConfig.h"
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
namespace Mantid {
namespace Kernel {
class LibraryWrapper;
/**
Class for opening shared libraries.
@author ISIS, STFC
@date 15/10/2007
Copyright © 2007 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_KERNEL_DLL LibraryManagerImpl {
public:
// opens all suitable libraries on a given path
int OpenAllLibraries(const std::string &, bool isRecursive = false);
private:
friend struct Mantid::Kernel::CreateUsingNew<LibraryManagerImpl>;
/// Private Constructor
LibraryManagerImpl();
/// Private copy constructor - NO COPY ALLOWED
LibraryManagerImpl(const LibraryManagerImpl &);
/// Private assignment operator - NO ASSIGNMENT ALLOWED
LibraryManagerImpl &operator=(const LibraryManagerImpl &);
/// Private Destructor
virtual ~LibraryManagerImpl();
/// Load a given library
bool loadLibrary(const std::string &filepath);
/// Returns true if the library is to be loaded
bool skip(const std::string &filename);
/// Storage for the LibraryWrappers.
std::map<const std::string, boost::shared_ptr<Mantid::Kernel::LibraryWrapper>>
OpenLibs;
};
/// Forward declaration of a specialisation of SingletonHolder for
/// LibraryManagerImpl (needed for dllexport/dllimport) and a typedef for it.
#if defined(__APPLE__) && defined(__INTEL_COMPILER)
template class MANTID_KERNEL_DLL
Mantid::Kernel::SingletonHolder<LibraryManagerImpl>;
typedef MANTID_KERNEL_DLL Mantid::Kernel::SingletonHolder<LibraryManagerImpl>
LibraryManager;
Russell Taylor
committed
} // namespace Mantid
#endif // MANTID_KERNEL_LIBRARY_MANAGER_H_