CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkCmdLineModuleManager.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  Library: CTK
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics
7 
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 =============================================================================*/
21 
22 #ifndef CTKCMDLINEMODULEMANAGER_H
23 #define CTKCMDLINEMODULEMANAGER_H
24 
25 #include <ctkCommandLineModulesCoreExport.h>
26 
27 #include <QObject>
28 #include <QScopedPointer>
29 #include <QString>
30 #include <QStringList>
32 
37 
38 struct ctkCmdLineModuleManagerPrivate;
39 
71 class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleManager : public QObject
72 {
73  Q_OBJECT
74 
75 public:
76 
86  WEAK_VALIDATION
87  };
88 
99  ctkCmdLineModuleManager(ValidationMode validationMode = STRICT_VALIDATION,
100  const QString& cacheDir = QString());
101 
103 
109 
114 
122  void setTimeOutForXMLRetrieval(int timeout);
123 
129 
137 
143  ctkCmdLineModuleBackend* backend(const QString& scheme) const;
144 
150 
162 
171 
175  void clearCache();
176 
183  ctkCmdLineModuleReference moduleReference(const QUrl& location) const;
184 
190 
205 
206 Q_SIGNALS:
207 
212 
217 
218 private:
219 
220  QScopedPointer<ctkCmdLineModuleManagerPrivate> d;
221 
222  Q_DISABLE_COPY(ctkCmdLineModuleManager)
223 
224 };
225 
226 #endif // CTKCMDLINEMODULEMANAGER_H
ctkCmdLineModuleManager::clearCache
void clearCache()
Clears the XML/timestamp cache.
ctkCmdLineModuleManager
Main manager class to handle loading and unloading of modules.
Definition: ctkCmdLineModuleManager.h:72
ctkCmdLineModuleManager::registerModule
ctkCmdLineModuleReference registerModule(const QUrl &location)
Registers a module, identified by the given URL.
ctkCmdLineModuleManager::SKIP_VALIDATION
@ SKIP_VALIDATION
Definition: ctkCmdLineModuleManager.h:81
ctkCmdLineModuleManager::validationMode
ValidationMode validationMode() const
Get the validation mode.
ctkCmdLineModuleManager::STRICT_VALIDATION
@ STRICT_VALIDATION
Definition: ctkCmdLineModuleManager.h:79
ctkCmdLineModuleBackend
Abstract base class for all back-end command line module implementations.
Definition: ctkCmdLineModuleBackend.h:47
ctkCmdLineModuleManager::backend
ctkCmdLineModuleBackend * backend(const QString &scheme) const
Get the registered backend for a scheme.
ctkCmdLineModuleManager::moduleReferences
QList< ctkCmdLineModuleReference > moduleReferences() const
Returns module references for all currently registered modules.
ctkCmdLineModuleManager::~ctkCmdLineModuleManager
~ctkCmdLineModuleManager()
ctkCmdLineModuleFuture
QFuture sub-class for enhanced communication with running modules.
Definition: ctkCmdLineModuleFuture.h:44
ctkCmdLineModuleManager::moduleUnregistered
void moduleUnregistered(const ctkCmdLineModuleReference &)
This signal is emitted whenever a module is un-registered.
QList< ctkCmdLineModuleBackend * >
ctkCmdLineModuleManager::timeOutForXMLRetrieval
int timeOutForXMLRetrieval() const
Get the timeout for retrieving the XML parameter description from a module.
ctkCmdLineModuleManager::run
ctkCmdLineModuleFuture run(ctkCmdLineModuleFrontend *frontend)
Run a module front-end.
ctkCmdLineModuleFrontendFactory
Factory class to create new front-ends.
Definition: ctkCmdLineModuleFrontendFactory.h:41
ctkCmdLineModuleManager::moduleRegistered
void moduleRegistered(const ctkCmdLineModuleReference &)
This signal is emitted whenever a module is registered.
ctkCmdLineModuleReference
Defines a reference or handle to a module, including location, XML, description and access to the ass...
Definition: ctkCmdLineModuleReference.h:45
ctkCmdLineModuleReference.h
ctkCmdLineModuleManager::moduleReference
ctkCmdLineModuleReference moduleReference(const QUrl &location) const
Returns a ctkCmdLineModuleReference object for the given URL.
ctkCmdLineModuleManager::ValidationMode
ValidationMode
Definition: ctkCmdLineModuleManager.h:77
ctkCmdLineModuleManager::setTimeOutForXMLRetrieval
void setTimeOutForXMLRetrieval(int timeout)
Set the timeout for retrieving the XML parameter description from a module.
ctkCmdLineModuleFrontend
Abstract base class for all front-end command line module implementations.
Definition: ctkCmdLineModuleFrontend.h:53
ctkCmdLineModuleManager::registerBackend
void registerBackend(ctkCmdLineModuleBackend *backend)
Registers a new back-end.
ctkCmdLineModuleManager::unregisterModule
void unregisterModule(const ctkCmdLineModuleReference &moduleRef)
Unregister a previously registered module.
ctkCmdLineModuleManager::backends
QList< ctkCmdLineModuleBackend * > backends() const
Get a list of all registered backends.
ctkCmdLineModuleManager::ctkCmdLineModuleManager
ctkCmdLineModuleManager(ValidationMode validationMode=STRICT_VALIDATION, const QString &cacheDir=QString())
Create a module manager instance.
ctkCmdLineModuleManager::setValidationMode
void setValidationMode(const ValidationMode &mode)
Set the validation mode.