#include <DynamicLoader.h>
|
| static void * | dlOpen (const std::string &libFile, int flags=RTLD_LOCAL|RTLD_LAZY) |
| static void | dlCloseDelayed (void *handle) |
| static int | dlClose (void *handle) |
| static const void * | dlSym (void *handle, const std::string &symbol) |
| static const char * | dlError () |
Definition at line 58 of file DynamicLoader.h.
◆ DynamicLoader()
| core::DynamicLoader::DynamicLoader |
( |
| ) |
|
|
delete |
◆ ~DynamicLoader()
| core::DynamicLoader::~DynamicLoader |
( |
| ) |
|
|
delete |
◆ canonicalizePath()
| std::string core::DynamicLoader::canonicalizePath |
( |
const std::string & | libFile | ) |
|
|
staticprivate |
Definition at line 59 of file DynamicLoader.cpp.
59 {
60 std::string result = libFile;
61
62 try {
63 const std::filesystem::path p(libFile);
64
65
66 if (std::filesystem::exists(p)) {
67 result = std::filesystem::canonical(p).string();
68 }
69 } catch (...) {
70
71 }
72
73 return result;
74 }
Referenced by dlOpen().
◆ dlClose() [1/2]
| int core::DynamicLoader::dlClose |
( |
Library & | library | ) |
|
|
staticprivate |
◆ dlClose() [2/2]
| int core::DynamicLoader::dlClose |
( |
void * | handle | ) |
|
|
static |
◆ dlCloseDelayed()
| void core::DynamicLoader::dlCloseDelayed |
( |
void * | handle | ) |
|
|
static |
◆ dlError()
| const char * core::DynamicLoader::dlError |
( |
| ) |
|
|
static |
◆ dlOpen()
| void * core::DynamicLoader::dlOpen |
( |
const std::string & | libFile, |
|
|
int | flags = RTLD_LOCAL | RTLD_LAZY ) |
|
static |
Definition at line 76 of file DynamicLoader.cpp.
76 {
77 void* handle = nullptr;
78
80
85 lib.closePending = false;
86
87 LOG(
TRACE) <<
"DynLoader: dlOpen: " << lib.fileName <<
": already open (refCount=" << lib.refCount <<
")";
88 handle = lib.handle;
89 } else {
90
92
94 if (handle != nullptr) {
97 lib.canonicalFileName = canonicalFile;
98 lib.handle = handle;
99 lib.refCount = 1;
100 lib.closePending = false;
101
104
105 LOG(
TRACE) <<
"DynLoader: dlOpen: " << libFile <<
": success";
106 } else {
108 }
109 }
110
111 return handle;
112 }
static std::string canonicalizePath(const std::string &libFile)
void * dlopen(const char *filename, int flags)
References core::DynamicLoader::Library::canonicalFileName, canonicalizePath(), core::DynamicLoader::Library::closePending, dlError(), core::system::dlopen(), dlOpenedLibraries, dlOpenedLibrariesByHandle, core::DynamicLoader::Library::fileName, core::DynamicLoader::Library::handle, and core::DynamicLoader::Library::refCount.
Referenced by web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::load(), and web::websocket::SubProtocolFactorySelector< SubProtocolFactoryT >::load().
◆ dlSym()
| const void * core::DynamicLoader::dlSym |
( |
void * | handle, |
|
|
const std::string & | symbol ) |
|
static |
◆ execDlCloseAll()
| void core::DynamicLoader::execDlCloseAll |
( |
| ) |
|
|
staticprivate |
◆ execDlCloseDeleyed()
| void core::DynamicLoader::execDlCloseDeleyed |
( |
| ) |
|
|
staticprivate |
◆ realExecDlClose()
| int core::DynamicLoader::realExecDlClose |
( |
const Library & | library | ) |
|
|
staticprivate |
◆ EventLoop
◆ EventMultiplexer
| friend class EventMultiplexer |
|
friend |
◆ closeQueue
| std::list< std::string > core::DynamicLoader::closeQueue |
|
staticprivate |
◆ dlOpenedLibraries
◆ dlOpenedLibrariesByHandle
| std::map< void *, std::string > core::DynamicLoader::dlOpenedLibrariesByHandle |
|
staticprivate |
The documentation for this class was generated from the following files: