Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes
qSlicerModuleFactoryManager Class Reference

#include <Base/QTCore/qSlicerModuleFactoryManager.h>

Inheritance diagram for qSlicerModuleFactoryManager:
Inheritance graph
[legend]
Collaboration diagram for qSlicerModuleFactoryManager:
Collaboration graph
[legend]

Public Types

typedef qSlicerAbstractModuleFactoryManager Superclass
 
- Public Types inherited from qSlicerAbstractModuleFactoryManager
typedef ctkAbstractFileBasedFactory< qSlicerAbstractCoreModuleqSlicerFileBasedModuleFactory
 
typedef ctkAbstractFactory< qSlicerAbstractCoreModuleqSlicerModuleFactory
 
typedef QObject Superclass
 

Public Slots

void setMRMLScene (vtkMRMLScene *mrmlScene)
 Set the MRML scene to pass to modules at "load" time. More...
 
- Public Slots inherited from qSlicerAbstractModuleFactoryManager
bool isVerbose () const
 
void setIsVerbose (bool flag)
 

Signals

void moduleAboutToBeUnloaded (const QString &moduleName)
 
void moduleLoaded (const QString &moduleName)
 
void modulesAboutToBeUnloaded (const QStringList &modulesNames)
 
void modulesLoaded (const QStringList &modulesNames)
 
void modulesUnloaded (const QStringList &modulesNames)
 
void moduleUnloaded (const QString &moduleName)
 
void mrmlSceneChanged (vtkMRMLScene *newScene)
 
- Signals inherited from qSlicerAbstractModuleFactoryManager
void explicitModulesChanged (const QStringList &moduleNames)
 
void moduleAboutToBeUninstantiated (const QString &moduleName)
 
void moduleIgnored (const QString &moduleName)
 
void moduleInstantiated (const QString &moduleName)
 
void moduleRegistered (const QString &moduleName)
 
void modulesAboutToBeUninstantiated (const QStringList &moduleNames)
 
void modulesInstantiated (const QStringList &moduleNames)
 
void modulesRegistered (const QStringList &moduleNames)
 This signal is emitted when all the modules associated with the registered factories have been loaded. More...
 
void modulesToIgnoreChanged (const QStringList &moduleNames)
 
void modulesUninstantiated (const QStringList &moduleNames)
 
void moduleUninstantiated (const QString &moduleName)
 

Public Member Functions

vtkSlicerApplicationLogicappLogic () const
 
Q_INVOKABLE bool isLoaded (const QString &name) const
 Return true if module name has been loaded, false otherwise. More...
 
Q_INVOKABLE qSlicerAbstractCoreModuleloadedModule (const QString &name) const
 
Q_INVOKABLE QStringList loadedModuleNames () const
 Return the list of all the loaded modules. More...
 
bool loadModule (const QString &name)
 
Q_INVOKABLE int loadModules ()
 
Q_INVOKABLE bool loadModules (const QStringList &modules)
 
QStringList modulePaths (const QString &basePath)
 Return all module paths that are direct child of basePath. More...
 
vtkMRMLScenemrmlScene () const
 Return the mrml scene passed to loaded modules. More...
 
void printAdditionalInfo () override
 Print internal state using qDebug() More...
 
 qSlicerModuleFactoryManager (QObject *newParent=nullptr)
 
void setAppLogic (vtkSlicerApplicationLogic *applicationLogic)
 Set the application logic to pass to modules at "load" time. More...
 
Q_INVOKABLE void unloadModules ()
 
 ~qSlicerModuleFactoryManager () override
 Unloads all the modules previously loaded. More...
 
- Public Member Functions inherited from qSlicerAbstractModuleFactoryManager
void addModuleToIgnore (const QString &moduleName)
 
void addSearchPath (const QString &path)
 Utility function that adds a path to the current searchPaths list. More...
 
void addSearchPaths (const QStringList &paths)
 
QStringList dependentModules (const QString &module) const
 
QStringList explicitModules () const
 
QStringList ignoredModuleNames () const
 
Q_INVOKABLE QStringList instantiatedModuleNames () const
 List of registered and instantiated modules. More...
 
virtual void instantiateModules ()
 Instantiate all previously registered modules. More...
 
Q_INVOKABLE bool isInstantiated (const QString &name) const
 Return true if a module has been instantiated, false otherwise. More...
 
Q_INVOKABLE bool isRegistered (const QString &name) const
 Return true if a module has been registered, false otherwise. More...
 
QStringList moduleDependees (const QString &module) const
 
Q_INVOKABLE qSlicerAbstractCoreModulemoduleInstance (const QString &moduleName) const
 Return the instance of a module if already instantiated, 0 otherwise. More...
 
QStringList modulesToIgnore () const
 
 qSlicerAbstractModuleFactoryManager (QObject *newParent=nullptr)
 
Q_INVOKABLE QStringList registeredModuleNames () const
 Convenient method returning the list of all registered module names. More...
 
void registerFactory (qSlicerModuleFactory *factory, int priority=0)
 Register a factory The factory will be deleted when unregistered (e.g. in ~qSlicerAbstractModuleFactoryManager()) More...
 
Q_INVOKABLE void registerModule (const QFileInfo &file)
 
void registerModules ()
 
void removeModuleToIgnore (const QString &moduleName)
 
void removeSearchPath (const QString &path)
 Utility function that removes a path from the current searchPaths list. More...
 
void removeSearchPaths (const QStringList &paths)
 
QStringList searchPaths () const
 
void setExplicitModules (const QStringList &moduleNames)
 
void setModulesToIgnore (const QStringList &modulesNames)
 
void setSearchPaths (const QStringList &searchPaths)
 
void setVerboseModuleDiscovery (bool value)
 Enable/Disable verbose output during module discovery process. More...
 
void uninstantiateModules ()
 Uninstantiate all instantiated modules. More...
 
void unregisterFactories ()
 
void unregisterFactory (qSlicerModuleFactory *factory)
 
 ~qSlicerAbstractModuleFactoryManager () override
 

Protected Member Functions

bool loadModule (const QString &name, const QString &dependee)
 
void uninstantiateModule (const QString &moduleName) override
 Uninstantiate a module given its moduleName. More...
 
virtual void uninstantiateModules ()
 Reimplemented to ensure order. More...
 
void unloadModule (const QString &name)
 Unload module identified by name. More...
 
- Protected Member Functions inherited from qSlicerAbstractModuleFactoryManager
qSlicerAbstractCoreModuleinstantiateModule (const QString &name)
 Instantiate a module given its name. More...
 
void registerModules (const QString &directoryPath)
 

Protected Attributes

QScopedPointer< qSlicerModuleFactoryManagerPrivate > d_ptr
 
- Protected Attributes inherited from qSlicerAbstractModuleFactoryManager
QScopedPointer< qSlicerAbstractModuleFactoryManagerPrivate > d_ptr
 

Additional Inherited Members

- Properties inherited from qSlicerAbstractModuleFactoryManager
QStringList modulesToIgnore
 
QStringList searchPaths
 

Detailed Description

Definition at line 37 of file qSlicerModuleFactoryManager.h.

Member Typedef Documentation

◆ Superclass

Definition at line 42 of file qSlicerModuleFactoryManager.h.

Constructor & Destructor Documentation

◆ qSlicerModuleFactoryManager()

qSlicerModuleFactoryManager::qSlicerModuleFactoryManager ( QObject *  newParent = nullptr)

◆ ~qSlicerModuleFactoryManager()

qSlicerModuleFactoryManager::~qSlicerModuleFactoryManager ( )
override

Unloads all the modules previously loaded.

Member Function Documentation

◆ appLogic()

vtkSlicerApplicationLogic* qSlicerModuleFactoryManager::appLogic ( ) const

◆ isLoaded()

Q_INVOKABLE bool qSlicerModuleFactoryManager::isLoaded ( const QString &  name) const

Return true if module name has been loaded, false otherwise.

◆ loadedModule()

Q_INVOKABLE qSlicerAbstractCoreModule* qSlicerModuleFactoryManager::loadedModule ( const QString &  name) const

Return the loaded module identified by name, 0 if no module has been loaded yet, even if the module has been instantiated.

◆ loadedModuleNames()

Q_INVOKABLE QStringList qSlicerModuleFactoryManager::loadedModuleNames ( ) const

Return the list of all the loaded modules.

◆ loadModule() [1/2]

bool qSlicerModuleFactoryManager::loadModule ( const QString &  name)

Load module identified by name

Todo:
move it as protected

◆ loadModule() [2/2]

bool qSlicerModuleFactoryManager::loadModule ( const QString &  name,
const QString &  dependee 
)
protected

◆ loadModules() [1/2]

Q_INVOKABLE int qSlicerModuleFactoryManager::loadModules ( )

Load all the instantiated modules. To register and initialize modules, please use qSlicerModuleFactoryManager::registerModules(); qSlicerModuleFactoryManager::initializeModules(); Returns the number of loaded modules.

See also
qSlicerModuleFactoryManager::registerModules()
qSlicerModuleFactoryManager::instantiateModules()

◆ loadModules() [2/2]

Q_INVOKABLE bool qSlicerModuleFactoryManager::loadModules ( const QStringList &  modules)

Load specified modules.

This attempts to load the specified modules, instantiating them first if necessary.

◆ moduleAboutToBeUnloaded

void qSlicerModuleFactoryManager::moduleAboutToBeUnloaded ( const QString &  moduleName)
signal

◆ moduleLoaded

void qSlicerModuleFactoryManager::moduleLoaded ( const QString &  moduleName)
signal

◆ modulePaths()

QStringList qSlicerModuleFactoryManager::modulePaths ( const QString &  basePath)

Return all module paths that are direct child of basePath.

◆ modulesAboutToBeUnloaded

void qSlicerModuleFactoryManager::modulesAboutToBeUnloaded ( const QStringList &  modulesNames)
signal

◆ modulesLoaded

void qSlicerModuleFactoryManager::modulesLoaded ( const QStringList &  modulesNames)
signal

◆ modulesUnloaded

void qSlicerModuleFactoryManager::modulesUnloaded ( const QStringList &  modulesNames)
signal

◆ moduleUnloaded

void qSlicerModuleFactoryManager::moduleUnloaded ( const QString &  moduleName)
signal

◆ mrmlScene()

vtkMRMLScene* qSlicerModuleFactoryManager::mrmlScene ( ) const

Return the mrml scene passed to loaded modules.

◆ mrmlSceneChanged

void qSlicerModuleFactoryManager::mrmlSceneChanged ( vtkMRMLScene newScene)
signal

◆ printAdditionalInfo()

void qSlicerModuleFactoryManager::printAdditionalInfo ( )
overridevirtual

Print internal state using qDebug()

Reimplemented from qSlicerAbstractModuleFactoryManager.

◆ setAppLogic()

void qSlicerModuleFactoryManager::setAppLogic ( vtkSlicerApplicationLogic applicationLogic)

Set the application logic to pass to modules at "load" time.

◆ setMRMLScene

void qSlicerModuleFactoryManager::setMRMLScene ( vtkMRMLScene mrmlScene)
slot

Set the MRML scene to pass to modules at "load" time.

◆ uninstantiateModule()

void qSlicerModuleFactoryManager::uninstantiateModule ( const QString &  moduleName)
overrideprotectedvirtual

Uninstantiate a module given its moduleName.

Reimplemented from qSlicerAbstractModuleFactoryManager.

◆ uninstantiateModules()

virtual void qSlicerModuleFactoryManager::uninstantiateModules ( )
protectedvirtual

Reimplemented to ensure order.

◆ unloadModule()

void qSlicerModuleFactoryManager::unloadModule ( const QString &  name)
protected

Unload module identified by name.

◆ unloadModules()

Q_INVOKABLE void qSlicerModuleFactoryManager::unloadModules ( )

Unload all the loaded modules. Unloading a module simply uninstantiate it. To respect dependencies, the order is reverse to the order of load.

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerModuleFactoryManagerPrivate> qSlicerModuleFactoryManager::d_ptr
protected

Definition at line 111 of file qSlicerModuleFactoryManager.h.


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