Ring Daemon 16.0.0
|
This class manages plugin (un)loading. More...
#include <pluginmanager.h>
Public Member Functions | |
bool | checkLoadedPlugin (const std::string &rootPath) const |
Returns True if plugin is loaded. | |
std::vector< std::string > | getLoadedPlugins () const |
Returns vector with loaded plugins' libraries paths. | |
bool | load (const std::string &path) |
Load a dynamic plugin by filename. | |
PluginManager () | |
bool | registerComponentManager (const std::string &name, ComponentFunction &&takeOwnership, ComponentFunction &&destroyComponent) |
Registers a component manager that will have two functions, one to take ownership of the component and the other one to destroy it. | |
bool | registerObjectFactory (const char *type, const JAMI_PluginObjectFactory &factory) |
Function called from plugin implementation register a new object factory. | |
bool | registerService (const std::string &name, ServiceFunction &&func) |
Register a new service in the Plugin System. | |
bool | unload (const std::string &path) |
Unloads the plugin. | |
void | unRegisterService (const std::string &name) |
Unregister a service from the Plugin System. | |
~PluginManager () | |
This class manages plugin (un)loading.
Those process include: (1) plugin libraries (un)loading; (2) call plugin initial function; (3) handlers registration and destruction, and; (4) services registration.
Definition at line 41 of file pluginmanager.h.
jami::PluginManager::PluginManager | ( | ) |
Definition at line 25 of file pluginmanager.cpp.
References JAMI_PluginAPI::context.
jami::PluginManager::~PluginManager | ( | ) |
Definition at line 30 of file pluginmanager.cpp.
References jami::emitSignal(), and JAMI_ERR.
Returns True if plugin is loaded.
Definition at line 94 of file pluginmanager.cpp.
References jami::emitSignal().
Referenced by jami::JamiPluginManager::resetPluginPreferencesValuesMap(), jami::JamiPluginManager::setPluginPreference(), and jami::JamiPluginManager::uninstallPlugin().
std::vector< std::string > jami::PluginManager::getLoadedPlugins | ( | ) | const |
Returns vector with loaded plugins' libraries paths.
Definition at line 104 of file pluginmanager.cpp.
References jami::emitSignal().
Referenced by jami::JamiPluginManager::getLoadedPlugins().
Load a dynamic plugin by filename.
path | fully qualified pathname on a loadable plugin binary |
Definition at line 47 of file pluginmanager.cpp.
References jami::emitSignal(), JAMI_ERR, jami::Plugin::load(), and unload().
Referenced by jami::JamiPluginManager::loadPlugin().
bool jami::PluginManager::registerComponentManager | ( | const std::string & | name, |
ComponentFunction && | takeOwnership, | ||
ComponentFunction && | destroyComponent | ||
) |
Registers a component manager that will have two functions, one to take ownership of the component and the other one to destroy it.
name | name of the component manager |
takeOwnership | function that takes ownership on created objet in memory |
destroyComponent | destroy the component |
Definition at line 311 of file pluginmanager.cpp.
References jami::emitSignal().
bool jami::PluginManager::registerObjectFactory | ( | const char * | type, |
const JAMI_PluginObjectFactory & | factory | ||
) |
Function called from plugin implementation register a new object factory.
Note: type can be the string "*" meaning that the factory will be called if no exact match factories are found for a given type.
type | unique identifier of the object |
params | object factory details |
Definition at line 274 of file pluginmanager.cpp.
References JAMI_PluginVersion::abi, JAMI_PluginVersion::api, jami::emitSignal(), and JAMI_PluginAPI::version.
Register a new service in the Plugin System.
name | The service name |
func | The function that may be called by Ring_PluginAPI.invokeService |
Definition at line 217 of file pluginmanager.cpp.
References jami::emitSignal().
Unloads the plugin.
path |
Definition at line 79 of file pluginmanager.cpp.
References jami::emitSignal().
Referenced by load(), and jami::JamiPluginManager::unloadPlugin().
Unregister a service from the Plugin System.
name | The service name |
Definition at line 224 of file pluginmanager.cpp.