Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Static Public Member Functions | Static Private Member Functions | List of all members
camitk::ExtensionManager Class Reference

This class is used to manage all plugins loaded by the application. More...

#include <ExtensionManager.h>

+ Inheritance diagram for camitk::ExtensionManager:

Static Public Member Functions

static void autoload ()
 Autoload component and action extensions. More...
 
Component extension list management
static void autoloadComponentExtensions ()
 
static bool loadComponentExtension (QString file)
 load a ComponentExtension plugin using a .dll/.so/.dylib filename More...
 
static bool unloadComponentExtension (QString)
 unload a plugin corresponding to a given extension or name More...
 
static const ComponentExtensiongetComponentExtension (QString)
 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) More...
 
static const QMap< QString,
ComponentExtension * > & 
getComponentExtensions ()
 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). More...
 
static const QMap< QString,
ComponentExtension * > & 
getDataDirectoryComponents ()
 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). 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...
 
Action extension list management
static void autoloadActionExtensions ()
 autoload all the action extensions (use applicationDirPath/actions) More...
 
static void unloadAllActionExtensions ()
 unload all action extensions and delete instanciated actions More...
 
static bool loadActionExtension (QString)
 load an action extension using a .dll/.so/.dylib filename More...
 
static bool unloadActionExtension (QString)
 unload an action extension using its .dll/.so/.dylib filename More...
 
static const QMap< QString,
ActionExtension * > & 
getActionExtensions ()
 get all the registered action extension. More...
 

Static Private Member Functions

static QMap< QString,
ActionExtension * > & 
getActionExtensionMap ()
 get the singleton map of loaded component plugins for files (the key is the file extension) This is the private (intern) method. More...
 
static QMap< QString,
ComponentExtension * > & 
getComponentExtensionMap ()
 get the singleton map of loaded component plugins for files (the key is the file extension) This is the private (intern) method. More...
 
static QMap< QString,
ComponentExtension * > & 
getDataDirectoryComponentExtensionMap ()
 get the singleton map of loaded component plugins for data directory (the key is the name) This is the private (intern) method. More...
 

Detailed Description

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.

Member Function Documentation

void camitk::ExtensionManager::autoload ( )
static

Autoload component and action extensions.

References autoloadActionExtensions(), and autoloadComponentExtensions().

Referenced by camitk::Application::Application().

void camitk::ExtensionManager::autoloadActionExtensions ( )
static

autoload all the action extensions (use applicationDirPath/actions)

References camitk::Core::getActionDir(), camitk::Application::getSettings(), loadActionExtension(), and camitk::Core::soVersion.

Referenced by autoload().

void camitk::ExtensionManager::autoloadComponentExtensions ( )
static
QMap< QString, ActionExtension * > & camitk::ExtensionManager::getActionExtensionMap ( )
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 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

Referenced by getActionExtensions(), loadActionExtension(), unloadActionExtension(), and unloadAllActionExtensions().

const QMap< QString, ActionExtension * > & camitk::ExtensionManager::getActionExtensions ( )
static

get all the registered action extension.

This is the public method (return a const, the extensions map is private and cannot be modified externally).

References getActionExtensionMap().

Referenced by camitk::Core::getConfig(), camitk::SettingsDialog::on_removeActionExtensionButton_released(), and camitk::SettingsDialog::updateActionExtensionList().

const ComponentExtension * camitk::ExtensionManager::getComponentExtension ( QString  extOrName)
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)

References getComponentExtensionMap(), and getDataDirectoryComponentExtensionMap().

Referenced by camitk::SettingsDialog::on_componentExtensionList_cellClicked().

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 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

Referenced by getComponentExtension(), getComponentExtensions(), loadComponentExtension(), and unloadComponentExtension().

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).

References getComponentExtensionMap().

Referenced by camitk::Core::getConfig(), getFileExtensions(), camitk::Application::open(), camitk::Application::save(), and camitk::SettingsDialog::updateComponentExtensionList().

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

Referenced by getComponentExtension(), getDataDirectoryComponents(), loadComponentExtension(), and unloadComponentExtension().

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).

References getDataDirectoryComponentExtensionMap().

Referenced by getDataDirectoryExtNames(), camitk::Application::openDirectory(), and camitk::SettingsDialog::updateComponentExtensionList().

QStringList camitk::ExtensionManager::getDataDirectoryExtNames ( )
static

get the list of all the name of the registered Component data directory

References getDataDirectoryComponents().

QStringList camitk::ExtensionManager::getFileExtensions ( )
static

get the list of all the suffixes managed by registered component extensions (all possible file suffix)

References getComponentExtensions().

bool camitk::ExtensionManager::loadActionExtension ( QString  fileName)
static

load an action extension using a .dll/.so/.dylib filename

Returns
false if it cannot be loaded

References getActionExtensionMap(), camitk::ActionExtension::init(), and camitk::Application::registerAllActions().

Referenced by autoloadActionExtensions(), and camitk::SettingsDialog::on_addActionExtensionButton_released().

bool camitk::ExtensionManager::loadComponentExtension ( QString  file)
static
bool camitk::ExtensionManager::unloadActionExtension ( QString  fileName)
static
void camitk::ExtensionManager::unloadAllActionExtensions ( )
static

unload all action extensions and delete instanciated actions

References getActionExtensionMap(), and unloadActionExtension().

Referenced by camitk::Application::quitting().

bool camitk::ExtensionManager::unloadComponentExtension ( QString  extOrName)
static

unload a plugin corresponding to a given extension or name

Returns
false if the plugin could not be unloaded - still in use somewhere

References getComponentExtensionMap(), getDataDirectoryComponentExtensionMap(), and camitk::ComponentExtension::getLocation().

Referenced by camitk::SettingsDialog::on_removeComponentExtensionButton_released().


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