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

#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
 
PlugingetFirstPlugin () const
 
PlugingetNextPlugin () const
 
PlugingetPreviousPlugin () const
 
PlugingetCurrentPlugin () const
 
PlugingetPlugin (const string &name) const
 
tlp::StringList getPluginNames () const
 
tlp::StringList getPluginLibraryNames () const
 
Pluginoperator[] (const int &i)
 
bool hasLoadErrors () const
 
string getLoadErrors () const
 

Friends

ostream & operator<< (ostream &os, PluginManager &pm)
 

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

tlp::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.
tlp::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 * tlp::PluginManager::getCurrentPlugin ( ) const

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

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

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

Returns
string String holding plugin manager information
Plugin * tlp::PluginManager::getNextPlugin ( ) const

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 tlp::PluginManager::getNumberOfCategories ( ) const

Get number of plugin categories.

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

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

Get folder where plugins are loaded from

Returns
String containg current 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.

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

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

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

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

Returns
integer Returning number of succesfully loaded plugins
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

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

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

Returns
Boolean indicating success

Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
PluginManager pm 
)
friend

Output plugin information to a std ostream


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