PluginLoader Class Reference

Classes

class  Plugin
 

Public Member Functions

void clearPlugins ()
 Clears the plugins list.
 
EnginePlugininfo (int pluginIndex) const
 Convenience method - calls Plugin::info() for specified plugin.
 
void initConfig ()
 Inits configuration for plugins.
 
unsigned int numPlugins () const
 Gets the number of loaded plugins.
 
const Pluginoperator[] (unsigned int index) const
 Returns the requested plugin or nullptr.
 
const Pluginplugin (unsigned int index) const
 Returns the requested plugin or nullptr.
 
int pluginIndexFromName (const QString &name) const
 Looks for a plugin which name equals to parameter.
 
const QList< Plugin * > & plugins () const
 
void resetPluginsDirectory (const QString &pluginsDirectory)
 Resets the plugins directory, clearing the loaded plugins and getting new loaded plugins in the process.
 

Static Public Member Functions

static void deinit ()
 Destroys the init() instance.
 
static void init (const QStringList &directories)
 Attempts to load plugins from given set of directories.
 
static PluginLoaderinstance ()
 Accesses instance of the class after init().
 

Detailed Description

Definition at line 37 of file pluginloader.h.

Member Function Documentation

void PluginLoader::clearPlugins ( )

Clears the plugins list.

Definition at line 181 of file pluginloader.cpp.

void PluginLoader::deinit ( )
static

Destroys the init() instance.

Definition at line 187 of file pluginloader.cpp.

EnginePlugin * PluginLoader::info ( int  pluginIndex) const

Convenience method - calls Plugin::info() for specified plugin.

Returns
nullptr can be returned if plugin with given index is not present.

Definition at line 221 of file pluginloader.cpp.

void PluginLoader::init ( const QStringList &  directories)
static

Attempts to load plugins from given set of directories.

PluginLoader will step through directory in listed order. If a directory with at least one valid plugin is encountered, the loading process stops and skips all further directories.

This behavior may need to be revised and changed in the future.

Definition at line 231 of file pluginloader.cpp.

void PluginLoader::initConfig ( )

Inits configuration for plugins.

Definition at line 242 of file pluginloader.cpp.

PluginLoader * PluginLoader::instance ( )
static

Accesses instance of the class after init().

This isn't a real singleton. Call init() before calling this. gpPluginLoader and gPluginLoader macros can also be used to access the instance.

Definition at line 250 of file pluginloader.cpp.

unsigned int PluginLoader::numPlugins ( ) const

Gets the number of loaded plugins.

It will return 0 in safe mode.

Definition at line 256 of file pluginloader.cpp.

const PluginLoader::Plugin * PluginLoader::operator[] ( unsigned int  index) const

Returns the requested plugin or nullptr.

Definition at line 301 of file pluginloader.cpp.

const PluginLoader::Plugin * PluginLoader::plugin ( unsigned int  index) const

Returns the requested plugin or nullptr.

Definition at line 266 of file pluginloader.cpp.

int PluginLoader::pluginIndexFromName ( const QString &  name) const

Looks for a plugin which name equals to parameter.

Parameters
nameName to look for.
Returns
index of found plugin in the plugin array, or -1 if not found.

Definition at line 271 of file pluginloader.cpp.

void PluginLoader::resetPluginsDirectory ( const QString &  pluginsDirectory)

Resets the plugins directory, clearing the loaded plugins and getting new loaded plugins in the process.

Definition at line 294 of file pluginloader.cpp.


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