Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 74

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtconcurrentmap.cpp -->
  <title>QtConcurrent Namespace | Qt Concurrent 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtconcurrent-index.html">Qt Concurrent</a></td><td >QtConcurrent Namespace</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#types">Types</a></li>
<li class="level1"><a href="#functions">Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QtConcurrent Namespace</h1>
<!-- $$$QtConcurrent-brief -->
<p>The <a href="qtconcurrent-module.html">QtConcurrent</a> namespace provides high-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives. <a href="#details">More...</a></p>
<!-- @@@QtConcurrent -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QtConcurrent&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += concurrent</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.4</td></tr></table></div><ul>
<li><a href="qtconcurrent-obsolete.html">Obsolete members</a></li>
</ul>
<a name="types"></a>
<h2 id="types">Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#ReduceOption-enum">ReduceOption</a></b> { UnorderedReduce, OrderedReduce, SequentialReduce }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#ReduceOption-enum">ReduceOptions</a></b></td></tr>
</table></div>
<a name="functions"></a>
<h2 id="functions">Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingFilter">blockingFilter</a></b>(Sequence &amp;<i>sequence</i>, FilterFunction <i>filterFunction</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Sequence </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingFiltered">blockingFiltered</a></b>(const Sequence &amp;<i>sequence</i>, FilterFunction <i>filterFunction</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Sequence </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingFiltered-1">blockingFiltered</a></b>(ConstIterator <i>begin</i>, ConstIterator <i>end</i>, FilterFunction <i>filterFunction</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingFilteredReduced">blockingFilteredReduced</a></b>(const Sequence &amp;<i>sequence</i>, FilterFunction <i>filterFunction</i>, ReduceFunction <i>reduceFunction</i>, QtConcurrent::ReduceOptions <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingFilteredReduced-1">blockingFilteredReduced</a></b>(ConstIterator <i>begin</i>, ConstIterator <i>end</i>, FilterFunction <i>filterFunction</i>, ReduceFunction <i>reduceFunction</i>, QtConcurrent::ReduceOptions <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingMap">blockingMap</a></b>(Sequence &amp;<i>sequence</i>, MapFunction <i>function</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingMap-1">blockingMap</a></b>(Iterator <i>begin</i>, Iterator <i>end</i>, MapFunction <i>function</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingMapped">blockingMapped</a></b>(const Sequence &amp;<i>sequence</i>, MapFunction <i>function</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingMapped-1">blockingMapped</a></b>(ConstIterator <i>begin</i>, ConstIterator <i>end</i>, MapFunction <i>function</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingMappedReduced">blockingMappedReduced</a></b>(const Sequence &amp;<i>sequence</i>, MapFunction <i>mapFunction</i>, ReduceFunction <i>reduceFunction</i>, QtConcurrent::ReduceOptions <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#blockingMappedReduced-1">blockingMappedReduced</a></b>(ConstIterator <i>begin</i>, ConstIterator <i>end</i>, MapFunction <i>mapFunction</i>, ReduceFunction <i>reduceFunction</i>, QtConcurrent::ReduceOptions <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;void&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#filter">filter</a></b>(Sequence &amp;<i>sequence</i>, FilterFunction <i>filterFunction</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#filtered">filtered</a></b>(const Sequence &amp;<i>sequence</i>, FilterFunction <i>filterFunction</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#filtered-1">filtered</a></b>(ConstIterator <i>begin</i>, ConstIterator <i>end</i>, FilterFunction <i>filterFunction</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#filteredReduced">filteredReduced</a></b>(const Sequence &amp;<i>sequence</i>, FilterFunction <i>filterFunction</i>, ReduceFunction <i>reduceFunction</i>, QtConcurrent::ReduceOptions <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#filteredReduced-1">filteredReduced</a></b>(ConstIterator <i>begin</i>, ConstIterator <i>end</i>, FilterFunction <i>filterFunction</i>, ReduceFunction <i>reduceFunction</i>, QtConcurrent::ReduceOptions <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;void&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#map">map</a></b>(Sequence &amp;<i>sequence</i>, MapFunction <i>function</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;void&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#map-1">map</a></b>(Iterator <i>begin</i>, Iterator <i>end</i>, MapFunction <i>function</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#mapped">mapped</a></b>(const Sequence &amp;<i>sequence</i>, MapFunction <i>function</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#mapped-1">mapped</a></b>(ConstIterator <i>begin</i>, ConstIterator <i>end</i>, MapFunction <i>function</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#mappedReduced">mappedReduced</a></b>(const Sequence &amp;<i>sequence</i>, MapFunction <i>mapFunction</i>, ReduceFunction <i>reduceFunction</i>, QtConcurrent::ReduceOptions <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#mappedReduced-1">mappedReduced</a></b>(ConstIterator <i>begin</i>, ConstIterator <i>end</i>, MapFunction <i>mapFunction</i>, ReduceFunction <i>reduceFunction</i>, QtConcurrent::ReduceOptions <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#run">run</a></b>(Function <i>function</i>, <i>...</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtconcurrent.html#run-1">run</a></b>(QThreadPool *<i>pool</i>, Function <i>function</i>, <i>...</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QtConcurrent-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qtconcurrent-module.html">QtConcurrent</a> namespace provides high-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives.</p>
<p>See the <a href="qtconcurrent-index.html">Qt Concurrent</a> module documentation for an overview of available functions, or see below for detailed information on each function.</p>
</div>
<!-- @@@QtConcurrent -->
<div class="types">
<h2>Type Documentation</h2>
<!-- $$$ReduceOption$$$UnorderedReduce$$$OrderedReduce$$$SequentialReduce -->
<h3 class="flags" id="ReduceOption-enum"><a name="ReduceOption-enum"></a>enum QtConcurrent::<span class="name">ReduceOption</span><br/>flags QtConcurrent::<span class="name">ReduceOptions</span></h3>
<p>This enum specifies the order of which results from the map or filter function are passed to the reduce function.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QtConcurrent::UnorderedReduce</code></td><td class="topAlign tblval"><code>0x1</code></td><td class="topAlign">Reduction is done in an arbitrary order.</td></tr>
<tr><td class="topAlign"><code>QtConcurrent::OrderedReduce</code></td><td class="topAlign tblval"><code>0x2</code></td><td class="topAlign">Reduction is done in the order of the original sequence.</td></tr>
<tr><td class="topAlign"><code>QtConcurrent::SequentialReduce</code></td><td class="topAlign tblval"><code>0x4</code></td><td class="topAlign">Reduction is done sequentially: only one thread will enter the reduce function at a time. (Parallel reduction might be supported in a future version of Qt Concurrent.)</td></tr>
</table></div>
<p>The ReduceOptions type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;ReduceOption&gt;. It stores an OR combination of ReduceOption values.</p>
<!-- @@@ReduceOption -->
</div>
<div class="func">
<h2>Function Documentation</h2>
<!-- $$$blockingFilter[overload1]$$$blockingFilterSequence&FilterFunction -->
<h3 class="fn" id="blockingFilter"><a name="blockingFilter"></a><span class="type">void</span> QtConcurrent::<span class="name">blockingFilter</span>(<span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">FilterFunction</span> <i>filterFunction</i>)</h3>
<p>Calls <i>filterFunction</i> once for each item in <i>sequence</i>. If <i>filterFunction</i> returns <code>true</code>, the item is kept in <i>sequence</i>; otherwise, the item is removed from <i>sequence</i>.</p>
<p><b>Note: </b>This function will block until all items in the sequence have been processed.</p><p><b>See also </b><a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a>.</p>
<!-- @@@blockingFilter -->
<!-- $$$blockingFiltered[overload1]$$$blockingFilteredconstSequence&FilterFunction -->
<h3 class="fn" id="blockingFiltered"><a name="blockingFiltered"></a><span class="type">Sequence</span> QtConcurrent::<span class="name">blockingFiltered</span>(const <span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">FilterFunction</span> <i>filterFunction</i>)</h3>
<p>Calls <i>filterFunction</i> once for each item in <i>sequence</i> and returns a new Sequence of kept items. If <i>filterFunction</i> returns <code>true</code>, a copy of the item is put in the new Sequence. Otherwise, the item will <i>not</i> appear in the new Sequence.</p>
<p><b>Note: </b>This function will block until all items in the sequence have been processed.</p><p><b>See also </b><a href="qtconcurrent.html#filtered">filtered</a>() and <a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a>.</p>
<!-- @@@blockingFiltered -->
<!-- $$$blockingFiltered$$$blockingFilteredConstIteratorConstIteratorFilterFunction -->
<h3 class="fn" id="blockingFiltered-1"><a name="blockingFiltered-1"></a><span class="type">Sequence</span> QtConcurrent::<span class="name">blockingFiltered</span>(<span class="type">ConstIterator</span> <i>begin</i>, <span class="type">ConstIterator</span> <i>end</i>, <span class="type">FilterFunction</span> <i>filterFunction</i>)</h3>
<p>Calls <i>filterFunction</i> once for each item from <i>begin</i> to <i>end</i> and returns a new Sequence of kept items. If <i>filterFunction</i> returns <code>true</code>, a copy of the item is put in the new Sequence. Otherwise, the item will <i>not</i> appear in the new Sequence.</p>
<p><b>Note: </b>This function will block until the iterator reaches the end of the sequence being processed.</p><p><b>See also </b><a href="qtconcurrent.html#filtered">filtered</a>() and <a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a>.</p>
<!-- @@@blockingFiltered -->
<!-- $$$blockingFilteredReduced[overload1]$$$blockingFilteredReducedconstSequence&FilterFunctionReduceFunctionQtConcurrent::ReduceOptions -->
<h3 class="fn" id="blockingFilteredReduced"><a name="blockingFilteredReduced"></a><span class="type">T</span> QtConcurrent::<span class="name">blockingFilteredReduced</span>(const <span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">FilterFunction</span> <i>filterFunction</i>, <span class="type">ReduceFunction</span> <i>reduceFunction</i>, <span class="type">QtConcurrent::ReduceOptions</span> <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</h3>
<p>Calls <i>filterFunction</i> once for each item in <i>sequence</i>. If <i>filterFunction</i> returns <code>true</code> for an item, that item is then passed to <i>reduceFunction</i>. In other words, the return value is the result of <i>reduceFunction</i> for each item where <i>filterFunction</i> returns <code>true</code>.</p>
<p>Note that while <i>filterFunction</i> is called concurrently, only one thread at a time will call <i>reduceFunction</i>. The order in which <i>reduceFunction</i> is called is undefined if <i>reduceOptions</i> is <a href="qtconcurrent.html#ReduceOption-enum">QtConcurrent::UnorderedReduce</a>. If <i>reduceOptions</i> is <a href="qtconcurrent.html#ReduceOption-enum">QtConcurrent::OrderedReduce</a>, <i>reduceFunction</i> is called in the order of the original sequence.</p>
<p><b>Note: </b>This function will block until all items in the sequence have been processed.</p><p><b>See also </b><a href="qtconcurrent.html#filteredReduced">filteredReduced</a>() and <a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a>.</p>
<!-- @@@blockingFilteredReduced -->
<!-- $$$blockingFilteredReduced$$$blockingFilteredReducedConstIteratorConstIteratorFilterFunctionReduceFunctionQtConcurrent::ReduceOptions -->
<h3 class="fn" id="blockingFilteredReduced-1"><a name="blockingFilteredReduced-1"></a><span class="type">T</span> QtConcurrent::<span class="name">blockingFilteredReduced</span>(<span class="type">ConstIterator</span> <i>begin</i>, <span class="type">ConstIterator</span> <i>end</i>, <span class="type">FilterFunction</span> <i>filterFunction</i>, <span class="type">ReduceFunction</span> <i>reduceFunction</i>, <span class="type">QtConcurrent::ReduceOptions</span> <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</h3>
<p>Calls <i>filterFunction</i> once for each item from <i>begin</i> to <i>end</i>. If <i>filterFunction</i> returns <code>true</code> for an item, that item is then passed to <i>reduceFunction</i>. In other words, the return value is the result of <i>reduceFunction</i> for each item where <i>filterFunction</i> returns <code>true</code>.</p>
<p>Note that while <i>filterFunction</i> is called concurrently, only one thread at a time will call <i>reduceFunction</i>. The order in which <i>reduceFunction</i> is called is undefined if <i>reduceOptions</i> is <a href="qtconcurrent.html#ReduceOption-enum">QtConcurrent::UnorderedReduce</a>. If <i>reduceOptions</i> is <a href="qtconcurrent.html#ReduceOption-enum">QtConcurrent::OrderedReduce</a>, the <i>reduceFunction</i> is called in the order of the original sequence.</p>
<p><b>Note: </b>This function will block until the iterator reaches the end of the sequence being processed.</p><p><b>See also </b><a href="qtconcurrent.html#filteredReduced">filteredReduced</a>() and <a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a>.</p>
<!-- @@@blockingFilteredReduced -->
<!-- $$$blockingMap[overload1]$$$blockingMapSequence&MapFunction -->
<h3 class="fn" id="blockingMap"><a name="blockingMap"></a><span class="type">void</span> QtConcurrent::<span class="name">blockingMap</span>(<span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">MapFunction</span> <i>function</i>)</h3>
<p>Calls <i>function</i> once for each item in <i>sequence</i>. The <i>function</i> is passed a reference to the item, so that any modifications done to the item will appear in <i>sequence</i>.</p>
<p><b>Note: </b>This function will block until all items in the sequence have been processed.</p><p><b>See also </b><a href="qtconcurrent.html#map">map</a>() and <a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@blockingMap -->
<!-- $$$blockingMap$$$blockingMapIteratorIteratorMapFunction -->
<h3 class="fn" id="blockingMap-1"><a name="blockingMap-1"></a><span class="type">void</span> QtConcurrent::<span class="name">blockingMap</span>(<span class="type">Iterator</span> <i>begin</i>, <span class="type">Iterator</span> <i>end</i>, <span class="type">MapFunction</span> <i>function</i>)</h3>
<p>Calls <i>function</i> once for each item from <i>begin</i> to <i>end</i>. The <i>function</i> 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.</p>
<p><b>Note: </b>This function will block until the iterator reaches the end of the sequence being processed.</p><p><b>See also </b><a href="qtconcurrent.html#map">map</a>() and <a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@blockingMap -->
<!-- $$$blockingMapped[overload1]$$$blockingMappedconstSequence&MapFunction -->
<h3 class="fn" id="blockingMapped"><a name="blockingMapped"></a><span class="type">T</span> QtConcurrent::<span class="name">blockingMapped</span>(const <span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">MapFunction</span> <i>function</i>)</h3>
<p>Calls <i>function</i> once for each item in <i>sequence</i> and returns a Sequence containing the results. The type of the results will match the type returned my the MapFunction.</p>
<p><b>Note: </b>This function will block until all items in the sequence have been processed.</p><p><b>See also </b><a href="qtconcurrent.html#mapped">mapped</a>() and <a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@blockingMapped -->
<!-- $$$blockingMapped$$$blockingMappedConstIteratorConstIteratorMapFunction -->
<h3 class="fn" id="blockingMapped-1"><a name="blockingMapped-1"></a><span class="type">T</span> QtConcurrent::<span class="name">blockingMapped</span>(<span class="type">ConstIterator</span> <i>begin</i>, <span class="type">ConstIterator</span> <i>end</i>, <span class="type">MapFunction</span> <i>function</i>)</h3>
<p>Calls <i>function</i> once for each item from <i>begin</i> to <i>end</i> and returns a container with the results. Specify the type of container as the a template argument, like this:</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qlist.html">QList</a></span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">&gt;</span> ints <span class="operator">=</span> <span class="type"><a href="qtconcurrent-module.html">QtConcurrent</a></span><span class="operator">::</span>blockingMapped<span class="operator">&lt;</span><span class="type"><a href="../qtcore/qlist.html">QList</a></span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">&gt;</span> <span class="operator">&gt;</span>(beginIterator<span class="operator">,</span> endIterator<span class="operator">,</span> fn);

</pre>
<p><b>Note: </b>This function will block until the iterator reaches the end of the sequence being processed.</p><p><b>See also </b><a href="qtconcurrent.html#mapped">mapped</a>() and <a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@blockingMapped -->
<!-- $$$blockingMappedReduced[overload1]$$$blockingMappedReducedconstSequence&MapFunctionReduceFunctionQtConcurrent::ReduceOptions -->
<h3 class="fn" id="blockingMappedReduced"><a name="blockingMappedReduced"></a><span class="type">T</span> QtConcurrent::<span class="name">blockingMappedReduced</span>(const <span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">MapFunction</span> <i>mapFunction</i>, <span class="type">ReduceFunction</span> <i>reduceFunction</i>, <span class="type">QtConcurrent::ReduceOptions</span> <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</h3>
<p>Calls <i>mapFunction</i> once for each item in <i>sequence</i>. The return value of each <i>mapFunction</i> is passed to <i>reduceFunction</i>.</p>
<p>Note that while <i>mapFunction</i> is called concurrently, only one thread at a time will call <i>reduceFunction</i>. The order in which <i>reduceFunction</i> is called is determined by <i>reduceOptions</i>.</p>
<p><b>Note: </b>This function will block until all items in the sequence have been processed.</p><p><b>See also </b><a href="qtconcurrent.html#mapped">mapped</a>() and <a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@blockingMappedReduced -->
<!-- $$$blockingMappedReduced$$$blockingMappedReducedConstIteratorConstIteratorMapFunctionReduceFunctionQtConcurrent::ReduceOptions -->
<h3 class="fn" id="blockingMappedReduced-1"><a name="blockingMappedReduced-1"></a><span class="type">T</span> QtConcurrent::<span class="name">blockingMappedReduced</span>(<span class="type">ConstIterator</span> <i>begin</i>, <span class="type">ConstIterator</span> <i>end</i>, <span class="type">MapFunction</span> <i>mapFunction</i>, <span class="type">ReduceFunction</span> <i>reduceFunction</i>, <span class="type">QtConcurrent::ReduceOptions</span> <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</h3>
<p>Calls <i>mapFunction</i> once for each item from <i>begin</i> to <i>end</i>. The return value of each <i>mapFunction</i> is passed to <i>reduceFunction</i>.</p>
<p>Note that while <i>mapFunction</i> is called concurrently, only one thread at a time will call <i>reduceFunction</i>. The order in which <i>reduceFunction</i> is called is undefined.</p>
<p><b>Note: </b>This function will block until the iterator reaches the end of the sequence being processed.</p><p><b>See also </b><a href="qtconcurrent.html#blockingMappedReduced">blockingMappedReduced</a>() and <a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@blockingMappedReduced -->
<!-- $$$filter[overload1]$$$filterSequence&FilterFunction -->
<h3 class="fn" id="filter"><a name="filter"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">void</span>&gt; QtConcurrent::<span class="name">filter</span>(<span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">FilterFunction</span> <i>filterFunction</i>)</h3>
<p>Calls <i>filterFunction</i> once for each item in <i>sequence</i>. If <i>filterFunction</i> returns <code>true</code>, the item is kept in <i>sequence</i>; otherwise, the item is removed from <i>sequence</i>.</p>
<p><b>See also </b><a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a>.</p>
<!-- @@@filter -->
<!-- $$$filtered[overload1]$$$filteredconstSequence&FilterFunction -->
<h3 class="fn" id="filtered"><a name="filtered"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">T</span>&gt; QtConcurrent::<span class="name">filtered</span>(const <span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">FilterFunction</span> <i>filterFunction</i>)</h3>
<p>Calls <i>filterFunction</i> once for each item in <i>sequence</i> and returns a new Sequence of kept items. If <i>filterFunction</i> returns <code>true</code>, a copy of the item is put in the new Sequence. Otherwise, the item will <i>not</i> appear in the new Sequence.</p>
<p><b>See also </b><a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a>.</p>
<!-- @@@filtered -->
<!-- $$$filtered$$$filteredConstIteratorConstIteratorFilterFunction -->
<h3 class="fn" id="filtered-1"><a name="filtered-1"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">T</span>&gt; QtConcurrent::<span class="name">filtered</span>(<span class="type">ConstIterator</span> <i>begin</i>, <span class="type">ConstIterator</span> <i>end</i>, <span class="type">FilterFunction</span> <i>filterFunction</i>)</h3>
<p>Calls <i>filterFunction</i> once for each item from <i>begin</i> to <i>end</i> and returns a new Sequence of kept items. If <i>filterFunction</i> returns <code>true</code>, a copy of the item is put in the new Sequence. Otherwise, the item will <i>not</i> appear in the new Sequence.</p>
<p><b>See also </b><a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a>.</p>
<!-- @@@filtered -->
<!-- $$$filteredReduced[overload1]$$$filteredReducedconstSequence&FilterFunctionReduceFunctionQtConcurrent::ReduceOptions -->
<h3 class="fn" id="filteredReduced"><a name="filteredReduced"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">T</span>&gt; QtConcurrent::<span class="name">filteredReduced</span>(const <span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">FilterFunction</span> <i>filterFunction</i>, <span class="type">ReduceFunction</span> <i>reduceFunction</i>, <span class="type">QtConcurrent::ReduceOptions</span> <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</h3>
<p>Calls <i>filterFunction</i> once for each item in <i>sequence</i>. If <i>filterFunction</i> returns <code>true</code> for an item, that item is then passed to <i>reduceFunction</i>. In other words, the return value is the result of <i>reduceFunction</i> for each item where <i>filterFunction</i> returns <code>true</code>.</p>
<p>Note that while <i>filterFunction</i> is called concurrently, only one thread at a time will call <i>reduceFunction</i>. The order in which <i>reduceFunction</i> is called is undefined if <i>reduceOptions</i> is <a href="qtconcurrent.html#ReduceOption-enum">QtConcurrent::UnorderedReduce</a>. If <i>reduceOptions</i> is <a href="qtconcurrent.html#ReduceOption-enum">QtConcurrent::OrderedReduce</a>, <i>reduceFunction</i> is called in the order of the original sequence.</p>
<p><b>See also </b><a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a>.</p>
<!-- @@@filteredReduced -->
<!-- $$$filteredReduced$$$filteredReducedConstIteratorConstIteratorFilterFunctionReduceFunctionQtConcurrent::ReduceOptions -->
<h3 class="fn" id="filteredReduced-1"><a name="filteredReduced-1"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">T</span>&gt; QtConcurrent::<span class="name">filteredReduced</span>(<span class="type">ConstIterator</span> <i>begin</i>, <span class="type">ConstIterator</span> <i>end</i>, <span class="type">FilterFunction</span> <i>filterFunction</i>, <span class="type">ReduceFunction</span> <i>reduceFunction</i>, <span class="type">QtConcurrent::ReduceOptions</span> <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</h3>
<p>Calls <i>filterFunction</i> once for each item from <i>begin</i> to <i>end</i>. If <i>filterFunction</i> returns <code>true</code> for an item, that item is then passed to <i>reduceFunction</i>. In other words, the return value is the result of <i>reduceFunction</i> for each item where <i>filterFunction</i> returns <code>true</code>.</p>
<p>Note that while <i>filterFunction</i> is called concurrently, only one thread at a time will call <i>reduceFunction</i>. The order in which <i>reduceFunction</i> is called is undefined if <i>reduceOptions</i> is <a href="qtconcurrent.html#ReduceOption-enum">QtConcurrent::UnorderedReduce</a>. If <i>reduceOptions</i> is <a href="qtconcurrent.html#ReduceOption-enum">QtConcurrent::OrderedReduce</a>, the <i>reduceFunction</i> is called in the order of the original sequence.</p>
<p><b>See also </b><a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a>.</p>
<!-- @@@filteredReduced -->
<!-- $$$map[overload1]$$$mapSequence&MapFunction -->
<h3 class="fn" id="map"><a name="map"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">void</span>&gt; QtConcurrent::<span class="name">map</span>(<span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">MapFunction</span> <i>function</i>)</h3>
<p>Calls <i>function</i> once for each item in <i>sequence</i>. The <i>function</i> is passed a reference to the item, so that any modifications done to the item will appear in <i>sequence</i>.</p>
<p><b>See also </b><a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@map -->
<!-- $$$map$$$mapIteratorIteratorMapFunction -->
<h3 class="fn" id="map-1"><a name="map-1"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">void</span>&gt; QtConcurrent::<span class="name">map</span>(<span class="type">Iterator</span> <i>begin</i>, <span class="type">Iterator</span> <i>end</i>, <span class="type">MapFunction</span> <i>function</i>)</h3>
<p>Calls <i>function</i> once for each item from <i>begin</i> to <i>end</i>. The <i>function</i> 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.</p>
<p><b>See also </b><a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@map -->
<!-- $$$mapped[overload1]$$$mappedconstSequence&MapFunction -->
<h3 class="fn" id="mapped"><a name="mapped"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">T</span>&gt; QtConcurrent::<span class="name">mapped</span>(const <span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">MapFunction</span> <i>function</i>)</h3>
<p>Calls <i>function</i> once for each item in <i>sequence</i> and returns a future with each mapped item as a result. You can use <a href="../qtcore/qfuture-const-iterator.html">QFuture::const_iterator</a> or <a href="../qtcore/qfutureiterator.html">QFutureIterator</a> to iterate through the results.</p>
<p><b>See also </b><a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@mapped -->
<!-- $$$mapped$$$mappedConstIteratorConstIteratorMapFunction -->
<h3 class="fn" id="mapped-1"><a name="mapped-1"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">T</span>&gt; QtConcurrent::<span class="name">mapped</span>(<span class="type">ConstIterator</span> <i>begin</i>, <span class="type">ConstIterator</span> <i>end</i>, <span class="type">MapFunction</span> <i>function</i>)</h3>
<p>Calls <i>function</i> once for each item from <i>begin</i> to <i>end</i> and returns a future with each mapped item as a result. You can use <a href="../qtcore/qfuture-const-iterator.html">QFuture::const_iterator</a> or <a href="../qtcore/qfutureiterator.html">QFutureIterator</a> to iterate through the results.</p>
<p><b>See also </b><a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@mapped -->
<!-- $$$mappedReduced[overload1]$$$mappedReducedconstSequence&MapFunctionReduceFunctionQtConcurrent::ReduceOptions -->
<h3 class="fn" id="mappedReduced"><a name="mappedReduced"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">T</span>&gt; QtConcurrent::<span class="name">mappedReduced</span>(const <span class="type">Sequence</span> &amp;<i>sequence</i>, <span class="type">MapFunction</span> <i>mapFunction</i>, <span class="type">ReduceFunction</span> <i>reduceFunction</i>, <span class="type">QtConcurrent::ReduceOptions</span> <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</h3>
<p>Calls <i>mapFunction</i> once for each item in <i>sequence</i>. The return value of each <i>mapFunction</i> is passed to <i>reduceFunction</i>.</p>
<p>Note that while <i>mapFunction</i> is called concurrently, only one thread at a time will call <i>reduceFunction</i>. The order in which <i>reduceFunction</i> is called is determined by <i>reduceOptions</i>.</p>
<p><b>See also </b><a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@mappedReduced -->
<!-- $$$mappedReduced$$$mappedReducedConstIteratorConstIteratorMapFunctionReduceFunctionQtConcurrent::ReduceOptions -->
<h3 class="fn" id="mappedReduced-1"><a name="mappedReduced-1"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">T</span>&gt; QtConcurrent::<span class="name">mappedReduced</span>(<span class="type">ConstIterator</span> <i>begin</i>, <span class="type">ConstIterator</span> <i>end</i>, <span class="type">MapFunction</span> <i>mapFunction</i>, <span class="type">ReduceFunction</span> <i>reduceFunction</i>, <span class="type">QtConcurrent::ReduceOptions</span> <i>reduceOptions</i> = UnorderedReduce | SequentialReduce)</h3>
<p>Calls <i>mapFunction</i> once for each item from <i>begin</i> to <i>end</i>. The return value of each <i>mapFunction</i> is passed to <i>reduceFunction</i>.</p>
<p>Note that while <i>mapFunction</i> is called concurrently, only one thread at a time will call <i>reduceFunction</i>. By default, the order in which <i>reduceFunction</i> is called is undefined.</p>
<p><b>Note: </b><a href="qtconcurrent.html#ReduceOption-enum">QtConcurrent::OrderedReduce</a> results in the ordered reduction.</p><p><b>See also </b><a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a>.</p>
<!-- @@@mappedReduced -->
<!-- $$$run[overload1]$$$runFunction... -->
<h3 class="fn" id="run"><a name="run"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">T</span>&gt; QtConcurrent::<span class="name">run</span>(<span class="type">Function</span> <i>function</i>, <i>...</i>)</h3>
<p>Equivalent to</p>
<pre class="cpp">

  <span class="type"><a href="qtconcurrent-module.html">QtConcurrent</a></span><span class="operator">::</span>run(<span class="type"><a href="../qtcore/qthreadpool.html">QThreadPool</a></span><span class="operator">::</span>globalInstance()<span class="operator">,</span> function<span class="operator">,</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);

</pre>
<p>Runs <i>function</i> in a separate thread. The thread is taken from the global <a href="../qtcore/qthreadpool.html">QThreadPool</a>. Note that <i>function</i> may not run immediately; <i>function</i> will only be run once a thread becomes available.</p>
<p>T is the same type as the return value of <i>function</i>. Non-void return values can be accessed via the <a href="../qtcore/qfuture.html#result">QFuture::result</a>() function.</p>
<p>Note that the <a href="../qtcore/qfuture.html">QFuture</a> returned by QtConcurrent::run() does not support canceling, pausing, or progress reporting. The <a href="../qtcore/qfuture.html">QFuture</a> returned can only be used to query for the running/finished status and the return value of the function.</p>
<p><b>See also </b><a href="qtconcurrentrun.html">Concurrent Run</a>.</p>
<!-- @@@run -->
<!-- $$$run$$$runQThreadPool*Function... -->
<h3 class="fn" id="run-1"><a name="run-1"></a><span class="type"><a href="../qtcore/qfuture.html">QFuture</a></span>&lt;<span class="type">T</span>&gt; QtConcurrent::<span class="name">run</span>(<span class="type"><a href="../qtcore/qthreadpool.html">QThreadPool</a></span> *<i>pool</i>, <span class="type">Function</span> <i>function</i>, <i>...</i>)</h3>
<p>Runs <i>function</i> in a separate thread. The thread is taken from the <a href="../qtcore/qthreadpool.html">QThreadPool</a> <i>pool</i>. Note that <i>function</i> may not run immediately; <i>function</i> will only be run once a thread becomes available.</p>
<p>T is the same type as the return value of <i>function</i>. Non-void return values can be accessed via the <a href="../qtcore/qfuture.html#result">QFuture::result</a>() function.</p>
<p>Note that the <a href="../qtcore/qfuture.html">QFuture</a> returned by QtConcurrent::run() does not support canceling, pausing, or progress reporting. The <a href="../qtcore/qfuture.html">QFuture</a> returned can only be used to query for the running/finished status and the return value of the function.</p>
<p>This function was introduced in  Qt 5.4.</p>
<p><b>See also </b><a href="qtconcurrentrun.html">Concurrent Run</a>.</p>
<!-- @@@run -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>