Qt 4.8
|
The QtConcurrent namespace provides high-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives. More...
Namespaces | |
internal | |
The QtConcurrent::internal namespace contains QtConcurrent implementation details. | |
Classes | |
class | Exception |
The Exception class provides a base class for exceptions that can transferred across threads. More... | |
class | UnhandledException |
The UnhandledException class represents an unhandled exception in a worker thread. More... | |
Enumerations | |
enum | ReduceOption { UnorderedReduce = 0x1, OrderedReduce = 0x2, SequentialReduce = 0x4 } |
This enum specifies the order of which results from the map or filter function are passed to the reduce function. More... | |
Functions | |
void | blockingFilter (Sequence &sequence, FilterFunction filterFunction) |
Calls filterFunction once for each item in sequence. More... | |
template<typename Sequence > | |
Sequence | blockingFiltered (const Sequence &sequence, FilterFunction filterFunction) |
Calls filterFunction once for each item in sequence and returns a new Sequence of kept items. More... | |
template<typename Sequence > | |
Sequence | blockingFiltered (ConstIterator begin, ConstIterator end, FilterFunction filterFunction) |
Calls filterFunction once for each item from begin to end and returns a new Sequence of kept items. More... | |
template<typename T > | |
T | blockingFilteredReduced (const Sequence &sequence, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions=UnorderedReduce|SequentialReduce) |
Calls filterFunction once for each item in sequence. More... | |
template<typename T > | |
T | blockingFilteredReduced (ConstIterator begin, ConstIterator end, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions=UnorderedReduce|SequentialReduce) |
Calls filterFunction once for each item from begin to end. More... | |
void | blockingMap (Sequence &sequence, MapFunction function) |
Calls function once for each item in sequence. More... | |
void | blockingMap (Iterator begin, Iterator end, MapFunction function) |
Calls function once for each item from begin to end. More... | |
template<typename T > | |
T | blockingMapped (const Sequence &sequence, MapFunction function) |
Calls function once for each item in sequence and returns a Sequence containing the results. More... | |
template<typename T > | |
T | blockingMapped (ConstIterator begin, ConstIterator end, MapFunction function) |
Calls function once for each item from begin to end and returns a container with the results. More... | |
template<typename T > | |
T | blockingMappedReduced (const Sequence &sequence, MapFunction function, ReduceFunction function, QtConcurrent::ReduceOptions options=UnorderedReduce|SequentialReduce) |
template<typename T > | |
T | blockingMappedReduced (ConstIterator begin, ConstIterator end, MapFunction function, ReduceFunction function, QtConcurrent::ReduceOptions options=UnorderedReduce|SequentialReduce) |
QFuture< void > | filter (Sequence &sequence, FilterFunction filterFunction) |
template<typename T > | |
QFuture< T > | filtered (const Sequence &sequence, FilterFunction filterFunction) |
template<typename T > | |
QFuture< T > | filtered (ConstIterator begin, ConstIterator end, FilterFunction filterFunction) |
template<typename T > | |
QFuture< T > | filteredReduced (const Sequence &sequence, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions=UnorderedReduce|SequentialReduce) |
template<typename T > | |
QFuture< T > | filteredReduced (ConstIterator begin, ConstIterator end, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions=UnorderedReduce|SequentialReduce) |
QFuture< void > | map (Sequence &sequence, MapFunction function) |
QFuture< void > | map (Iterator begin, Iterator end, MapFunction function) |
template<typename T > | |
QFuture< T > | mapped (const Sequence &sequence, MapFunction function) |
template<typename T > | |
QFuture< T > | mapped (ConstIterator begin, ConstIterator end, MapFunction function) |
template<typename T > | |
QFuture< T > | mappedReduced (const Sequence &sequence, MapFunction function, ReduceFunction function, QtConcurrent::ReduceOptions options=UnorderedReduce|SequentialReduce) |
template<typename T > | |
QFuture< T > | mappedReduced (ConstIterator begin, ConstIterator end, MapFunction function, ReduceFunction function, QtConcurrent::ReduceOptions options=UnorderedReduce|SequentialReduce) |
template<typename T > | |
QFuture< T > | run (Function function,...) |
The QtConcurrent namespace provides high-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives.
See the Concurrent Programming {Qt Concurrent} chapter in the threading documentation.
QtCore
This enum specifies the order of which results from the map or filter function are passed to the reduce function.
Enumerator | |
---|---|
UnorderedReduce | |
OrderedReduce | |
SequentialReduce |
Definition at line 91 of file qtconcurrentreducekernel.h.
void QtConcurrent::blockingFilter | ( | Sequence & | sequence, |
FilterFunction | filterFunction | ||
) |
Calls filterFunction once for each item in sequence.
If filterFunction returns true, the item is kept in sequence; otherwise, the item is removed from sequence.
Sequence QtConcurrent::blockingFiltered | ( | const Sequence & | sequence, |
FilterFunction | filterFunction | ||
) |
Calls filterFunction once for each item in sequence and returns a new Sequence of kept items.
If filterFunction returns true, a copy of the item is put in the new Sequence. Otherwise, the item will not appear in the new Sequence.
Sequence QtConcurrent::blockingFiltered | ( | ConstIterator | begin, |
ConstIterator | end, | ||
FilterFunction | filterFunction | ||
) |
Calls filterFunction once for each item from begin to end and returns a new Sequence of kept items.
If filterFunction returns true, a copy of the item is put in the new Sequence. Otherwise, the item will not appear in the new Sequence.
T QtConcurrent::blockingFilteredReduced | ( | const Sequence & | sequence, |
FilterFunction | filterFunction, | ||
ReduceFunction | reduceFunction, | ||
QtConcurrent::ReduceOptions | reduceOptions = UnorderedReduce | SequentialReduce |
||
) |
Calls filterFunction once for each item in sequence.
If filterFunction returns true for an item, that item is then passed to reduceFunction. In other words, the return value is the result of reduceFunction for each item where filterFunction returns true.
Note that while filterFunction is called concurrently, only one thread at a time will call reduceFunction. The order in which reduceFunction is called is undefined if reduceOptions is QtConcurrent::UnorderedReduce. If reduceOptions is QtConcurrent::OrderedReduce, reduceFunction is called in the order of the original sequence.
T QtConcurrent::blockingFilteredReduced | ( | ConstIterator | begin, |
ConstIterator | end, | ||
FilterFunction | filterFunction, | ||
ReduceFunction | reduceFunction, | ||
QtConcurrent::ReduceOptions | reduceOptions = UnorderedReduce | SequentialReduce |
||
) |
Calls filterFunction once for each item from begin to end.
If filterFunction returns true for an item, that item is then passed to reduceFunction. In other words, the return value is the result of reduceFunction for each item where filterFunction returns true.
Note that while filterFunction is called concurrently, only one thread at a time will call reduceFunction. The order in which reduceFunction is called is undefined if reduceOptions is QtConcurrent::UnorderedReduce. If reduceOptions is QtConcurrent::OrderedReduce, the reduceFunction is called in the order of the original sequence.
void QtConcurrent::blockingMap | ( | Sequence & | sequence, |
MapFunction | function | ||
) |
Calls function once for each item in sequence.
The function is passed a reference to the item, so that any modifications done to the item will appear in sequence.
void QtConcurrent::blockingMap | ( | Iterator | begin, |
Iterator | end, | ||
MapFunction | function | ||
) |
Calls function once for each item from begin to end.
The function is passed a reference to the item, so that any modifications done to the item will appear in the sequence which the iterators belong to.
T QtConcurrent::blockingMapped | ( | const Sequence & | sequence, |
MapFunction | function | ||
) |
Calls function once for each item in sequence and returns a Sequence containing the results.
The type of the results will match the type returned my the MapFunction.
T QtConcurrent::blockingMapped | ( | ConstIterator | begin, |
ConstIterator | end, | ||
MapFunction | function | ||
) |
Calls function once for each item from begin to end and returns a container with the results.
Specify the type of container as the a template argument, like this:
T QtConcurrent::blockingMappedReduced | ( | const Sequence & | sequence, |
MapFunction | function, | ||
ReduceFunction | function, | ||
QtConcurrent::ReduceOptions | options = UnorderedReduce|SequentialReduce |
||
) |
T QtConcurrent::blockingMappedReduced | ( | ConstIterator | begin, |
ConstIterator | end, | ||
MapFunction | function, | ||
ReduceFunction | function, | ||
QtConcurrent::ReduceOptions | options = UnorderedReduce|SequentialReduce |
||
) |
QFuture<void> QtConcurrent::filter | ( | Sequence & | sequence, |
FilterFunction | filterFunction | ||
) |
Referenced by QAudioDeviceInfoInternal::availableDevices(), QPixmapConvolutionFilter::draw(), QPixmapBlurFilter::draw(), QPixmapColorizeFilter::draw(), QPixmapDropShadowFilter::draw(), QCompletionEngine::filterOnDemand(), QFileDialog::getOpenFileName(), QFileDialog::getOpenFileNames(), QFileDialog::getSaveFileName(), QWSDisplay::instance(), QStringList::operator<<(), QGLPixmapColorizeFilter::processGL(), QGLPixmapConvolutionFilter::processGL(), QGLPixmapDropShadowFilter::processGL(), QGraphicsColorizeEffectPrivate::QGraphicsColorizeEffectPrivate(), QSortedModelEngine::QSortedModelEngine(), QStringList::QStringList(), qt_clean_filter_list(), qt_win_resolve_libs(), QUnsortedModelEngine::QUnsortedModelEngine(), QNSOpenSavePanelDelegate::removeExtensions:, QGraphicsScenePrivate::removeSceneEventFilter(), QAbstractEventDispatcher::setEventFilter(), QCoreApplication::setEventFilter(), QDeclarativeDrag::setFilterChildren(), QWSDisplay::Data::setMouseFilter(), QFileDialog::setOptions(), QWSDisplay::setRawMouseEventFilter(), QDir::temp(), QWSServer::KeyboardFilter::~KeyboardFilter(), QCompletionEngine::~QCompletionEngine(), QGraphicsBlurEffectPrivate::~QGraphicsBlurEffectPrivate(), QGraphicsColorizeEffectPrivate::~QGraphicsColorizeEffectPrivate(), and QGraphicsDropShadowEffectPrivate::~QGraphicsDropShadowEffectPrivate().
QFuture<T> QtConcurrent::filtered | ( | const Sequence & | sequence, |
FilterFunction | filterFunction | ||
) |
Referenced by QCompletionModel::setFiltered().
QFuture<T> QtConcurrent::filtered | ( | ConstIterator | begin, |
ConstIterator | end, | ||
FilterFunction | filterFunction | ||
) |
QFuture<T> QtConcurrent::filteredReduced | ( | const Sequence & | sequence, |
FilterFunction | filterFunction, | ||
ReduceFunction | reduceFunction, | ||
QtConcurrent::ReduceOptions | reduceOptions = UnorderedReduce|SequentialReduce |
||
) |
QFuture<T> QtConcurrent::filteredReduced | ( | ConstIterator | begin, |
ConstIterator | end, | ||
FilterFunction | filterFunction, | ||
ReduceFunction | reduceFunction, | ||
QtConcurrent::ReduceOptions | reduceOptions = UnorderedReduce|SequentialReduce |
||
) |
QFuture<void> QtConcurrent::map | ( | Sequence & | sequence, |
MapFunction | function | ||
) |
Referenced by QGLBuffer::allocate(), QSqlQuery::boundValues(), buildReverseMap(), QDirectFBCursor::changeCursor(), ShaderEffectItem::connectPropertySignals(), NamedNodeMap::create(), QMatrix::det(), QGraphicsItem::deviceTransform(), QMatrix::dy(), QtopiaPrintEngine::end(), QScanThread::getUserConfigurations(), QGraphicsSceneIndexPointIntersector::intersect(), QGraphicsSceneIndexPathIntersector::intersect(), operator<<(), QTextFormat::properties(), QMatrix4x4::QMatrix4x4(), qt_bitmapblit_quint16(), qt_bitmapblit_quint32(), QTransform::QTransform(), qtValue(), QVariant::QVariant(), QPainter::setViewTransformEnabled(), QNmDBusHelper::slotPropertiesChanged(), QPainter::testRenderHint(), and QMap< int, QFrameInfo >::toStdMap().
QFuture<void> QtConcurrent::map | ( | Iterator | begin, |
Iterator | end, | ||
MapFunction | function | ||
) |
QFuture<T> QtConcurrent::mapped | ( | const Sequence & | sequence, |
MapFunction | function | ||
) |
QFuture<T> QtConcurrent::mapped | ( | ConstIterator | begin, |
ConstIterator | end, | ||
MapFunction | function | ||
) |
QFuture<T> QtConcurrent::mappedReduced | ( | const Sequence & | sequence, |
MapFunction | function, | ||
ReduceFunction | function, | ||
QtConcurrent::ReduceOptions | options = UnorderedReduce|SequentialReduce |
||
) |
QFuture<T> QtConcurrent::mappedReduced | ( | ConstIterator | begin, |
ConstIterator | end, | ||
MapFunction | function, | ||
ReduceFunction | function, | ||
QtConcurrent::ReduceOptions | options = UnorderedReduce|SequentialReduce |
||
) |
QFuture<T> QtConcurrent::run | ( | Function | function, |
... | |||
) |
Referenced by QEventDispatcherMac::flush(), QWindowsPipeWriter::hadWritten(), QEventDispatcherMac::processEvents(), SelectWorker::retVal(), QDeclarativeVME::run(), QDeclarativeCompiledBindingsPrivate::run(), QDeclarativeVME::runDeferred(), QCocoaEventLoopIntegration::startEventLoop(), QHostInfoLookupManager::waitForThreadPoolDone(), WinMain(), QIntKeyboardListenThread::~QIntKeyboardListenThread(), and QIntMouseListenThread::~QIntMouseListenThread().