CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkCmdLineModuleDirectoryWatcher.h
Go to the documentation of this file.
1/*=============================================================================
2
3 Library: CTK
4
5 Copyright (c) University College London
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19=============================================================================*/
20
21#ifndef __ctkCmdLineModuleDirectoryWatcher_h
22#define __ctkCmdLineModuleDirectoryWatcher_h
23
24#include <ctkCommandLineModulesCoreExport.h>
25
26#include <QObject>
27#include <QScopedPointer>
28
30class ctkCmdLineModuleDirectoryWatcherPrivate;
31
63class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleDirectoryWatcher
64: public QObject
65{
66 Q_OBJECT
67
68public:
69
72
77 void setDebug(bool debug);
78
84 void setDirectories(const QStringList& directories);
85
89 QStringList directories() const;
90
96 void setAdditionalModules(const QStringList& files);
97
102 QStringList additionalModules() const;
103
108 QStringList commandLineModules() const;
109
113 void emitErrorDectectedSignal(const QString&);
114
115Q_SIGNALS:
116
120 void errorDetected(const QString&);
121
122private:
123
124 QScopedPointer<ctkCmdLineModuleDirectoryWatcherPrivate> d;
126};
127
128#endif // __ctkCmdLineModuleDirectoryWatcher_h
Provides directory scanning and file watching via QFileSystemWatcher to automatically load new module...
void emitErrorDectectedSignal(const QString &)
public method to emit the errorDetected signal.
QStringList directories() const
Returns the list of directories currently being watched.
QStringList commandLineModules() const
Returns the complete list of files (command line executables) currently being watched.
void errorDetected(const QString &)
Signals that an error was detected, and the caller should raise an error to the user.
void setDirectories(const QStringList &directories)
Set the directories to be watched.
ctkCmdLineModuleDirectoryWatcher(ctkCmdLineModuleManager *moduleManager)
void setAdditionalModules(const QStringList &files)
Sets an additional list of command line executables to watch.
QStringList additionalModules() const
Gets the list of additional command line executable, where "additional" means "in addition to those d...
void setDebug(bool debug)
Set the watcher into debug mode, for more output.
Main manager class to handle loading and unloading of modules.