47 #include <QtCore/qatomic.h> 48 #include <QtCore/qthread.h> 49 #include <QtCore/qthreadpool.h> 50 #include <private/qthreadpool_p.h> 240 #ifndef QT_NO_EXCEPTIONS 279 return (
d->
state & state);
298 const int waitIndex = (resultIndex == -1) ?
INT_MAX : resultIndex;
423 : refCount(1), m_progressValue(0), m_progressMinimum(0), m_progressMaximum(0),
424 state(initialState), pendingResults(0),
425 manualProgress(false), m_expectedResultCount(0), runnable(0)
472 || (!enable && !(
state & QFutureInterfaceBase::Throttled)))
502 interface->postCallOutEvent(callOutEvent1);
503 interface->postCallOutEvent(callOutEvent2);
525 QtConcurrent::ResultIteratorBase
it =
m_results.begin();
527 const int begin = it.resultIndex();
528 const int end = begin + it.batchSize();
565 #endif // QT_NO_CONCURRENT QWaitCondition waitCondition
void releaseThread()
Releases a thread previously reserved by a call to reserveThread().
void throwPossibleException()
bool internal_isResultReadyAt(int index) const
void setProgressValueAndText(int progressValue, const QString &progressText)
QString progressText() const
Returns the (optional) textual representation of the progress as reported by the asynchronous computa...
#define QT_END_NAMESPACE
This macro expands to.
The QMutex class provides access serialization between threads.
int internal_resultCount() const
void setProgressValue(int progressValue)
bool isResultReadyAt(int index) const
void sendCallOuts(const QFutureCallOutEvent &callOut1, const QFutureCallOutEvent &callOut2)
#define it(className, varName)
QFutureInterfaceBase(State initialState=NoState)
bool internal_waitForNextResult()
void setFilterMode(bool enable)
QtConcurrent::ResultStoreBase m_results
int progressMaximum() const
virtual void postCallOutEvent(const QFutureCallOutEvent &)=0
bool queryState(State state) const
bool isValid() const
Returns false if this object was invalidated by a call to invalidate() and has not been restarted sin...
QString progressText() const
int count(const T &t) const
Returns the number of occurrences of value in the list.
QFutureInterfaceBase::State state
int expectedResultCount()
bool ref()
Atomically increments the value of this QAtomicInt.
void setProgressRange(int minimum, int maximum)
QFutureInterfaceBasePrivate * d
The QString class provides a Unicode character string.
void sendCallOut(const QFutureCallOutEvent &callOut)
The QRunnable class is the base class for all runnable objects.
int progressValue() const
QtConcurrent::internal::ExceptionStore & exceptionStore()
qint64 elapsed() const
Returns the number of milliseconds since this QElapsedTimer was last started.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
bool referenceCountIsOne() const
void append(const T &t)
Inserts value at the end of the list.
QtConcurrent::internal::ExceptionStore m_exceptionStore
#define QT_BEGIN_NAMESPACE
This macro expands to.
void disconnectOutputInterface(QFutureCallOutInterface *iface)
const T & at(int i) const
Returns the item at index position i in the list.
bool deref()
Atomically decrements the value of this QAtomicInt.
void reportException(const QtConcurrent::Exception &e)
void setRunnable(QRunnable *runnable)
void setPaused(bool paused)
void internal_setThrottled(bool enable)
void invalidate()
Marks this QElapsedTimer object as invalid.
void setExpectedResultCount(int resultCount)
The State element defines configurations of objects and properties.
QList< QFutureCallOutInterface * > outputConnections
bool wait(QMutex *mutex, unsigned long time=ULONG_MAX)
QFutureInterfaceBasePrivate(QFutureInterfaceBase::State initialState)
int m_expectedResultCount
void connectOutputInterface(QFutureCallOutInterface *iface)
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
virtual void callOutInterfaceDisconnected()=0
int progressMinimum() const
The Exception class provides a base class for exceptions that can transferred across threads...
static QReadWriteLock lock
QFutureInterfaceBase & operator=(const QFutureInterfaceBase &other)
void waitForResult(int resultIndex)
static QThreadPool * globalInstance()
Returns the global QThreadPool instance.
void setState(QFutureInterfaceBase::State state)
void setException(const Exception &e)
bool isProgressUpdateNeeded() const
void paused()
This signal is emitted when the watched future is paused.
void reportResultsReady(int beginIndex, int endIndex)
bool internal_updateProgress(int progress, const QString &progressText=QString())
static const KeyPair *const end
void setThrottled(bool enable)
QtConcurrent::ResultStoreBase & resultStoreBase()
void start()
Starts this timer.
QWaitCondition pausedWaitCondition
virtual ~QFutureInterfaceBase()
QElapsedTimer progressTime
void reserveThread()
Reserves one thread, disregarding activeThreadCount() and maxThreadCount().
void removeAt(int i)
Removes the item at index position i.