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