#include <PluginLoader.h>
Public Member Functions | |
| void | add_config_paths (const std::string &colon_paths) |
| Inject search paths from the eOn config file. | |
| template<typename Fn> | |
| Fn | load_sym (const char *lib_base, const char *sym_name) |
| Load a symbol from a named potential library. | |
| void | throw_not_found (const char *lib_base, const char *description) const |
| Throw a descriptive error for a missing potential library. | |
| bool | lib_present (const char *lib_base) const |
| Filesystem probe: a matching library file is on the configured search path. | |
| const std::vector< std::string > & | search_paths () const noexcept |
| Get the current search paths (for diagnostics). | |
| PluginLoader (const PluginLoader &)=delete | |
| PluginLoader & | operator= (const PluginLoader &)=delete |
Static Public Member Functions | |
| static PluginLoader & | instance () |
| Thread-safe singleton accessor (Meyer's pattern). | |
Private Member Functions | |
| PluginLoader () | |
| ~PluginLoader () | |
| dynlib::Handle | open_lib (const char *lib_base) |
| std::vector< std::string > | lib_names (const char *lib_base) const |
| void | append_paths (const std::string &path_str, char sep) |
Private Attributes | |
| std::vector< std::string > | m_search_paths |
| std::mutex | m_mutex |
| std::unordered_map< std::string, dynlib::Handle > | m_handles |
| std::string | m_last_load_error |
| Last dynlib::error() from a failed open (for throw_not_found). | |
| bool | m_last_load_saw_file = false |
Definition at line 41 of file PluginLoader.h.
|
delete |
|
private |
Definition at line 25 of file PluginLoader.cpp.
|
private |
Definition at line 38 of file PluginLoader.cpp.
| void eonc::PluginLoader::add_config_paths | ( | const std::string & | colon_paths | ) |
Inject search paths from the eOn config file.
| colon_paths | colon-separated directory list (may be empty) These paths are inserted before the EON_POTENTIALS_PATH paths. |
Definition at line 66 of file PluginLoader.cpp.
|
private |
Definition at line 44 of file PluginLoader.cpp.
|
static |
Thread-safe singleton accessor (Meyer's pattern).
Definition at line 20 of file PluginLoader.cpp.
|
private |
Definition at line 100 of file PluginLoader.cpp.
|
nodiscard |
Filesystem probe: a matching library file is on the configured search path.
Does not dlopen, so plugin static initializers (banners) do not run.
Definition at line 164 of file PluginLoader.cpp.
|
inline |
Load a symbol from a named potential library.
| lib_base | Base name without platform prefix/suffix (e.g. "eon_sw") |
| sym_name | Symbol to load (e.g. "sw_") |
Definition at line 56 of file PluginLoader.h.
|
private |
Definition at line 113 of file PluginLoader.cpp.
|
delete |
|
inlinenodiscardnoexcept |
Get the current search paths (for diagnostics).
Definition at line 73 of file PluginLoader.h.
| void eonc::PluginLoader::throw_not_found | ( | const char * | lib_base, |
| const char * | description ) const |
Throw a descriptive error for a missing potential library.
Definition at line 177 of file PluginLoader.cpp.
|
private |
Definition at line 90 of file PluginLoader.h.
|
private |
Last dynlib::error() from a failed open (for throw_not_found).
Definition at line 92 of file PluginLoader.h.
|
private |
Definition at line 93 of file PluginLoader.h.
|
mutableprivate |
Definition at line 89 of file PluginLoader.h.
|
private |
Definition at line 88 of file PluginLoader.h.