Thea
Public Member Functions | List of all members
PluginManager Class Reference

Manages set of installed plugins (static or dynamic). More...

#include <IPlugin.hpp>

Inheritance diagram for PluginManager:
IFactoryRegistry

Public Member Functions

void addEigenSolverFactory (char const *name, Algorithms::IEigenSolverFactory *factory)
 Register an eigensolver factory. More...
 
void addLinearSolverFactory (char const *name, Algorithms::ILinearSolverFactory *factory)
 Register a linear solver factory. More...
 
void addNumericalOptimizerFactory (char const *name, Algorithms::INumericalOptimizerFactory *factory)
 Register a numerical optimizer factory. More...
 
void addRenderSystemFactory (char const *name, Graphics::IRenderSystemFactory *factory)
 Register a rendersystem factory. More...
 
void install (IPlugin *plugin)
 Install a new plugin. More...
 
IPluginload (std::string const &path)
 Load a dynamically linked plugin from a path. More...
 
void removeEigenSolverFactory (char const *name)
 Unregister an eigensolver factory. More...
 
void removeLinearSolverFactory (char const *name)
 Unregister a linear solver factory. More...
 
void removeNumericalOptimizerFactory (char const *name)
 Unregister a numerical optimizer factory. More...
 
void removeRenderSystemFactory (char const *name)
 Unregister a rendersystem factory. More...
 
void shutdownAllPlugins ()
 Execute the shutdown() routine of all plugins, in the reverse of the order in which they were installed. More...
 
void startupAllPlugins ()
 Execute the startup() routine of all plugins, in the order in which they were installed. More...
 
void uninstall (IPlugin *plugin)
 Uninstall a plugin. More...
 
void unload (std::string const &path)
 Unload a dynamically linked plugin, using the same path specified to load() it. More...
 
void unloadAllPlugins ()
 Unload/uninstall plugins. More...
 
 ~PluginManager ()
 Destructor. More...
 

Detailed Description

Manages set of installed plugins (static or dynamic).

There should be exactly one active PluginManager per application.

Definition at line 127 of file IPlugin.hpp.

Constructor & Destructor Documentation

Destructor.

Definition at line 28 of file IPlugin.cpp.

Member Function Documentation

void addEigenSolverFactory ( char const *  name,
Algorithms::IEigenSolverFactory factory 
)
virtual

Register an eigensolver factory.

Implements IFactoryRegistry.

Definition at line 177 of file IPlugin.cpp.

void addLinearSolverFactory ( char const *  name,
Algorithms::ILinearSolverFactory factory 
)
virtual

Register a linear solver factory.

Implements IFactoryRegistry.

Definition at line 189 of file IPlugin.cpp.

void addNumericalOptimizerFactory ( char const *  name,
Algorithms::INumericalOptimizerFactory factory 
)
virtual

Register a numerical optimizer factory.

Implements IFactoryRegistry.

Definition at line 213 of file IPlugin.cpp.

void addRenderSystemFactory ( char const *  name,
Graphics::IRenderSystemFactory factory 
)
virtual

Register a rendersystem factory.

Implements IFactoryRegistry.

Definition at line 201 of file IPlugin.cpp.

void install ( IPlugin plugin)

Install a new plugin.

The plugin is registered with the manager and its install() function called.

Note
Do not use this function to install plugins from dynamic libraries: use load() instead.
Parameters
pluginA pointer to the plugin to be installed, which should not be null.
See also
uninstall()

Definition at line 129 of file IPlugin.cpp.

IPlugin * load ( std::string const &  path)

Load a dynamically linked plugin from a path.

The plugin will be automatically installed via install().

Returns
A pointer to the new or previously loaded plugin on success, nullptr on failure.
See also
unload()

Definition at line 34 of file IPlugin.cpp.

void removeEigenSolverFactory ( char const *  name)
virtual

Unregister an eigensolver factory.

Implements IFactoryRegistry.

Definition at line 183 of file IPlugin.cpp.

void removeLinearSolverFactory ( char const *  name)
virtual

Unregister a linear solver factory.

Implements IFactoryRegistry.

Definition at line 195 of file IPlugin.cpp.

void removeNumericalOptimizerFactory ( char const *  name)
virtual

Unregister a numerical optimizer factory.

Implements IFactoryRegistry.

Definition at line 219 of file IPlugin.cpp.

void removeRenderSystemFactory ( char const *  name)
virtual

Unregister a rendersystem factory.

Implements IFactoryRegistry.

Definition at line 207 of file IPlugin.cpp.

void shutdownAllPlugins ( )

Execute the shutdown() routine of all plugins, in the reverse of the order in which they were installed.

Definition at line 86 of file IPlugin.cpp.

void startupAllPlugins ( )

Execute the startup() routine of all plugins, in the order in which they were installed.

Definition at line 79 of file IPlugin.cpp.

void uninstall ( IPlugin plugin)

Uninstall a plugin.

The plugin is deregistered from the manager and its uninstall() function called.

Note
Do not use this function to uninstall plugins from dynamic libraries: use unload() instead.
Parameters
pluginA pointer to the plugin to be uninstalled.
See also
install()

Definition at line 154 of file IPlugin.cpp.

void unload ( std::string const &  path)

Unload a dynamically linked plugin, using the same path specified to load() it.

The plugin will be automatically uninstalled via uninstall().

Warning
This does not call the plugin's shutdown() routine, so be sure to call it explicitly before calling this function.
See also
load()

Definition at line 57 of file IPlugin.cpp.

void unloadAllPlugins ( )

Unload/uninstall plugins.

This will initially call shutdownAllPlugins(), so if you want to shutdown the plugins in an order other than the reverse of the installation order, you should do it manually before calling this function.

Definition at line 93 of file IPlugin.cpp.


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