MorphoGraphX  2.0-1-227
ProcessThread.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef PROCESSTHREAD_HPP
12 #define PROCESSTHREAD_HPP
13 
14 #include <Process.hpp>
15 
16 #include <QEvent>
17 #include <QMutex>
18 #include <QThread>
19 
20 namespace mgx
21 {
22  class mgx_EXPORT ProcessThread : public QThread
23  {
24  Q_OBJECT
25  public:
26  ProcessThread(Process* proc, Process::ProcessAction pAction, QObject* parent)
27  : QThread(parent), process(proc), processAction(pAction) {}
28 
29  virtual ~ProcessThread() {}
30 
31  void run();
32 
33  bool exitStatus() const
34  {
35  return _status;
36  }
37  QString errorMessage() const
38  {
39  return _error;
40  }
41  QString warningMessage() const
42  {
43  return _warning;
44  }
45 
46  protected:
49  bool _status;
50  QString _error, _warning;
51  };
52 }
53 #endif
mgx::ProcessThread::warningMessage
QString warningMessage() const
Definition: ProcessThread.hpp:41
Process.hpp
mgx::ProcessThread::ProcessThread
ProcessThread(Process *proc, Process::ProcessAction pAction, QObject *parent)
Definition: ProcessThread.hpp:26
mgx::ProcessThread
Definition: ProcessThread.hpp:22
mgx::Process::ProcessAction
ProcessAction
Enumeration for process flow control.
Definition: Process.hpp:540
mgx::ProcessThread::processAction
Process::ProcessAction processAction
Definition: ProcessThread.hpp:48
mgx::ProcessThread::exitStatus
bool exitStatus() const
Definition: ProcessThread.hpp:33
mgx::ProcessThread::errorMessage
QString errorMessage() const
Definition: ProcessThread.hpp:37
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::ProcessThread::~ProcessThread
virtual ~ProcessThread()
Definition: ProcessThread.hpp:29
mgx::Process
Definition: Process.hpp:219
mgx::ProcessThread::process
Process * process
Definition: ProcessThread.hpp:47
mgx::ProcessThread::_status
bool _status
Definition: ProcessThread.hpp:49
mgx::ProcessThread::_warning
QString _warning
Definition: ProcessThread.hpp:50