#include <rrPluginManager.h>
Public Member Functions | |
PluginManager (const string &pluginFolder=gEmptyString) | |
virtual | ~PluginManager () |
bool | setPluginDir (const string &dir) |
string | getPluginDir () |
bool | load (const string &pluginName=gEmptyString) |
bool | unload (Plugin *plugin=NULL) |
int | getNumberOfPlugins () |
int | getNumberOfCategories () |
Plugin * | getFirstPlugin () |
Plugin * | getNextPlugin () |
Plugin * | getPreviousPlugin () |
Plugin * | getCurrentPlugin () |
Plugin * | getPlugin (const string &name) |
StringList | getPluginNames () |
StringList | getPluginLibraryNames () |
The PluginManager class is responsible for loading and unloading plugins. Each plugin is validated and categorized during the load process. A plugin that don't pass validation will not be loaded.
The plugin manager provide various functions to assist a client in retrieving plugins from the manager, e.g. getFirstPlugin, getNextPlugin, getPreviousPlugin or getPlugin(name).
Plugins are by default placed in a Plugins folder, found in RoadRunners install folder.
rrp::PluginManager::PluginManager | ( | const string & | pluginFolder = gEmptyString | ) |
|
virtual |
The destructor of a Plugin manager will free any memory allocated and also unload any plugins that it loaded.
Plugin * rrp::PluginManager::getCurrentPlugin | ( | ) |
Retrieves the "current" plugin in the managers internal plugin container.
Plugin * rrp::PluginManager::getFirstPlugin | ( | ) |
Retrieves the "first" plugin in the managers internal plugin container.
Plugin * rrp::PluginManager::getNextPlugin | ( | ) |
Retrieves the "next" plugin in the managers internal plugin container.
int rrp::PluginManager::getNumberOfCategories | ( | ) |
Get number of plugin categories.
int rrp::PluginManager::getNumberOfPlugins | ( | ) |
Get number of loaded plugins.
Plugin * rrp::PluginManager::getPlugin | ( | const string & | name | ) |
Retrieves a plugin with name as supplied in the argument.
string rrp::PluginManager::getPluginDir | ( | ) |
Get folder where plugins are loaded from
StringList rrp::PluginManager::getPluginLibraryNames | ( | ) |
Retrieves the shared library names of all loaded plugins as a list of strings.
StringList rrp::PluginManager::getPluginNames | ( | ) |
Retrieves the names of all loaded plugins as a list of strings.
Plugin * rrp::PluginManager::getPreviousPlugin | ( | ) |
Retrieves the "previous" plugin in the managers internal plugin container.
bool rrp::PluginManager::load | ( | const string & | pluginName = gEmptyString | ) |
Load a specific plugin, or, if no argument supplied, loads ALL plugins in the current plugin folder.
bool rrp::PluginManager::setPluginDir | ( | const string & | dir | ) |
Change the directory where the Manager loads plugins
dir | Folder to load plugins from |
bool rrp::PluginManager::unload | ( | Plugin * | plugin = NULL | ) |
Unload a specific plugin, or, if no argument supplied, unloads ALL plugins.