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
Abstract base class for all front-end command line module implementations.
QFuture sub-class for enhanced communication with running modules.
Main manager class to handle loading and unloading of modules.
ctkCmdLineModuleManager(ValidationMode validationMode=STRICT_VALIDATION, const QString &cacheDir=QString())
Create a module manager instance.
void moduleRegistered(const ctkCmdLineModuleReference &)
This signal is emitted whenever a module is registered.
ctkCmdLineModuleReference registerModule(const QUrl &location)
Registers a module, identified by the given URL.
QList< ctkCmdLineModuleBackend * > backends() const
Get a list of all registered backends.
void moduleUnregistered(const ctkCmdLineModuleReference &)
This signal is emitted whenever a module is un-registered.
void unregisterModule(const ctkCmdLineModuleReference &moduleRef)
Unregister a previously registered module.
ValidationMode validationMode() const
Get the validation mode.
void setValidationMode(const ValidationMode &mode)
Set the validation mode.
ctkCmdLineModuleBackend * backend(const QString &scheme) const
Get the registered backend for a scheme.
ctkCmdLineModuleReference moduleReference(const QUrl &location) const
Returns a ctkCmdLineModuleReference object for the given URL.
ctkCmdLineModuleFuture run(ctkCmdLineModuleFrontend *frontend)
Run a module front-end.
void clearCache()
Clears the XML/timestamp cache.
int timeOutForXMLRetrieval() const
Get the timeout for retrieving the XML parameter description from a module.
void registerBackend(ctkCmdLineModuleBackend *backend)
Registers a new back-end.
void setTimeOutForXMLRetrieval(int timeout)
Set the timeout for retrieving the XML parameter description from a module.
QList< ctkCmdLineModuleReference > moduleReferences() const
Returns module references for all currently registered modules.
Defines a reference or handle to a module, including location, XML, description and access to the ass...
Abstract base class for all back-end command line module implementations.
Factory class to create new front-ends.