Isis 3.0 Programmer Reference
Home
ConcurrentControlNetReader.h
Go to the documentation of this file.
1 #ifndef ConcurrentControlNetReader_h
2 #define ConcurrentControlNetReader_h
3 
26 #include <QObject>
27 #include <QPair>
28 #include <QPointer>
29 #include <QString>
30 #include <QStringList>
31 
32 #include "ControlNetFile.h"
33 #include "ProgressBar.h"
34 
35 template<typename A> class QAtomicPointer;
36 template<typename A> class QFutureWatcher;
37 
38 namespace Isis {
39  class Control;
40  class FileName;
41  class Progress;
42  class ProgressBar;
43 
44 
57  Q_OBJECT
58 
59  public:
62  void read(QString filename);
63  void read(QStringList filenames);
64  ProgressBar *progressBar();
65 
66  signals:
67  void networksReady(QList<Control *>);
68 
69  private:
70  void nullify();
71  void start();
72 
73  private slots:
74  void updateProgressValue();
75  void mappedFinished();
76 
77  private:
78  void initProgress();
79 
80  private:
83  QStringList m_backlog;
84  bool m_mappedRunning;
85  QList<Progress *> m_progress;
86  QPointer<ProgressBar> m_progressBar;
87  QPointer<QTimer> m_progressUpdateTimer;
88 
96  class FileNameToControlFunctor : public std::unary_function<
97  const QPair<FileName, Progress *> &, Control *> {
98  public:
102  Control * operator()(const QPair<FileName, Progress *> &) const;
104 
105  private:
106  QThread *m_targetThread;
107  };
108  };
109 }
110 
111 #endif
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:57
void nullify()
Initializes members to NULL.
QFutureWatcher< Control * > * m_watcher
provides SIGNALS / SLOTS for FileNameToControlFunctor
ConcurrentControlNetReader()
Allocates memory at construction instead of as needed.
~ConcurrentControlNetReader()
This destructor will cancel all running threads and block.
QProgressBar with customizable text.
Definition: ProgressBar.h:15
This reads a control net in the background.