MorphoGraphX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProcessThread.hpp
1 #ifndef PROCESSTHREAD_HPP
2 #define PROCESSTHREAD_HPP
3 
4 #include <Process.hpp>
5 
6 #include <QEvent>
7 #include <QMutex>
8 #include <QThread>
9 
10 namespace mgx {
11  struct mgx_EXPORT ProcessUpdateViewEvent : public QEvent
12  {
13  ProcessUpdateViewEvent() : QEvent(QEvent::User) {}
14  };
15 
16  struct mgx_EXPORT ProcessSystemCommand : public QEvent {
17  ProcessSystemCommand(process::Process* p, process::SystemCommand cmd, const QStringList& prms)
18  : QEvent(QEvent::User), process(p), command(cmd), parms(prms) {}
19 
20  process::Process* process;
21  process::SystemCommand command;
22  const QStringList& parms;
23  };
24 
25  class mgx_EXPORT ProcessThread : public QThread {
26  Q_OBJECT
27  public:
28  ProcessThread(process::Process* proc, const QStringList& prms, QObject* parent)
29  : QThread(parent), process(proc), parms(prms) {}
30 
31  virtual ~ProcessThread() {}
32 
33  void run();
34 
35  bool exitStatus() const
36  {
37  return _status;
38  }
39  QString errorMessage() const
40  {
41  return _error;
42  }
43  QString warningMessage() const
44  {
45  return _warning;
46  }
47 
48  protected:
49  process::Process* process;
50  QStringList parms;
51  bool _status;
52  QString _error, _warning;
53  };
54 }
55 #endif
Definition: ProcessThread.hpp:11
Definition: ProcessThread.hpp:25
File containing the definition of a Process.
This is the main process class, the one all process inherit from.
Definition: Process.hpp:248
Definition: ProcessThread.hpp:16