#include <telPluginManager.h>
Public Member Functions | |
PluginManager (const string &pluginFolder=gEmptyString) | |
virtual | ~PluginManager () |
string | getInfo () const |
bool | setPluginDir (const string &dir) |
string | getPluginDir () const |
int | load (const string &pluginName=gEmptyString) |
bool | unload (Plugin *plugin=NULL) |
int | getNumberOfPlugins () const |
int | getNumberOfCategories () const |
Plugin * | getFirstPlugin () const |
Plugin * | getNextPlugin () const |
Plugin * | getPreviousPlugin () const |
Plugin * | getCurrentPlugin () const |
Plugin * | getPlugin (const string &name) const |
tlp::StringList | getPluginNames () const |
tlp::StringList | getPluginLibraryNames () const |
Plugin * | operator[] (const int &i) |
bool | hasLoadErrors () const |
string | getLoadErrors () const |
Friends | |
ostream & | operator<< (ostream &os, PluginManager &pm) |
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.
tlp::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 * tlp::PluginManager::getCurrentPlugin | ( | ) | const |
Retrieves the "current" plugin in the managers internal plugin container.
Plugin * tlp::PluginManager::getFirstPlugin | ( | ) | const |
Retrieves the "first" plugin in the managers internal plugin container.
string tlp::PluginManager::getInfo | ( | ) | const |
Get information about the current plugin manager object, such as number of plugins loaded, their names and where they are loaded from
Plugin * tlp::PluginManager::getNextPlugin | ( | ) | const |
Retrieves the "next" plugin in the managers internal plugin container.
int tlp::PluginManager::getNumberOfCategories | ( | ) | const |
Get number of plugin categories.
int tlp::PluginManager::getNumberOfPlugins | ( | ) | const |
Get number of loaded plugins.
Plugin * tlp::PluginManager::getPlugin | ( | const string & | name) | const |
Retrieves a plugin with name as supplied in the argument.
string tlp::PluginManager::getPluginDir | ( | ) | const |
Get folder where plugins are loaded from
StringList tlp::PluginManager::getPluginLibraryNames | ( | ) | const |
Retrieves the shared library names of all loaded plugins as a list of strings.
StringList tlp::PluginManager::getPluginNames | ( | ) | const |
Retrieves the names of all loaded plugins as a list of strings.
Plugin * tlp::PluginManager::getPreviousPlugin | ( | ) | const |
Retrieves the "previous" plugin in the managers internal plugin container.
int tlp::PluginManager::load | ( | const string & | pluginName = gEmptyString ) |
Load a specific plugin, or, if no argument supplied, loads ALL plugins in the current plugin folder.
Plugin * tlp::PluginManager::operator[] | ( | const int & | i) |
Access a plugin using the [] operator.
bool tlp::PluginManager::setPluginDir | ( | const string & | dir) |
Change the directory where the Manager loads plugins
dir | Folder to load plugins from |
bool tlp::PluginManager::unload | ( | Plugin * | plugin = NULL ) |
Unload a specific plugin, or, if no argument supplied, unloads ALL plugins.
|
friend |
Output plugin information to a std ostream