BALL::PluginManager Class Reference
#include <BALL/PLUGIN/pluginManager.h>
List of all members.
Detailed Description
A singleton that takes care of handling all plugins. It is responsible for loading, starting and stopping plugins. For the task of properly initializing the plugins it utilizes the PluginHandler helper classes, that need to be supplemented for each new plugin type.
Constructor & Destructor Documentation
virtual BALL::PluginManager::~PluginManager |
( |
|
) |
[virtual] |
BALL::PluginManager::PluginManager |
( |
|
) |
[protected] |
BALL::PluginManager::PluginManager |
( |
const PluginManager & |
|
) |
[protected] |
Member Function Documentation
void BALL::PluginManager::addPluginDirectory |
( |
const QString & |
dir, |
|
|
bool |
autoactivate = false | |
|
) |
| | |
Tries to load all plugins (files named like: pluginMyPlugin.$LIBRARY_SUFFIX) located in the specified directoy dir.
- Parameters:
-
| dir | the directory to search for plugins. |
int BALL::PluginManager::getPluginCount |
( |
|
) |
const |
Returns the number of loaded plugins.
vector<QString> BALL::PluginManager::getPluginDirectories |
( |
|
) |
const |
Return a list of directories currently searched for plugins.
QObject* BALL::PluginManager::getPluginInstance |
( |
int |
pos |
) |
|
Searches for the plugin and returns a pointer to it if it has been loaded.
- Parameters:
-
| pos | The position of the plugin in the plugin list |
- Returns:
- NULL if the plugin could not be found, a pointer to it otherwise
QObject* BALL::PluginManager::getPluginInstance |
( |
const QString & |
plugin |
) |
|
Searches for the plugin and returns a pointer to it if it has been loaded.
- Parameters:
-
| plugin | The name of the plugin to search |
- Returns:
- NULL if the plugin could not be found, a pointer to it otherwise
virtual bool BALL::PluginManager::getValue |
( |
String & |
|
) |
const [virtual] |
Use this method to obtain the PluginManager instance.
This method is thread safe.
BALLPlugin* BALL::PluginManager::loadPlugin |
( |
const QString & |
plugin_name |
) |
|
Loads the plugin specified by plugin_name.
- Parameters:
-
| plugin_name | The path to the plugin to load |
- Returns:
- NULL if the plugin could not be loaded. A valid pointer to the loaded plugin otherwise.
Register a new PluginHandler. This handler will then be available for starting new plugins.
bool BALL::PluginManager::removePluginDirectory |
( |
const QString & |
dir |
) |
|
Tries to unload all plugins (files named like: pluginMyPlugin.$LIBRARY_SUFFIX) located in the specified directoy dir.
- Parameters:
-
| dir | the directory to search for plugins to remove. |
virtual bool BALL::PluginManager::setValue |
( |
const String & |
|
) |
[virtual] |
Starts the specified plugin through a applicable PluginHandler
- Parameters:
-
| plugin | A pointer to the plugin to be started |
- Returns:
- false if no suitable handler could be found, true otherwise.
bool BALL::PluginManager::startPlugin |
( |
const QString & |
plugin |
) |
|
bool BALL::PluginManager::startPlugin |
( |
int |
plugin |
) |
|
Stops the specified plugin by letting all PluginHandlers stop it.
- Parameters:
-
| plugin | A pointer to the plugin to be stopped |
- Returns:
- false if one handler could not stop the plugin, true otherwise.
bool BALL::PluginManager::stopPlugin |
( |
const QString & |
plugin |
) |
|
bool BALL::PluginManager::stopPlugin |
( |
int |
plugin |
) |
|
void BALL::PluginManager::unloadAllPlugins |
( |
|
) |
|
Unload all registered plugins.
bool BALL::PluginManager::unloadPlugin |
( |
const QString & |
plugin |
) |
|
Unloads the plugin specified by plugin_name.
- Parameters:
-
| plugin_name | The name of the plugin to unload |
Member Data Documentation