Modern, type-safe plugin loader. More...
#include <PluginLoader.hpp>
Collaboration diagram for utl::PluginLoader:Public Member Functions | |
| PluginLoader ()=default | |
| ~PluginLoader ()=default | |
| PluginLoader (const PluginLoader &)=delete | |
| PluginLoader & | operator= (const PluginLoader &)=delete |
| PluginLoader (PluginLoader &&)=delete | |
| PluginLoader & | operator= (PluginLoader &&)=delete |
| template<std::derived_from< IPlugin > T> | |
| std::shared_ptr< T > | loadPlugin (const std::string &path) |
| Load a plugin of type T. | |
Private Member Functions | |
| SharedLib | loadLibrary (const std::string &path) |
| EntryPointFn | getEntryPoint (SharedLib &lib, const std::string &path) |
Private Attributes | |
| std::mutex | m_mutex |
| std::unordered_map< std::string, SharedLib > | m_handles |
| std::unordered_map< std::string, std::unique_ptr< IPlugin > > | m_plugins |
Modern, type-safe plugin loader.
Definition at line 85 of file PluginLoader.hpp.
|
default |
|
default |
|
delete |
|
delete |
|
inlineprivate |
Definition at line 176 of file PluginLoader.hpp.
References utl::SharedLib::handle.
Referenced by loadPlugin().
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 137 of file PluginLoader.hpp.
Referenced by loadPlugin().
Here is the caller graph for this function:
|
inline |
Load a plugin of type T.
| T | Expected plugin interface (must derive from IPlugin) |
| path | Path to the dynamic library |
Definition at line 102 of file PluginLoader.hpp.
References getEntryPoint(), utl::INFO, loadLibrary(), utl::Logger::log(), m_handles, m_mutex, and m_plugins.
Here is the call graph for this function:
|
delete |
|
delete |
|
private |
Definition at line 134 of file PluginLoader.hpp.
Referenced by loadPlugin().
|
private |
Definition at line 133 of file PluginLoader.hpp.
Referenced by loadPlugin().
|
private |
Definition at line 135 of file PluginLoader.hpp.
Referenced by loadPlugin().