libRoadRunner Plugin C++ API  1.0.0
 All Classes Files Functions Variables Friends Pages
Public Member Functions | List of all members
rrp::PluginManager Class Reference

#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 ()
 
PlugingetFirstPlugin ()
 
PlugingetNextPlugin ()
 
PlugingetPreviousPlugin ()
 
PlugingetCurrentPlugin ()
 
PlugingetPlugin (const string &name)
 
StringList getPluginNames ()
 
StringList getPluginLibraryNames ()
 

Detailed Description

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.

Constructor & Destructor Documentation

rrp::PluginManager::PluginManager ( const string &  pluginFolder = gEmptyString)

The constructor of a Plugin manager creates a Plugin manager instance.

Parameters
pluginFolderFolder where the plugin manager is looking for plugins. If argument is not supplied, the manager will use the default folder, which is "plugins" located in RoadRunners install folder.
rrp::PluginManager::~PluginManager ( )
virtual

The destructor of a Plugin manager will free any memory allocated and also unload any plugins that it loaded.

Member Function Documentation

Plugin * rrp::PluginManager::getCurrentPlugin ( )

Retrieves the "current" plugin in the managers internal plugin container.

Returns
Pointer to a Plugin, or NULL.
Plugin * rrp::PluginManager::getFirstPlugin ( )

Retrieves the "first" plugin in the managers internal plugin container.

Returns
Pointer to a Plugin, or NULL.
Note
This function resets the managers internal plugin iterator to point at the "first" plugin.
Plugin * rrp::PluginManager::getNextPlugin ( )

Retrieves the "next" plugin in the managers internal plugin container.

Returns
Pointer to a Plugin, or NULL.
Note
This function advances the managers internal plugin iterator one step forward.
int rrp::PluginManager::getNumberOfCategories ( )

Get number of plugin categories.

Note
Not implemented
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.

  • name Name of the plugin.
    Returns
    Pointer to a Plugin, or NULL.
string rrp::PluginManager::getPluginDir ( )

Get folder where plugins are loaded from

Returns
String containg current folder where plugins are loaded from
StringList rrp::PluginManager::getPluginLibraryNames ( )

Retrieves the shared library names of all loaded plugins as a list of strings.

Returns
StringList A Stringlist containing the file name of each loaded Plugin.
StringList rrp::PluginManager::getPluginNames ( )

Retrieves the names of all loaded plugins as a list of strings.

Returns
StringList A Stringlist containing the name of each loaded Plugin.
Plugin * rrp::PluginManager::getPreviousPlugin ( )

Retrieves the "previous" plugin in the managers internal plugin container.

Returns
Pointer to a Plugin, or NULL.
Note
This function decerements the managers internal plugin iterator one step back.
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.

Returns
Boolean indicating success
bool rrp::PluginManager::setPluginDir ( const string &  dir)

Change the directory where the Manager loads plugins

Parameters
dirFolder to load plugins from
Returns
Boolean indicating if folder is valid or not
bool rrp::PluginManager::unload ( Plugin plugin = NULL)

Unload a specific plugin, or, if no argument supplied, unloads ALL plugins.

Returns
Boolean indicating success

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