This class is used to manage all plugins loaded by the application. More...
#include <ExtensionManager.h>
Public Types | |
enum | ExtensionType { ACTION , COMPONENT , APPLICATION , VIEWER } |
describes the CamiTK Extension Type (Action, Component, Application...). More... | |
Static Public Member Functions | |
static void | autoload () |
Autoload component and action extensions. More... | |
static void | autoload (ExtensionType type) |
Autoload all the extension of a given type. More... | |
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. More... | |
static bool | loadExtension (ExtensionType type, QString file) |
Load a specific extension from a file. More... | |
Component extension list management | |
static ComponentExtension * | getComponentExtension (QString) |
get the plugin corresponding to a given extension or name. More... | |
static const QList< ComponentExtension * > | getComponentExtensionsList () |
Get the list of registered ComponentExtension. More... | |
static ComponentExtension * | getDataDirectoryComponentExtension (QString) |
get the plugin corresponding to a given data directory component extension's name. More... | |
static const QList< ComponentExtension * > | getDataDirectoryComponentsList () |
Get the list of registered ComponentExtension working on directory. More... | |
static QStringList | getFileExtensions () |
get the list of all the suffixes managed by registered component extensions (all possible file suffix) More... | |
static QStringList | getDataDirectoryExtNames () |
get the list of all the name of the registered Component data directory More... | |
static void | registerFileExtension (QString fileExtension) |
Register the file extension with the current application for opening This function is called by registerFileExtensions. More... | |
static bool | unloadComponentExtension (QString) |
Unload a plugin corresponding to a given extension or component name. More... | |
Action extension list management | |
static void | unloadAllActionExtensions () |
unload all action extensions and delete instantiated actions More... | |
static const QList< ActionExtension * > | getActionExtensionsList () |
Get the list of registered ActionExtension. More... | |
static ActionExtension * | getActionExtension (QString) |
Get the ActionExtension corresponding to the given shared library file. More... | |
static bool | unloadActionExtension (QString) |
Unload an action extension using its .dll/.so/.dylib filename. More... | |
Viewer extension list management | |
static void | unloadAllViewerExtensions () |
unload all viewer extensions and delete instantiated actions More... | |
static const QList< ViewerExtension * > | getViewerExtensionsList () |
Get the list of registered ViewerExtension. More... | |
static ViewerExtension * | getViewerExtension (QString) |
Get the Viewer Extension corresponding to the given shared library file. More... | |
static bool | unloadViewerExtension (QString) |
Unload an viewer extension using its .dll/.so/.dylib filename. More... | |
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 |
Autoload component and action extensions.
References ACTION, COMPONENT, and VIEWER.
Referenced by camitk::Application::Application(), and main().
|
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.
|
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 alphabitically sorted.
Referenced by camitk::Core::getConfig().
|
static |
get the plugin corresponding to a given extension or name.
Referenced by camitk::Application::open(), and camitk::Application::save().
|
static |
Get the list of registered ComponentExtension.
The list contains unique elements (no duplicates possible) and is alphabitically sorted.
Referenced by camitk::Core::getConfig(), camitk::ImageAcquisitionComponentExtension::getImagerList(), camitk::ImageAcquisitionComponentExtension::getInstance(), and main().
|
static |
get the plugin corresponding to a given data directory component extension's name.
Referenced by camitk::Application::openDirectory().
|
static |
Get the list of registered ComponentExtension working on directory.
The list contains unique elements (no duplicates possible) and is alphabitically sorted.
Referenced by camitk::Core::getConfig().
|
static |
get the list of all the name of the registered Component data directory
|
static |
get the list of all the suffixes managed by registered component extensions (all possible file suffix)
Referenced by camitk::Application::Application().
|
static |
Returns a three char string that corresponds to the installation directory of a given shared library.
The shared library should be the complete filename corresponding to a component or action extension.
The following string code are 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().
|
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 alphabitically sorted.
Referenced by camitk::Core::getConfig(), camitk::Application::getNewViewer(), and loadExtension().
|
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::ComponentExtension::getFileExtensions(), camitk::Core::getGlobalInstallDir(), camitk::ComponentExtension::getLocation(), camitk::ComponentExtension::getName(), camitk::ViewerExtension::getName(), camitk::ViewerExtension::getViewerClassName(), getViewerExtensionsList(), camitk::ComponentExtension::hasDataDirectory(), camitk::ActionExtension::init(), camitk::ViewerExtension::init(), camitk::ActionExtension::initResources(), camitk::ComponentExtension::initResources(), camitk::ViewerExtension::initResources(), camitk::Core::libDir, camitk::Application::registerAllActions(), camitk::Application::registerAllViewers(), camitk::ActionExtension::setLocation(), camitk::ComponentExtension::setLocation(), camitk::ViewerExtension::setLocation(), camitk::Core::shortVersion, and VIEWER.
Referenced by autoload(), and main().
|
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().
|
static |
Unload an action extension using its .dll/.so/.dylib filename.
References camitk::Application::unregisterAllActions().
Referenced by unloadAllActionExtensions().
|
static |
unload all action extensions and delete instantiated actions
References unloadActionExtension().
|
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().
|
static |
Unload an viewer extension using its .dll/.so/.dylib filename.
References camitk::Application::unregisterAllViewers().