Isis Developer Reference
ConcurrentControlNetReader.h
Go to the documentation of this file.
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);
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:
87 FileNameToControlFunctor(QThread *);
88 FileNameToControlFunctor(const FileNameToControlFunctor &);
89 ~FileNameToControlFunctor();
90 Control * operator()(const QPair<FileName, Progress *> &) const;
91 FileNameToControlFunctor & operator=(const FileNameToControlFunctor &);
92
93 private:
94 QThread *m_targetThread;
95 };
96 };
97}
98
99#endif
This reads a control net in the background.
Definition ConcurrentControlNetReader.h:44
void read(QString filename)
Definition ConcurrentControlNetReader.cpp:79
ProgressBar * progressBar()
Definition ConcurrentControlNetReader.cpp:71
void networksReady(QList< Control * >)
ConcurrentControlNetReader()
Allocates memory at construction instead of as needed.
Definition ConcurrentControlNetReader.cpp:39
~ConcurrentControlNetReader()
This destructor will cancel all running threads and block.
Definition ConcurrentControlNetReader.cpp:56
This represents an ISIS control net in a project-based GUI interface.
Definition Control.h:66
Definition ProgressBar.h:15
This is free and unencumbered software released into the public domain.
Definition ConcurrentControlNetReader.h:21
This is free and unencumbered software released into the public domain.
Definition AbstractTableModel.h:24
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16