45 #include <QtCore/qglobal.h> 49 #include <QtCore/qfutureinterface.h> 50 #include <QtCore/qstring.h> 51 #include <QtCore/qtconcurrentcompilertest.h> 129 if (index == -1 && other.
index == -1)
131 if (other.
index == -1)
133 return (index != other.
index);
164 template <
typename T>
171 template <
typename T>
175 return d.resultReference(0);
178 template <
typename T>
181 d.waitForResult(index);
182 return d.resultReference(index);
185 template <
typename T>
213 #if !defined(Q_CC_XLC) 214 template <
typename T>
219 template <
typename T>
230 void setPaused(
bool paused) {
d.setPaused(paused); }
231 bool isPaused()
const {
return d.isPaused(); }
236 bool isStarted()
const {
return d.isStarted(); }
238 bool isRunning()
const {
return d.isRunning(); }
267 template <
typename T>
276 #endif // QT_NO_CONCURRENT T value_type
Typedef for T.
const_iterator operator++(int)
The postfix ++ operator (it++) advances the iterator to the next result in the future and returns an ...
int resultCount() const
Returns the number of continuous results available in this future.
bool isCanceled() const
Returns true if the asynchronous computation has been canceled with the cancel() function; otherwise ...
QFuture< void > qToVoidFuture(const QFuture< T > &future)
QFuture(QFutureInterface< T > *p)
#define QT_END_NAMESPACE
This macro expands to.
void resume()
Resumes the asynchronous computation represented by this future.
bool operator!=(const const_iterator &other) const
Returns true if other points to a different result than this iterator; otherwise returns false...
bool operator==(const const_iterator &o) const
Returns true if other points to the same result as this iterator; otherwise returns false...
const_iterator end() const
Returns a const STL-style iterator pointing to the imaginary result after the last result in the futu...
~QFuture()
Destroys the future.
const T & reference
Typedef for const T &.
void togglePaused()
Toggles the paused state of the asynchronous computation.
The QString class provides a Unicode character string.
const_iterator(const const_iterator &o)
Constructs a copy of other.
void cancel()
Cancels the asynchronous computation represented by this future.
void pause()
Pauses the asynchronous computation represented by this future.
void waitForFinished()
Waits for the asynchronous computation to finish (including cancel()ed computations).
void setPaused(bool paused)
If paused is true, this function pauses the asynchronous computation represented by the future...
const_iterator()
Constructs an uninitialized iterator.
const_iterator & operator++()
The prefix ++ operator (++it) advances the iterator to the next result in the future and returns an i...
#define QT_BEGIN_NAMESPACE
This macro expands to.
#define Q_DECLARE_SEQUENTIAL_ITERATOR(C)
int progressMaximum() const
Returns the maximum progressValue().
QIntegerForSizeof< void * >::Signed qptrdiff
T resultAt(int index) const
Returns the result at index in the future.
bool isPaused() const
Returns true if the asynchronous computation has been paused with the pause() function; otherwise ret...
qptrdiff difference_type
Typedef for ptrdiff_t.
const T * operator->() const
Returns a pointer to the current result.
bool operator==(const QFuture &other) const
Returns true if other is a copy of this future; otherwise returns false.
const_iterator operator+(int j) const
Returns an iterator to the results at j positions forward from this iterator.
T result() const
Returns the first result in the future.
const_iterator & operator--()
The prefix – operator (–it) makes the preceding result current and returns an iterator to the new c...
QFuture()
Constructs an empty future.
const_iterator operator--(int)
The postfix – operator (it–) makes the preceding result current and returns an iterator to the prev...
int progressValue() const
Returns the current progress value, which is between the progressMinimum() and progressMaximum().
QFuture(const QFuture &other)
Constructs a copy of other.
int progressMinimum() const
Returns the minimum progressValue().
The QFuture class represents the result of an asynchronous computation.
The QFuture::const_iterator class provides an STL-style const iterator for QFuture.
bool isStarted() const
Returns true if the asynchronous computation represented by this future has been started; otherwise r...
const T * pointer
Typedef for const T *.
const_iterator & operator+=(int j)
Advances the iterator by j results.
bool isRunning() const
Returns true if the asynchronous computation represented by this future is currently running; otherwi...
const_iterator begin() const
Returns a const STL-style iterator pointing to the first result in the future.
const_iterator & operator-=(int j)
Makes the iterator go back by j results.
QString progressText() const
Returns the (optional) textual representation of the progress as reported by the asynchronous computa...
bool operator!=(const QFuture &other) const
Returns true if other is not a copy of this future; otherwise returns false.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first result in the future.
std::bidirectional_iterator_tag iterator_category
Typedef for std::bidirectional_iterator_tag.
QFuture & operator=(const QFuture &other)
Assigns other to this future and returns a reference to this future.
const_iterator(QFuture const *const _future, int _index)
const_iterator operator-(int j) const
Returns an iterator to the result at j positions backward from this iterator.
const_iterator ConstIterator
Qt-style synonym for QFuture::const_iterator.
bool isResultReadyAt(int resultIndex) const
Returns true if the result at index is immediately available; otherwise returns false.
QList< T > results() const
Returns all results from the future.
bool isFinished() const
Returns true if the asynchronous computation represented by this future has finished; otherwise retur...
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary result after the last result in the futu...
The QList class is a template class that provides lists.
const T & operator*() const
Returns the current result.
const_iterator & operator=(const const_iterator &o)
Assigns other to this iterator.
The QFutureWatcher class allows monitoring a QFuture using signals and slots.