63 QFutureInterface&
operator=(
const QFutureInterface& other);
74 inline void reportResults(
const QVector<ctkCmdLineModuleResult> &results,
int beginIndex = -1,
int count = -1);
84 QByteArray
outputData(
int position = 0,
int size = -1)
const;
85 QByteArray
errorData(
int position = 0,
int size = -1)
const;
89 friend struct ctkCmdLineModuleFutureWatcherPrivate;
91#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
92 QtConcurrent::ResultStore<ctkCmdLineModuleResult> &resultStore()
93 {
return static_cast<QtConcurrent::ResultStore<ctkCmdLineModuleResult> &
>(resultStoreBase()); }
94 const QtConcurrent::ResultStore<ctkCmdLineModuleResult> &resultStore()
const
95 {
return static_cast<const QtConcurrent::ResultStore<ctkCmdLineModuleResult> &
>(resultStoreBase()); }
96#elif (QT_VERSION < QT_VERSION_CHECK(5, 9, 0))
97 QtPrivate::ResultStore<ctkCmdLineModuleResult> &resultStore()
98 {
return static_cast<QtPrivate::ResultStore<ctkCmdLineModuleResult> &
>(resultStoreBase()); }
99 const QtPrivate::ResultStore<ctkCmdLineModuleResult> &resultStore()
const
100 {
return static_cast<const QtPrivate::ResultStore<ctkCmdLineModuleResult> &
>(resultStoreBase()); }
102 QtPrivate::ResultStoreBase &resultStore()
103 {
return static_cast<QtPrivate::ResultStoreBase &
>(resultStoreBase()); }
104 const QtPrivate::ResultStoreBase &resultStore()
const
105 {
return static_cast<const QtPrivate::ResultStoreBase &
>(resultStoreBase()); }
108 ctkCmdLineModuleFutureInterfacePrivate* d;
113 QMutexLocker locker(mutex());
114 if (this->queryState(Canceled) || this->queryState(Finished)) {
118#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
119 QtConcurrent::ResultStore<ctkCmdLineModuleResult> &store = resultStore();
120#elif (QT_VERSION < QT_VERSION_CHECK(5, 9, 0))
121 QtPrivate::ResultStore<ctkCmdLineModuleResult> &store = resultStore();
123 QtPrivate::ResultStoreBase &store = resultStore();
126 if (store.filterMode()) {
127 const int resultCountBefore = store.count();
128 store.addResult(index, result);
129 this->reportResultsReady(resultCountBefore, resultCountBefore + store.count());
131 const int insertIndex = store.addResult(index, result);
132 this->reportResultsReady(insertIndex, insertIndex + 1);
141inline void QFutureInterface<ctkCmdLineModuleResult>::reportResults(
const QVector<ctkCmdLineModuleResult> &_results,
int beginIndex,
int count)
143 QMutexLocker locker(mutex());
144 if (this->queryState(Canceled) || this->queryState(Finished)) {
148#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
149 QtConcurrent::ResultStore<ctkCmdLineModuleResult> &store = resultStore();
150#elif (QT_VERSION < QT_VERSION_CHECK(5, 9, 0))
151 QtPrivate::ResultStore<ctkCmdLineModuleResult> &store = resultStore();
153 QtPrivate::ResultStoreBase &store = resultStore();
156 if (store.filterMode()) {
157 const int resultCountBefore = store.count();
158 store.addResults(beginIndex, &_results, count);
159 this->reportResultsReady(resultCountBefore, store.count());
161 const int insertIndex = store.addResults(beginIndex, &_results, count);
162 this->reportResultsReady(insertIndex, insertIndex + _results.count());
195 if (this->isCanceled()) {
196 exceptionStore().throwPossibleException();
199 QFutureInterfaceBase::waitForResult(-1);
202 QMutexLocker lock(mutex());
204#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
205 QtConcurrent::ResultIterator<ctkCmdLineModuleResult> it = resultStore().begin();
206#elif (QT_VERSION < QT_VERSION_CHECK(5, 9, 0))
207 QtPrivate::ResultIterator<ctkCmdLineModuleResult> it = resultStore().begin();
209 QtPrivate::ResultIteratorBase it = resultStore().begin();
211 while (it != resultStore().end()) {
212#if (QT_VERSION < QT_VERSION_CHECK(5, 9, 0))
213 res.append(it.value());