tuchulcha  0.10.1
Graphical Workflow Configuration Editor
CommunicationHandler.h
Go to the documentation of this file.
1 /* Copyright (C) 2011 Jens-Malte Gottfried
2 
3  This file is part of Tuchulcha.
4 
5  Tuchulcha is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Tuchulcha is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with Tuchulcha. If not, see <http://www.gnu.org/licenses/>.
17 */
24 #ifndef COMM_HANDLER_H
25 #define COMM_HANDLER_H
26 
27 #include <QThread>
28 #include <QStringList>
29 
31 class CommunicationHandler : public QThread
32 {
33  Q_OBJECT
34 
35 public:
37 
40  explicit CommunicationHandler(
41  const QStringList& args, QObject* parent = 0);
43  int errorCode() const;
44 
45 public slots:
47  void taskFinished();
48 
49 private slots:
51  void _startTask();
53  void _printPrompt();
54 
55 signals:
57  void setupSettings();
59  void updatePlugins();
61 
62  void runWorkflow(QString fName);
64 
65  void updateDynamics(QString fName);
66 
67 protected:
69  virtual void run();
70 
71 private:
75  bool _quiet;
77  uint _taskCount;
79  QStringList _args;
81  QString _helpMsg;
83  QString _helpMsgI;
85  bool _checkForFileArg(QStringListIterator& iter, QString cmd);
88 };
89 
90 #endif // COMM_HANDLER_H
QString _helpMsg
message to display when –help argument was provided
int errorCode() const
get CommunicatonHandler return code, zero means no error
CommunicationHandler(const QStringList &args, QObject *parent=0)
constructor with cmdline arguments
uint _taskCount
task counter
QStringList _args
cmd line argument cache
virtual void run()
thread execution code
void updateDynamics(QString fName)
update dynamic plugins of given workflow file
void _printPrompt()
print command line prompt for interactive session
bool _quiet
avoid info output
void setupSettings()
setup settings
handle command line arguments and process communication
QString _helpMsgI
help message for interactive session
int _errorCode
error code cache, zero means no error
bool _checkForFileArg(QStringListIterator &iter, QString cmd)
check for file argument during command line processing
void runWorkflow(QString fName)
run given workflow file
bool _interactive
enter interactive loop
void _startTask()
handle task starting
void taskFinished()
handle task finishing
void updatePlugins()
update module metadata