![]() |
MaCh3
2.6.1
Reference Guide
|
Manages the lifecycle of a dynamically loaded plugin. More...
#include <CLI/DynamicPlugin.hpp>
Public Member Functions | |
| DynamicPlugin (const std::string &sofile) | |
| Constructor that loads a plugin from a shared library file. More... | |
| DynamicPlugin (const char *sofile) | |
| Constructor that loads a plugin from a shared library file. More... | |
| int | Run () override |
| Run the plugin's main functionality. More... | |
| MaCh3ArgumentParser * | get_parser () override |
| Get the argument parser for this plugin. More... | |
| virtual | ~DynamicPlugin ()=default |
| Destructor closes the shared library handle. More... | |
Public Member Functions inherited from M3::IPlugin | |
| virtual | ~IPlugin ()=default |
Static Private Member Functions | |
| static void | dlcloser (void *h) |
Private Attributes | |
| MaCh3ArgumentParser * | m_parser = nullptr |
| Pointer to the plugin's argument parser, owned by the shared library. More... | |
| std::unique_ptr< void, decltype(&dlcloser)> | m_handle |
| Handle to the loaded shared library. More... | |
| std::unique_ptr< IPlugin, destroy_plugin_t > | m_plugin |
| Smart pointer to plugin with custom deleter. More... | |
Manages the lifecycle of a dynamically loaded plugin.
This class wraps a plugin loaded from a shared library, maintaining the library handle and providing cleanup functionality using smart pointers.
Definition at line 16 of file DynamicPlugin.hpp.
|
inline |
Constructor that loads a plugin from a shared library file.
| sofile | Path to the shared library file (.so) |
Definition at line 20 of file DynamicPlugin.hpp.
|
inline |
Constructor that loads a plugin from a shared library file.
| sofile | Path to the shared library file (.so) |
Definition at line 25 of file DynamicPlugin.hpp.
|
virtualdefault |
Destructor closes the shared library handle.
|
inlinestaticprivate |
Definition at line 90 of file DynamicPlugin.hpp.
|
inlineoverridevirtual |
Get the argument parser for this plugin.
pointer is owned by the shared library and will be deleted when the library is unloaded
Implements M3::IPlugin.
Definition at line 81 of file DynamicPlugin.hpp.
|
inlineoverridevirtual |
Run the plugin's main functionality.
Implements M3::IPlugin.
Definition at line 73 of file DynamicPlugin.hpp.
|
private |
Handle to the loaded shared library.
Definition at line 95 of file DynamicPlugin.hpp.
|
private |
Pointer to the plugin's argument parser, owned by the shared library.
Definition at line 93 of file DynamicPlugin.hpp.
|
private |
Smart pointer to plugin with custom deleter.
Definition at line 96 of file DynamicPlugin.hpp.