Isis 3 Programmer Reference
ConcurrentControlNetReader.h
1 #ifndef ConcurrentControlNetReader_h
2 #define ConcurrentControlNetReader_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QObject>
13 #include <QPair>
14 #include <QPointer>
15 #include <QString>
16 #include <QStringList>
17 
18 #include "ProgressBar.h"
19 
20 template<typename A> class QAtomicPointer;
21 template<typename A> class QFutureWatcher;
22 
23 namespace Isis {
24  class Control;
25  class FileName;
26  class Progress;
27  class ProgressBar;
28 
29 
44  Q_OBJECT
45 
46  public:
49  void read(QString filename);
50  void read(QStringList filenames);
51  ProgressBar *progressBar();
52 
53  signals:
54  void networksReady(QList<Control *>);
55 
56  private:
57  void nullify();
58  void start();
59 
60  private slots:
61  void updateProgressValue();
62  void mappedFinished();
63 
64  private:
65  void initProgress();
66 
67  private:
70  QStringList m_backlog;
71  bool m_mappedRunning;
72  QList<Progress *> m_progress;
73  QPointer<ProgressBar> m_progressBar;
74  QPointer<QTimer> m_progressUpdateTimer;
75 
83  class FileNameToControlFunctor : public std::unary_function<
84  const QPair<FileName, Progress *> &, Control *> {
85  public:
89  Control * operator()(const QPair<FileName, Progress *> &) const;
91 
92  private:
93  QThread *m_targetThread;
94  };
95  };
96 }
97 
98 #endif
Isis::ConcurrentControlNetReader::nullify
void nullify()
Initializes members to NULL.
Definition: ConcurrentControlNetReader.cpp:109
Isis::ConcurrentControlNetReader
This reads a control net in the background.
Definition: ConcurrentControlNetReader.h:43
QList< Control * >
Isis::ProgressBar
Definition: ProgressBar.h:15
Isis::ConcurrentControlNetReader::~ConcurrentControlNetReader
~ConcurrentControlNetReader()
This destructor will cancel all running threads and block.
Definition: ConcurrentControlNetReader.cpp:56
Isis::ConcurrentControlNetReader::ConcurrentControlNetReader
ConcurrentControlNetReader()
Allocates memory at construction instead of as needed.
Definition: ConcurrentControlNetReader.cpp:39
Isis::Control
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:66
QStringList
Isis::ConcurrentControlNetReader::FileNameToControlFunctor
Definition: ConcurrentControlNetReader.h:84
QThread
QPair
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:23
QFutureWatcher
This is free and unencumbered software released into the public domain.
Definition: AbstractTableModel.h:24
Isis::ConcurrentControlNetReader::read
void read(QString filename)
Definition: ConcurrentControlNetReader.cpp:79
QAtomicPointer
This is free and unencumbered software released into the public domain.
Definition: ConcurrentControlNetReader.h:20
QObject
Isis::ConcurrentControlNetReader::m_watcher
QFutureWatcher< Control * > * m_watcher
provides SIGNALS / SLOTS for FileNameToControlFunctor
Definition: ConcurrentControlNetReader.h:69
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16