This class is used to manage all plugins loaded by the application. More...
#include <ExtensionManager.h>
Inheritance diagram for camitk::ExtensionManager:
Collaboration diagram for camitk::ExtensionManager:Public Types | |
| enum | ExtensionType { ACTION , COMPONENT , APPLICATION , VIEWER } |
| describes the CamiTK Extension Type (Action, Component, Application...). More... | |
| enum | InstallationRepository { GLOBAL , LOCAL , WORKING_DIRECTORY , USER , NOT_REGISTERED } |
| corresponds to where the extension is installed More... | |
Static Public Member Functions | |
| static void | autoload () |
| Autoload component, action and viewer extensions (dlls) as well as registered CamiTK extension file. | |
| static void | autoload (ExtensionType type) |
| Autoload all the extension of a given type. | |
| static InstallationRepository | getInstallationRepository (const QString &extensionName) |
| Returns the enum corresponding to the installation repository (directory) of a given shared library. | |
| static QString | getInstallationString (QString file, const QString &globalInstallDir, const QString &userInstallDir, const QString ¤tWorkingDir) |
| Returns a three char string that corresponds to the installation directory of a given shared library. | |
| static bool | loadExtension (ExtensionType type, QString file) |
| Load a specific extension from a file. | |
| static bool | registerNewComponentExtension (ComponentExtension *ce, QString filename=QString()) |
| Register the given ComponentExtension. | |
Component extension list management | |
| static ComponentExtension * | getComponentExtension (QString) |
| get the plugin corresponding to a given extension or name. | |
| static const QList< ComponentExtension * > | getComponentExtensionsList () |
| Get the list of registered ComponentExtension. | |
| static ComponentExtension * | getDataDirectoryComponentExtension (QString) |
| get the plugin corresponding to a given data directory component extension's name. | |
| static const QList< ComponentExtension * > | getDataDirectoryComponentsList () |
| Get the list of registered ComponentExtension working on directory. | |
| static QStringList | getFileExtensions () |
| get the list of all the suffixes managed by registered component extensions (all possible file suffix) | |
| static QStringList | getDataDirectoryExtNames () |
| get the list of all the name of the registered Component data directory | |
| static void | registerFileExtension (QString fileExtension) |
| Register the file extension with the current application for opening This function is called by registerFileExtensions. | |
| static bool | unloadComponentExtension (QString) |
| Unload a plugin corresponding to a given extension or component name. | |
Action extension list management | |
| static void | unloadAllActionExtensions () |
| unload all action extensions and delete instantiated actions | |
| static const QList< ActionExtension * > | getActionExtensionsList () |
| Get the list of registered ActionExtension. | |
| static ActionExtension * | getActionExtension (QString) |
| Get the ActionExtension corresponding to the given shared library file. | |
| static bool | unloadActionExtension (QString) |
| Unload an action extension using its .dll/.so/.dylib filename. | |
Viewer extension list management | |
| static void | unloadAllViewerExtensions () |
| unload all viewer extensions and delete instantiated actions | |
| static const QList< ViewerExtension * > | getViewerExtensionsList () |
| Get the list of registered ViewerExtension. | |
| static ViewerExtension * | getViewerExtension (QString) |
| Get the Viewer Extension corresponding to the given shared library file. | |
| static bool | unloadViewerExtension (QString) |
| Unload an viewer extension using its .dll/.so/.dylib filename. | |
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. |
corresponds to where the extension is installed
|
static |
Autoload component, action and viewer extensions (dlls) as well as registered CamiTK extension file.
References ACTION, autoload(), COMPONENT, camitk::Application::setProgressBarValue(), camitk::Application::showStatusBarMessage(), and VIEWER.
Referenced by camitk::Application::Application(), autoload(), and main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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) :
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).
| type | the extension type |
References ACTION, CAMITK_ERROR_ALT, CAMITK_TRACE_ALT, COMPONENT, camitk::Core::getActionDirectories(), camitk::Core::getComponentDirectories(), camitk::Application::getSettings(), camitk::Core::getViewerDirectories(), loadExtension(), and VIEWER.
Here is the call graph for this function:
|
static |
Get the ActionExtension corresponding to the given shared library file.
If the given shared library is not loaded return nullptr. The shared library file should be given as a complete filepath in the QString.
|
static |
Get the list of registered ActionExtension.
The list contains unique elements (no duplicates possible) and is alphabetically sorted.
Referenced by camitk::Core::getConfig(), camitk::Core::getConfigAsJson(), and getInstallationRepository().
Here is the caller graph for this function:
|
static |
get the plugin corresponding to a given extension or name.
Referenced by SaveAsAction::apply(), camitk::Application::open(), and camitk::Application::save().
Here is the caller graph for this function:
|
static |
Get the list of registered ComponentExtension.
The list contains unique elements (no duplicates possible) and is alphabetically sorted.
Referenced by OpenAction::apply(), SaveAsAction::apply(), camitk::Core::getConfig(), camitk::Core::getConfigAsJson(), camitk::ImageAcquisitionComponentExtension::getImagerList(), camitk::ImageAcquisitionComponentExtension::getInstance(), main(), and OpenFile::selectFile().
Here is the caller graph for this function:
|
static |
get the plugin corresponding to a given data directory component extension's name.
Referenced by camitk::Application::openDirectory().
Here is the caller graph for this function:
|
static |
Get the list of registered ComponentExtension working on directory.
The list contains unique elements (no duplicates possible) and is alphabetically sorted.
Referenced by camitk::Core::getConfig(), and camitk::Core::getConfigAsJson().
Here is the caller graph for this function:
|
static |
get the list of all the name of the registered Component data directory
Referenced by SaveAsAction::apply(), and ImpMainWindow::updateOpenDirectoryMenu().
Here is the caller graph for this function:
|
static |
get the list of all the suffixes managed by registered component extensions (all possible file suffix)
Referenced by camitk::Application::Application(), OpenAction::apply(), and OpenFile::selectFile().
Here is the caller graph for this function:
|
static |
Returns the enum corresponding to the installation repository (directory) of a given shared library.
The shared library should be the name corresponding to the value of getName() of an existing ComponentExtension, ActionExtension or ViewerExtension.
The following string code are returned:
| extensionName | the extension plugin name (i.e. the extension getName() value) |
References getActionExtensionsList(), camitk::Core::getCurrentWorkingDir(), camitk::Core::getGlobalInstallDir(), getInstallationString(), camitk::Core::getUserInstallDir(), GLOBAL, LOCAL, NOT_REGISTERED, USER, and WORKING_DIRECTORY.
Here is the call graph for this function:
|
static |
Returns a three char string that corresponds to the installation directory of a given shared library.
The shared library should be the complete/fullpath filename corresponding to a component, action or viewer extension.
The following enum value is returned:
| file | the extension plugin file |
| globalInstallDir | the global installation directory |
| userInstallDir | the user installation directory |
| currentWorkingDir | the current working directory |
References camitk::Core::libDir().
Referenced by camitk::Core::getConfig(), camitk::Core::getConfigAsJson(), and getInstallationRepository().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Get the Viewer Extension corresponding to the given shared library file.
If the given shared library is not loaded return nullptr. The shared library file should be given as a complete filepath in the QString.
|
static |
Get the list of registered ViewerExtension.
The list contains unique elements (no duplicates possible) and is alphabetically sorted.
Referenced by camitk::Core::getConfig(), camitk::Core::getConfigAsJson(), camitk::Application::getNewViewer(), and loadExtension().
Here is the caller graph for this function:
|
static |
Load a specific extension from a file.
This methods loads a ActionExtension, ComponentExtension,... plugin from a .dll/.so/.dylib filename
| type | the extension type |
| file | the plugin filename (.dll/.so/.dylib) |
References ACTION, CAMITK_INFO_ALT, CAMITK_TRACE_ALT, COMPONENT, camitk::Core::getGlobalInstallDir(), camitk::ViewerExtension::getName(), camitk::ViewerExtension::getViewerClassName(), getViewerExtensionsList(), camitk::ActionExtension::init(), camitk::ViewerExtension::init(), camitk::ActionExtension::initResources(), camitk::ViewerExtension::initResources(), camitk::Core::libDir(), camitk::Application::registerAllActions(), camitk::Application::registerAllViewers(), registerNewComponentExtension(), camitk::ActionExtension::setLocation(), camitk::ViewerExtension::setLocation(), camitk::Core::shortVersion(), and VIEWER.
Referenced by autoload(), and main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Register the file extension with the current application for opening This function is called by registerFileExtensions.
| fileExtension | the file extension to associate with the current application for opening |
Referenced by camitk::Application::Application().
Here is the caller graph for this function:
|
static |
Register the given ComponentExtension.
If the given ComponentExtension is managing file extensions that are already registered, it will not be registered, and this method will return false and a info message will be printed with more information.
| ce | valid ComponentExtension pointer (loaded from a shared library plugin (.dll/.so/.dylib) or instantiated programmatically) |
| filename | (optional) if the extension was loaded from a shared library (.dll/.so/.dylib), path to this file |
References CAMITK_INFO_ALT, camitk::ComponentExtension::getFileExtensions(), camitk::ComponentExtension::getLocation(), camitk::ComponentExtension::getName(), camitk::ComponentExtension::hasDataDirectory(), camitk::ComponentExtension::initResources(), and camitk::ComponentExtension::setLocation().
Referenced by loadExtension().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Unload an action extension using its .dll/.so/.dylib filename.
References camitk::Application::unregisterAllActions().
Referenced by unloadAllActionExtensions().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
unload all action extensions and delete instantiated actions
References unloadActionExtension().
Here is the call graph for this function:
|
static |
unload all viewer extensions and delete instantiated actions
|
static |
Unload a plugin corresponding to a given extension or component name.
References camitk::ComponentExtension::getLocation(), and unloadComponentExtension().
Referenced by unloadComponentExtension().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Unload an viewer extension using its .dll/.so/.dylib filename.
References camitk::Application::unregisterAllViewers().
Here is the call graph for this function: