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 
108  ValidationMode validationMode() const;
109 
113  void setValidationMode(const ValidationMode& mode);
114 
122  void setTimeOutForXMLRetrieval(int timeout);
123 
128  int timeOutForXMLRetrieval() const;
129 
136  void registerBackend(ctkCmdLineModuleBackend* backend);
137 
143  ctkCmdLineModuleBackend* backend(const QString& scheme) const;
144 
149  QList<ctkCmdLineModuleBackend*> backends() const;
150 
161  ctkCmdLineModuleReference registerModule(const QUrl& location);
162 
170  void unregisterModule(const ctkCmdLineModuleReference& moduleRef);
171 
175  void clearCache();
176 
183  ctkCmdLineModuleReference moduleReference(const QUrl& location) const;
184 
189  QList<ctkCmdLineModuleReference> moduleReferences() const;
190 
205 
206 Q_SIGNALS:
207 
211  void moduleRegistered(const ctkCmdLineModuleReference&);
212 
216  void moduleUnregistered(const ctkCmdLineModuleReference&);
217 
218 private:
219 
220  QScopedPointer<ctkCmdLineModuleManagerPrivate> d;
221 
222  Q_DISABLE_COPY(ctkCmdLineModuleManager)
223 
224 };
225 
226 #endif // CTKCMDLINEMODULEMANAGER_H
ctkCmdLineModuleManager
Main manager class to handle loading and unloading of modules.
Definition: ctkCmdLineModuleManager.h:71
ctkCmdLineModuleManager::SKIP_VALIDATION
@ SKIP_VALIDATION
Definition: ctkCmdLineModuleManager.h:81
ctkCmdLineModuleManager::STRICT_VALIDATION
@ STRICT_VALIDATION
Definition: ctkCmdLineModuleManager.h:79
ctkCmdLineModuleBackend
Abstract base class for all back-end command line module implementations.
Definition: ctkCmdLineModuleBackend.h:46
ctkCmdLineModuleFuture
QFuture sub-class for enhanced communication with running modules.
Definition: ctkCmdLineModuleFuture.h:43
QList< ctkCmdLineModuleBackend * >
ctkCmdLineModuleFrontendFactory
Factory class to create new front-ends.
Definition: ctkCmdLineModuleFrontendFactory.h:40
ctkCmdLineModuleReference
Defines a reference or handle to a module, including location, XML, description and access to the ass...
Definition: ctkCmdLineModuleReference.h:44
ctkCmdLineModuleReference.h
ctkCmdLineModuleManager::ValidationMode
ValidationMode
Definition: ctkCmdLineModuleManager.h:77
ctkCmdLineModuleFrontend
Abstract base class for all front-end command line module implementations.
Definition: ctkCmdLineModuleFrontend.h:52