|
plugin
2.1.3
Runtime plugin loader and Ed25519 DSO signing for C++ applications
|
Base class template for the plugin system. More...
#include <Plugin.hh>
Public Types | |
| using | key_type = typename PluginCatalog< Base >::key_type |
Public Member Functions | |
| Plugin ()=default | |
| Plugin (Plugin< Base > const &)=default | |
| Plugin (Plugin< Base > &&)=default | |
| Plugin< Base > & | operator= (Plugin< Base > const &)=default |
| Plugin< Base > & | operator= (Plugin< Base > &&)=default |
| virtual | ~Plugin ()=default |
Static Public Member Functions | |
| static std::unique_ptr< Base > | create (key_type const &key) |
| Create a plugin instance using the default constructor. More... | |
| template<typename Config > | |
| static std::unique_ptr< Base > | create (key_type const &key, Config const &config) |
| Create a plugin instance with a config object. More... | |
| static void | load (std::string const &sharedObjectName) |
| static PluginCatalog< Base > & | catalog () |
Base class template for the plugin system.
Provides two create() overloads:
Usage: auto shape = Shape::create("Circle"); // default ctor auto shape2 = Shape::create("Circle", Circle::Config{5}); // with config
| Base | The concrete base class of the plugin hierarchy |
| using plugin::Plugin< Base >::key_type = typename PluginCatalog< Base >::key_type |
|
default |
|
default |
|
default |
|
virtualdefault |
|
default |
|
default |
|
inlinestatic |
Create a plugin instance using the default constructor.
|
inlinestatic |
Create a plugin instance with a config object.
The Config type is automatically wrapped in std::any. It must match the type registered via REGISTER_WITH_CONFIG.
| Config | The concrete config struct (deduced) |
| key | Registered plugin name |
| config | Config object forwarded to the plugin constructor |
| std::runtime_error | if the plugin has no config factory |
| std::bad_any_cast | if Config doesn't match registration |
|
inlinestatic |
|
static |