This class is used to manage all plugins loaded by the application.
More...
#include <ExtensionManager.h>
This class is used to manage all plugins loaded by the application.
The current version is able to load dynamic library for
This class is a contained for all the loaded extension. It contains only static members.
describes the CamiTK Extension Type (Action, Component, Application...).
CamiTK follows Component-Based programming architecture. The Service Layer defines four types of extensions.
Enumerator |
---|
ACTION |
Action extensions: manages the processing logic.
|
COMPONENT |
Component extensions: manages the data logic.
|
APPLICATION |
MainWindow extensions: manages the application logic.
|
VIEWER |
Viewer extensions: manages the presentation and user interaction logic.
|
static void camitk::ExtensionManager::autoload |
( |
| ) |
|
|
static |
Autoload component and action extensions.
static void camitk::ExtensionManager::autoload |
( |
ExtensionType |
type | ) |
|
|
static |
Autoload all the extension of a given type.
This method try to load all the extensions of the given type that are found (in this specific order) :
- in the current working directory (considered as an install directory), this should be the build directory (load extensions that are just being compiled, before their installation
- in the user config directory (CamiTK user install)
- in the system-wide install (CamiTK global install)
- and in the list of user-registered extensions (stored in the configuration directory)
Duplicates found within the installation directory are removed (e.g. if you have the extension x.so in the build directory as well as the user directory, only the extension in the build directory will be loaded (it takes precedence).
- Parameters
-
static QMap<QString, ActionExtension*>& camitk::ExtensionManager::getActionExtensionMap |
( |
| ) |
|
|
staticprivate |
get the singleton map of loaded action plugins (the key is the shared object/dll/dylib filename) This is the private (intern) method.
The component extension map is updated by loadActionExtension, unloadActionExtension and autoloadActionExtensions. This method follows the "construct on first use" idiom/design-pattern. It therefore avoids the infamous "static initialization order fiasco", see http://www.parashift.com/c++-faq/ctors.html
static const QMap<QString, ActionExtension*>& camitk::ExtensionManager::getActionExtensions |
( |
| ) |
|
|
static |
get all the registered action extension (key is the share object/dll/dylib filename that contains the ActionExtension).
This is the public method (return a const, the extensions map is private and cannot be modified externally).
static const ComponentExtension* camitk::ExtensionManager::getComponentExtension |
( |
QString |
| ) |
|
|
static |
get the plugin corresponding to a given extension or name (const, you can only use this method to get information, use open to open a file using a specific plugin)
static QMap<QString, ComponentExtension*>& camitk::ExtensionManager::getComponentExtensionMap |
( |
| ) |
|
|
staticprivate |
get the singleton map of loaded component plugins for files (the key is the file extension) This is the private (intern) method.
The component extension map is updated by loadComponentExtension, unloadComponentExtension and autoloadComponentExtensions. This method follows the "construct on first use" idiom/design-pattern. It therefore avoids the infamous "static initialization order fiasco", see http://www.parashift.com/c++-faq/ctors.html
static const QMap<QString, ComponentExtension*>& camitk::ExtensionManager::getComponentExtensions |
( |
| ) |
|
|
static |
get all the registered component extensions that can manage file (default component extension) This is the public method (return a const, the extensions map is private and cannot be modified externally).
static QMap<QString, ComponentExtension*>& camitk::ExtensionManager::getDataDirectoryComponentExtensionMap |
( |
| ) |
|
|
staticprivate |
get the singleton map of loaded component plugins for data directory (the key is the name) This is the private (intern) method.
The data directory component extension map is updated by loadExtension, unloadExtension and autoloadExtensions. This method follows the "construct on first use" idiom/design-pattern. It therefore avoids the infamous "static initialization order fiasco", see http://www.parashift.com/c++-faq/ctors.html
static const QMap<QString, ComponentExtension*>& camitk::ExtensionManager::getDataDirectoryComponents |
( |
| ) |
|
|
static |
get all the registered component extensions that can manage entire directories This is the public method (return a const, the extensions map is private and cannot be modified externally).
static QStringList camitk::ExtensionManager::getDataDirectoryExtNames |
( |
| ) |
|
|
static |
get the list of all the name of the registered Component data directory
static QStringList camitk::ExtensionManager::getExtensionFilter |
( |
| ) |
|
|
staticprivate |
return the extensions file filter
static QStringList camitk::ExtensionManager::getFileExtensions |
( |
| ) |
|
|
static |
get the list of all the suffixes managed by registered component extensions (all possible file suffix)
static QString camitk::ExtensionManager::getInstallationString |
( |
QString |
file | ) |
|
|
static |
Returns a three char string that corresponds to the installation directory of a given extension.
It works for all type of extension.
The following string code are returned:
- [G] for an extension installed in the global installation directory (where CamiTK SDK is installed)
- [L] for an extension installed in the user configuration directory (local install)
- [W] for an extension loaded directly from the current working directory (build installation tree)
- [U] for an extension loaded manually by the user
- Returns
- the string coding for the installation
- Parameters
-
file | the extension plugin file |
static QStringList camitk::ExtensionManager::getPluginFileNames |
( |
QDir |
| ) |
|
|
staticprivate |
return the list of shared objects in a directory considering debug/release on MSVC
static bool camitk::ExtensionManager::loadExtension |
( |
ExtensionType |
type, |
|
|
QString |
file |
|
) |
| |
|
static |
Load a specific extension from a file.
This methods loads a ActionExtension, ComponentExtension,... plugin from a .dll/.so/.dylib filename
- Parameters
-
type | the extension type |
file | the plugin filename (.dll/.so/.dylib) |
- Returns
- false if it cannot be loaded
static bool camitk::ExtensionManager::promptRegisterFileExtensions |
( |
QStringList |
fileExtensions | ) |
|
|
static |
Prompt the user if he wants the current application to natively (by default) open the following file extensions.
- Parameters
-
fileExtensions | The list of file extensions (without the prefixed '.'). |
- Returns
- The decision of the user regarding the file association.
static void camitk::ExtensionManager::registerFileExtension |
( |
QString |
fileExtension | ) |
|
|
static |
Register the file extension with the current application for opening This function is called by registerFileExtensions.
- Parameters
-
fileExtension | the file extension to associate with the current application for opening |
static bool camitk::ExtensionManager::unloadActionExtension |
( |
QString |
| ) |
|
|
static |
Unload an action extension using its .dll/.so/.dylib filename.
- Returns
- false if the plugin could not be unloaded - still in use somewhere
static void camitk::ExtensionManager::unloadAllActionExtensions |
( |
| ) |
|
|
static |
unload all action extensions and delete instanciated actions
static bool camitk::ExtensionManager::unloadComponentExtension |
( |
QString |
| ) |
|
|
static |
Unload a plugin corresponding to a given extension or component name.
- Returns
- false if the plugin could not be unloaded - still in use somewhere
The documentation for this class was generated from the following file: