|
plugin
2.1.3
Runtime plugin loader and Ed25519 DSO signing for C++ applications
|
Thread-safe catalog of plugins derived from the same base class. More...
#include <PluginCatalog.hh>
Collaboration diagram for plugin::PluginCatalog< Base >:Public Types | |
| using | key_type = std::string |
| using | mapped_type = Creator< Base > |
| using | container_type = std::map< key_type, mapped_type, std::less< key_type > > |
Public Member Functions | |
| PluginCatalog ()=default | |
| PluginCatalog (PluginCatalog const &other) | |
| PluginCatalog (PluginCatalog &&other) noexcept | |
| ~PluginCatalog ()=default | |
| PluginCatalog & | operator= (PluginCatalog const &other) |
| PluginCatalog & | operator= (PluginCatalog &&other) noexcept |
| void | insert (key_type const &key, mapped_type const &creator) |
| void | erase (key_type const &key) |
| std::unique_ptr< Base > | create (key_type const &key) |
| Create a plugin with the default (parameterless) constructor. More... | |
| std::unique_ptr< Base > | create (key_type const &key, std::any const &config) |
| Create a plugin with a type-erased config argument. More... | |
| bool | contains (key_type const &key) const |
| bool | empty () const |
| std::size_t | size () const |
| std::vector< std::string > | names (bool includeAliases=false) const |
Private Attributes | |
| container_type | entries_ |
| std::shared_mutex | mutex_ |
Thread-safe catalog of plugins derived from the same base class.
Supports both parameterless and config-based plugin creation.
| Base | The base class of the plugin hierarchy |
| using plugin::PluginCatalog< Base >::key_type = std::string |
| using plugin::PluginCatalog< Base >::mapped_type = Creator< Base > |
| using plugin::PluginCatalog< Base >::container_type = std::map< key_type, mapped_type, std::less< key_type > > |
|
default |
|
inline |
|
inlinenoexcept |
|
default |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
Create a plugin with the default (parameterless) constructor.
|
inline |
Create a plugin with a type-erased config argument.
| std::runtime_error | if the plugin has no config factory |
| std::bad_any_cast | if Config type doesn't match registration |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
mutableprivate |