Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::PluginManager Class Reference

This class manages plugin (un)loading. More...

#include <pluginmanager.h>

Collaboration diagram for jami::PluginManager:
Collaboration graph

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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PluginManager()

jami::PluginManager::PluginManager ( )

Definition at line 25 of file pluginmanager.cpp.

References JAMI_PluginAPI::context.

◆ ~PluginManager()

jami::PluginManager::~PluginManager ( )

Definition at line 30 of file pluginmanager.cpp.

References jami::emitSignal(), and JAMI_ERR.

Here is the call graph for this function:

Member Function Documentation

◆ checkLoadedPlugin()

bool jami::PluginManager::checkLoadedPlugin ( const std::string &  rootPath) const

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().

Here is the call graph for this function:

◆ getLoadedPlugins()

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().

Here is the call graph for this function:

◆ load()

bool jami::PluginManager::load ( const std::string &  path)

Load a dynamic plugin by filename.

Parameters
pathfully qualified pathname on a loadable plugin binary
Returns
True if success

Definition at line 47 of file pluginmanager.cpp.

References jami::emitSignal(), JAMI_ERR, jami::Plugin::load(), and unload().

Referenced by jami::JamiPluginManager::loadPlugin().

Here is the call graph for this function:

◆ registerComponentManager()

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.

Parameters
namename of the component manager
takeOwnershipfunction that takes ownership on created objet in memory
destroyComponentdestroy the component
Returns
True if success

Definition at line 311 of file pluginmanager.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ registerObjectFactory()

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.

Parameters
typeunique identifier of the object
paramsobject factory details
Returns
True if success

Definition at line 274 of file pluginmanager.cpp.

References JAMI_PluginVersion::abi, JAMI_PluginVersion::api, jami::emitSignal(), and JAMI_PluginAPI::version.

Here is the call graph for this function:

◆ registerService()

bool jami::PluginManager::registerService ( const std::string &  name,
ServiceFunction &&  func 
)

Register a new service in the Plugin System.

Parameters
nameThe service name
funcThe function that may be called by Ring_PluginAPI.invokeService
Returns
True if success

Definition at line 217 of file pluginmanager.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ unload()

bool jami::PluginManager::unload ( const std::string &  path)

Unloads the plugin.

Parameters
path
Returns
True if success

Definition at line 79 of file pluginmanager.cpp.

References jami::emitSignal().

Referenced by load(), and jami::JamiPluginManager::unloadPlugin().

Here is the call graph for this function:

◆ unRegisterService()

void jami::PluginManager::unRegisterService ( const std::string &  name)

Unregister a service from the Plugin System.

Parameters
nameThe service name

Definition at line 224 of file pluginmanager.cpp.


The documentation for this class was generated from the following files: