Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
usSharedLibrary.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  Library: CppMicroServices
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics
7 
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 =============================================================================*/
21 
22 #ifndef USSHAREDLIBRARY_H
23 #define USSHAREDLIBRARY_H
24 
25 #include "usCoreConfig.h"
26 #include "usSharedData.h"
27 
28 #include <string>
29 
30 #ifdef _MSC_VER
31 #pragma warning(push)
32 #pragma warning(disable:4251)
33 #endif
34 
35 US_BEGIN_NAMESPACE
36 
37 class SharedLibraryPrivate;
38 
44 class US_Core_EXPORT SharedLibrary
45 {
46 public:
47 
48  SharedLibrary();
49  SharedLibrary(const SharedLibrary& other);
50 
59  SharedLibrary(const std::string& libPath, const std::string& name);
60 
68  SharedLibrary(const std::string& absoluteFilePath);
69 
73  ~SharedLibrary();
74 
75  SharedLibrary& operator=(const SharedLibrary& other);
76 
87  void Load();
88 
96  void Load(int flags);
97 
104  void Unload();
105 
114  void SetName(const std::string& name);
115 
120  std::string GetName() const;
121 
129  std::string GetFilePath(const std::string& name) const;
130 
139  void SetFilePath(const std::string& absoluteFilePath);
140 
146  std::string GetFilePath() const;
147 
155  void SetLibraryPath(const std::string& path);
156 
162  std::string GetLibraryPath() const;
163 
171  void SetSuffix(const std::string& suffix);
172 
178  std::string GetSuffix() const;
179 
187  void SetPrefix(const std::string& prefix);
188 
194  std::string GetPrefix() const;
195 
202  void* GetHandle() const;
203 
209  bool IsLoaded() const;
210 
211 private:
212 
214 
215 };
216 
217 US_END_NAMESPACE
218 
219 #ifdef _MSC_VER
220 #pragma warning(pop)
221 #endif
222 
223 #endif // USTESTUTILSHAREDLIBRARY_H
static std::string GetName(std::string fileName, std::string suffix)