CppCommon  1.0.4.1
C++ Common Library
dll.inl
Go to the documentation of this file.
1 
9 namespace CppCommon {
10 
11 template <typename T>
12 inline T* DLL::Resolve(const std::string& name) const
13 {
14  return (T*)ResolveAddress(name);
15 }
16 
17 inline std::string DLL::prefix()
18 {
19 #if defined(__CYGWIN__)
20  return "cyg";
21 #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) || defined(__MINGW32__) || defined(__MINGW64__)
22  return "lib";
23 #else
24  return "";
25 #endif
26 }
27 
28 inline std::string DLL::extension()
29 {
30 #if defined(__APPLE__)
31  return ".dylib";
32 #elif (defined(unix) || defined(__unix) || defined(__unix__)) && !defined(__CYGWIN__)
33  return ".so";
34 #elif defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
35  return ".dll";
36 #else
37  return "";
38 #endif
39 }
40 
41 inline void swap(DLL& dll1, DLL& dll2) noexcept
42 {
43  dll1.swap(dll2);
44 }
45 
46 } // namespace CppCommon
Dynamic link library.
Definition: dll.h:56
static std::string extension()
Get the dynamic link library extension.
Definition: dll.inl:28
T * Resolve(const std::string &name) const
Resolve dynamic link library symbol by the given name.
Definition: dll.inl:12
static std::string prefix()
Get the dynamic link library prefix.
Definition: dll.inl:17
C++ Common project definitions.
Definition: token_bucket.h:15
void swap(FileCache &cache1, FileCache &cache2) noexcept
Definition: filecache.inl:23