Dynamic link library.
More...
#include <dll.h>
|
static std::string | prefix () |
| Get the dynamic link library prefix. More...
|
|
static std::string | extension () |
| Get the dynamic link library extension. More...
|
|
Dynamic link library.
Dynamic link library wraps dll operations (load, resolve, unload).
Not thread-safe.
- Examples
- system_dll.cpp.
Definition at line 55 of file dll.h.
◆ DLL() [1/4]
Initialize the dynamic link library with an empty path.
Definition at line 147 of file dll.cpp.
◆ DLL() [2/4]
CppCommon::DLL::DLL |
( |
const Path & |
path, |
|
|
bool |
load = true |
|
) |
| |
Initialize the dynamic link library with a given path and optionally load it.
- Parameters
-
path | - Dynamic link library path |
load | - Load library flag (default is true) |
Definition at line 158 of file dll.cpp.
◆ DLL() [3/4]
CppCommon::DLL::DLL |
( |
const DLL & |
dll | ) |
|
◆ DLL() [4/4]
CppCommon::DLL::DLL |
( |
DLL && |
dll | ) |
|
|
noexcept |
◆ ~DLL()
◆ extension()
std::string CppCommon::DLL::extension |
( |
| ) |
|
|
inlinestatic |
Get the dynamic link library extension.
Linux: .so OSX: .dylib Windows: .dll
- Returns
- Dynamic link library extension
Definition at line 28 of file dll.inl.
◆ IsLoaded()
bool CppCommon::DLL::IsLoaded |
( |
| ) |
const |
Is dynamic link library loaded?
Definition at line 226 of file dll.cpp.
◆ IsResolve()
bool CppCommon::DLL::IsResolve |
( |
const std::string & |
name | ) |
const |
Is dynamic link library resolve the given symbol?
Definition at line 227 of file dll.cpp.
◆ Load() [1/2]
bool CppCommon::DLL::Load |
( |
| ) |
|
Load dynamic link library.
- Returns
- 'true' if the library was successfully loaded, 'false' if the library was not loaded
- Examples
- system_dll.cpp.
Definition at line 229 of file dll.cpp.
◆ Load() [2/2]
bool CppCommon::DLL::Load |
( |
const Path & |
path | ) |
|
Load dynamic link library with a given path.
- Parameters
-
path | - Dynamic link library path |
- Returns
- 'true' if the library was successfully loaded, 'false' if the library was not loaded
Definition at line 230 of file dll.cpp.
◆ operator bool()
CppCommon::DLL::operator bool |
( |
| ) |
const |
|
inlineexplicit |
Check if the dynamic link library is loaded.
Definition at line 75 of file dll.h.
◆ operator=() [1/3]
DLL & CppCommon::DLL::operator= |
( |
const DLL & |
dll | ) |
|
◆ operator=() [2/3]
DLL & CppCommon::DLL::operator= |
( |
const Path & |
path | ) |
|
◆ operator=() [3/3]
DLL & CppCommon::DLL::operator= |
( |
DLL && |
dll | ) |
|
|
noexcept |
◆ path()
const Path CppCommon::DLL::path |
( |
| ) |
const |
Get the dynamic link library path.
Definition at line 224 of file dll.cpp.
◆ prefix()
std::string CppCommon::DLL::prefix |
( |
| ) |
|
|
inlinestatic |
Get the dynamic link library prefix.
Cygwin: cyg MinGW: lib Linux: lib OSX: lib Windows:
- Returns
- Dynamic link library prefix
Definition at line 17 of file dll.inl.
◆ Resolve()
template<typename T >
T * CppCommon::DLL::Resolve |
( |
const std::string & |
name | ) |
const |
|
inline |
Resolve dynamic link library symbol by the given name.
- Parameters
-
- Returns
- A pointer to the resolved symbol or nullptr in case of symbol resolution failed
- Examples
- system_dll.cpp.
Definition at line 12 of file dll.inl.
◆ swap()
void CppCommon::DLL::swap |
( |
DLL & |
dll | ) |
|
|
noexcept |
Swap two instances.
Definition at line 235 of file dll.cpp.
◆ Unload()
void CppCommon::DLL::Unload |
( |
| ) |
|
Unload dynamic link library.
If the dynamic link library cannot be unloaded the method will raise a dynamic link library exception!
- Examples
- system_dll.cpp.
Definition at line 231 of file dll.cpp.
◆ swap
void swap |
( |
DLL & |
dll1, |
|
|
DLL & |
dll2 |
|
) |
| |
|
friend |
The documentation for this class was generated from the following files: