Inviwo 0.9.12-pre
Inviwo documentation
|
Loader for dll/so/dylib. Get functions from loaded library using findSymbol(...). More...
#include <sharedlibrary.h>
Public Member Functions | |
SharedLibrary (const std::filesystem::path &filePath) | |
SharedLibrary (const SharedLibrary &rhs)=delete | |
SharedLibrary & | operator= (const SharedLibrary &that)=delete |
SharedLibrary (SharedLibrary &&rhs) noexcept | |
SharedLibrary & | operator= (SharedLibrary &&that) noexcept |
const std::filesystem::path & | getFilePath () |
void * | findSymbol (const std::string &name) |
Get function address from library. | |
template<typename T > | |
T | findSymbolTyped (const std::string &name) |
Get typed function address from library. | |
void | release () |
Static Public Member Functions | |
static std::set< std::filesystem::path > | libraryFileExtensions () |
Loader for dll/so/dylib. Get functions from loaded library using findSymbol(...).
Loads specified dll/so/dylib on construction and unloads it on destruction. Throws an inviwo::Exception if library failed to load.
void * inviwo::SharedLibrary::findSymbol | ( | const std::string & | name | ) |
Get function address from library.
Example usage:
name | Function name |
T inviwo::SharedLibrary::findSymbolTyped | ( | const std::string & | name | ) |
Get typed function address from library.
Example usage:
name | Function name |
void inviwo::SharedLibrary::release | ( | ) |
Reset the handle and effectively leak the lib. Needed for some dll that crashes on exit otherwise