Updraft  1.0
Open source glider flight visualisation tool.
Updraft::Core::PluginManager Class Reference

Top level object that handles plugin loading and operations. More...

#include <pluginmanager.h>

List of all members.

Classes

struct  LoadedPlugin
 Data belonging to a single loaded plugin. More...

Public Member Functions

 PluginManager ()
 Load all the plugins but don't create core interface for them and initialize them.
 ~PluginManager ()
PluginBasegetPlugin (const QString &name)
 Return pointer to plugin object.
QDir getPluginDir (const QString &name)
 Return directory with plugin data.
QVector< PluginBase * > getAllPlugins ()
 Return list of all loaded plugins.

Private Member Functions

PluginBaseload (const QString &fileName)
 Load the plugin, initialize it and put it to the list of loaded plugins.
PluginBasefinishLoading (QObject *obj, const QDir &dir)
 Create core interface, initialize plugin and place it in the list of loaded plugins.

Private Attributes

QMap< QString, LoadedPlugin * > plugins
 Associative map of plugin names to plugin pointers for fast lookup.

Detailed Description

Top level object that handles plugin loading and operations.


Constructor & Destructor Documentation

Load all the plugins but don't create core interface for them and initialize them.


Member Function Documentation

PluginBase* Updraft::Core::PluginManager::finishLoading ( QObject *  obj,
const QDir &  dir 
) [private]

Create core interface, initialize plugin and place it in the list of loaded plugins.

Logs a debug message about the reason of failure.

Returns:
Pointer to loaded plugin or NULL.
Parameters:
objLoaded plugin before casting to PluginBase. Can be NULL if loading failed (this will be logged).
dirsee the documentation of metho getPluginDir()
See also:
getPluginDir()

Return list of all loaded plugins.

Returns:
QVector with all the currently loaded plugins.

Return pointer to plugin object.

Parameters:
nameThe name of the plugin
Returns:
pointer to the desired plugin.
QDir Updraft::Core::PluginManager::getPluginDir ( const QString &  name)

Return directory with plugin data.

Parameters:
nameThe name of the plugin.
Returns:
The directory from which the plugin was loaded.
PluginBase * Updraft::Core::PluginManager::load ( const QString &  fileName) [private]

Load the plugin, initialize it and put it to the list of loaded plugins.

Parameters:
fileNameThe file name of the plugin that we want to load
Returns:
Pointer to the PluginBase object that represents the loaded instance of the plugin.

Member Data Documentation

Associative map of plugin names to plugin pointers for fast lookup.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines