You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

210 lines
18 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.4"/>
  7. <title>tbb::strict_ppl::concurrent_queue&lt; T, A &gt; Class Template Reference</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  12. </head>
  13. <body>
  14. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  15. <!-- end header part -->
  16. <!-- Generated by Doxygen 1.8.4 -->
  17. <div id="navrow1" class="tabs">
  18. <ul class="tablist">
  19. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  20. <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
  21. <li><a href="modules.html"><span>Modules</span></a></li>
  22. <li><a href="namespaces.html"><span>Namespaces</span></a></li>
  23. <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
  24. <li><a href="files.html"><span>Files</span></a></li>
  25. </ul>
  26. </div>
  27. <div id="navrow2" class="tabs2">
  28. <ul class="tablist">
  29. <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
  30. <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
  31. <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
  32. </ul>
  33. </div>
  34. <div id="nav-path" class="navpath">
  35. <ul>
  36. <li class="navelem"><a class="el" href="a00222.html">tbb</a></li><li class="navelem"><b>strict_ppl</b></li><li class="navelem"><a class="el" href="a00038.html">concurrent_queue</a></li> </ul>
  37. </div>
  38. </div><!-- top -->
  39. <div class="header">
  40. <div class="summary">
  41. <a href="#pub-types">Public Types</a> &#124;
  42. <a href="#pub-methods">Public Member Functions</a> &#124;
  43. <a href="#friends">Friends</a> &#124;
  44. <a href="a00383.html">List of all members</a> </div>
  45. <div class="headertitle">
  46. <div class="title">tbb::strict_ppl::concurrent_queue&lt; T, A &gt; Class Template Reference<div class="ingroups"><a class="el" href="a00235.html">Containers</a></div></div> </div>
  47. </div><!--header-->
  48. <div class="contents">
  49. <p>A high-performance thread-safe non-blocking concurrent queue.
  50. <a href="a00038.html#details">More...</a></p>
  51. <p><code>#include &lt;concurrent_queue.h&gt;</code></p>
  52. <div class="dynheader">
  53. Inheritance diagram for tbb::strict_ppl::concurrent_queue&lt; T, A &gt;:</div>
  54. <div class="dyncontent">
  55. <div class="center">
  56. <img src="a00038.png" usemap="#tbb::strict_ppl::concurrent_queue&lt; T, A &gt;_map" alt=""/>
  57. <map id="tbb::strict_ppl::concurrent_queue&lt; T, A &gt;_map" name="tbb::strict_ppl::concurrent_queue&lt; T, A &gt;_map">
  58. </map>
  59. </div></div>
  60. <table class="memberdecls">
  61. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
  62. Public Types</h2></td></tr>
  63. <tr class="memitem:aeeee93a7ac2eecc80bbf3e857e900538"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeeee93a7ac2eecc80bbf3e857e900538"></a>
  64. typedef T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#aeeee93a7ac2eecc80bbf3e857e900538">value_type</a></td></tr>
  65. <tr class="memdesc:aeeee93a7ac2eecc80bbf3e857e900538"><td class="mdescLeft">&#160;</td><td class="mdescRight">Element type in the queue. <br/></td></tr>
  66. <tr class="separator:aeeee93a7ac2eecc80bbf3e857e900538"><td class="memSeparator" colspan="2">&#160;</td></tr>
  67. <tr class="memitem:ab26ddf11b15d61ac87e6c1ae67af92a2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab26ddf11b15d61ac87e6c1ae67af92a2"></a>
  68. typedef T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#ab26ddf11b15d61ac87e6c1ae67af92a2">reference</a></td></tr>
  69. <tr class="memdesc:ab26ddf11b15d61ac87e6c1ae67af92a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reference type. <br/></td></tr>
  70. <tr class="separator:ab26ddf11b15d61ac87e6c1ae67af92a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  71. <tr class="memitem:a478c2b7f763b2e821e01cc14e13baf4c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a478c2b7f763b2e821e01cc14e13baf4c"></a>
  72. typedef const T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#a478c2b7f763b2e821e01cc14e13baf4c">const_reference</a></td></tr>
  73. <tr class="memdesc:a478c2b7f763b2e821e01cc14e13baf4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Const reference type. <br/></td></tr>
  74. <tr class="separator:a478c2b7f763b2e821e01cc14e13baf4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  75. <tr class="memitem:a9f883e49afea16293ba92da779981bb8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9f883e49afea16293ba92da779981bb8"></a>
  76. typedef size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#a9f883e49afea16293ba92da779981bb8">size_type</a></td></tr>
  77. <tr class="memdesc:a9f883e49afea16293ba92da779981bb8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Integral type for representing size of the queue. <br/></td></tr>
  78. <tr class="separator:a9f883e49afea16293ba92da779981bb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
  79. <tr class="memitem:a63b42d83a9ed13fc6741e0b4388b0e96"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a63b42d83a9ed13fc6741e0b4388b0e96"></a>
  80. typedef ptrdiff_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#a63b42d83a9ed13fc6741e0b4388b0e96">difference_type</a></td></tr>
  81. <tr class="memdesc:a63b42d83a9ed13fc6741e0b4388b0e96"><td class="mdescLeft">&#160;</td><td class="mdescRight">Difference type for iterator. <br/></td></tr>
  82. <tr class="separator:a63b42d83a9ed13fc6741e0b4388b0e96"><td class="memSeparator" colspan="2">&#160;</td></tr>
  83. <tr class="memitem:acbdd1a5bd034358fb0774b322a66b1ed"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acbdd1a5bd034358fb0774b322a66b1ed"></a>
  84. typedef A&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#acbdd1a5bd034358fb0774b322a66b1ed">allocator_type</a></td></tr>
  85. <tr class="memdesc:acbdd1a5bd034358fb0774b322a66b1ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocator type. <br/></td></tr>
  86. <tr class="separator:acbdd1a5bd034358fb0774b322a66b1ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
  87. <tr class="memitem:ab1361aa7fd454fe593609be740ab8a4c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab1361aa7fd454fe593609be740ab8a4c"></a>
  88. typedef <br class="typebreak"/>
  89. internal::concurrent_queue_iterator<br class="typebreak"/>
  90. &lt; <a class="el" href="a00038.html">concurrent_queue</a>, T &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>iterator</b></td></tr>
  91. <tr class="separator:ab1361aa7fd454fe593609be740ab8a4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  92. <tr class="memitem:a674e375edf0a3463ae1cec5d6158593d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a674e375edf0a3463ae1cec5d6158593d"></a>
  93. typedef <br class="typebreak"/>
  94. internal::concurrent_queue_iterator<br class="typebreak"/>
  95. &lt; <a class="el" href="a00038.html">concurrent_queue</a>, const T &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>const_iterator</b></td></tr>
  96. <tr class="separator:a674e375edf0a3463ae1cec5d6158593d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  97. </table><table class="memberdecls">
  98. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  99. Public Member Functions</h2></td></tr>
  100. <tr class="memitem:a49b2e16902577cd3174355be0fa684e5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a49b2e16902577cd3174355be0fa684e5"></a>
  101. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#a49b2e16902577cd3174355be0fa684e5">concurrent_queue</a> (const <a class="el" href="a00038.html#acbdd1a5bd034358fb0774b322a66b1ed">allocator_type</a> &amp;a=<a class="el" href="a00038.html#acbdd1a5bd034358fb0774b322a66b1ed">allocator_type</a>())</td></tr>
  102. <tr class="memdesc:a49b2e16902577cd3174355be0fa684e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct empty queue. <br/></td></tr>
  103. <tr class="separator:a49b2e16902577cd3174355be0fa684e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  104. <tr class="memitem:a43ac953152e60815c09fe4a4d4a623a9"><td class="memTemplParams" colspan="2"><a class="anchor" id="a43ac953152e60815c09fe4a4d4a623a9"></a>
  105. template&lt;typename InputIterator &gt; </td></tr>
  106. <tr class="memitem:a43ac953152e60815c09fe4a4d4a623a9"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00038.html#a43ac953152e60815c09fe4a4d4a623a9">concurrent_queue</a> (InputIterator begin, InputIterator end, const <a class="el" href="a00038.html#acbdd1a5bd034358fb0774b322a66b1ed">allocator_type</a> &amp;a=<a class="el" href="a00038.html#acbdd1a5bd034358fb0774b322a66b1ed">allocator_type</a>())</td></tr>
  107. <tr class="memdesc:a43ac953152e60815c09fe4a4d4a623a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">[begin,end) constructor <br/></td></tr>
  108. <tr class="separator:a43ac953152e60815c09fe4a4d4a623a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. <tr class="memitem:ae918807d098d5d5b41cc6d606fa2e7a1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae918807d098d5d5b41cc6d606fa2e7a1"></a>
  110. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#ae918807d098d5d5b41cc6d606fa2e7a1">concurrent_queue</a> (const <a class="el" href="a00038.html">concurrent_queue</a> &amp;src, const <a class="el" href="a00038.html#acbdd1a5bd034358fb0774b322a66b1ed">allocator_type</a> &amp;a=<a class="el" href="a00038.html#acbdd1a5bd034358fb0774b322a66b1ed">allocator_type</a>())</td></tr>
  111. <tr class="memdesc:ae918807d098d5d5b41cc6d606fa2e7a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor. <br/></td></tr>
  112. <tr class="separator:ae918807d098d5d5b41cc6d606fa2e7a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <tr class="memitem:aa0056b242f280f5e25332ce998f9f670"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa0056b242f280f5e25332ce998f9f670"></a>
  114. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#aa0056b242f280f5e25332ce998f9f670">~concurrent_queue</a> ()</td></tr>
  115. <tr class="memdesc:aa0056b242f280f5e25332ce998f9f670"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy queue. <br/></td></tr>
  116. <tr class="separator:aa0056b242f280f5e25332ce998f9f670"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. <tr class="memitem:a9330ca6590980d80ef7b1ea3613a699a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9330ca6590980d80ef7b1ea3613a699a"></a>
  118. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#a9330ca6590980d80ef7b1ea3613a699a">push</a> (const T &amp;source)</td></tr>
  119. <tr class="memdesc:a9330ca6590980d80ef7b1ea3613a699a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enqueue an item at tail of queue. <br/></td></tr>
  120. <tr class="separator:a9330ca6590980d80ef7b1ea3613a699a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  121. <tr class="memitem:aabb1acef18196fa11ed7db8e046c3943"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#aabb1acef18196fa11ed7db8e046c3943">try_pop</a> (T &amp;result)</td></tr>
  122. <tr class="memdesc:aabb1acef18196fa11ed7db8e046c3943"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempt to dequeue an item from head of queue. <a href="#aabb1acef18196fa11ed7db8e046c3943">More...</a><br/></td></tr>
  123. <tr class="separator:aabb1acef18196fa11ed7db8e046c3943"><td class="memSeparator" colspan="2">&#160;</td></tr>
  124. <tr class="memitem:aad4b253ba595637b0b146eb6565556f2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aad4b253ba595637b0b146eb6565556f2"></a>
  125. <a class="el" href="a00038.html#a9f883e49afea16293ba92da779981bb8">size_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#aad4b253ba595637b0b146eb6565556f2">unsafe_size</a> () const </td></tr>
  126. <tr class="memdesc:aad4b253ba595637b0b146eb6565556f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of items in the queue; thread unsafe. <br/></td></tr>
  127. <tr class="separator:aad4b253ba595637b0b146eb6565556f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  128. <tr class="memitem:aeda3156929d0c250faed7b807ca6ab0e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeda3156929d0c250faed7b807ca6ab0e"></a>
  129. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#aeda3156929d0c250faed7b807ca6ab0e">empty</a> () const </td></tr>
  130. <tr class="memdesc:aeda3156929d0c250faed7b807ca6ab0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to size()==0. <br/></td></tr>
  131. <tr class="separator:aeda3156929d0c250faed7b807ca6ab0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  132. <tr class="memitem:ad3384818fb6350a494d5ec62445e59ee"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad3384818fb6350a494d5ec62445e59ee"></a>
  133. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#ad3384818fb6350a494d5ec62445e59ee">clear</a> ()</td></tr>
  134. <tr class="memdesc:ad3384818fb6350a494d5ec62445e59ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear the queue. not thread-safe. <br/></td></tr>
  135. <tr class="separator:ad3384818fb6350a494d5ec62445e59ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
  136. <tr class="memitem:a7f2b39f350281590b86db906eca6c480"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7f2b39f350281590b86db906eca6c480"></a>
  137. <a class="el" href="a00038.html#acbdd1a5bd034358fb0774b322a66b1ed">allocator_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00038.html#a7f2b39f350281590b86db906eca6c480">get_allocator</a> () const </td></tr>
  138. <tr class="memdesc:a7f2b39f350281590b86db906eca6c480"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return allocator object. <br/></td></tr>
  139. <tr class="separator:a7f2b39f350281590b86db906eca6c480"><td class="memSeparator" colspan="2">&#160;</td></tr>
  140. <tr class="memitem:a6658faeae3c10135a553fedadddde239"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6658faeae3c10135a553fedadddde239"></a>
  141. iterator&#160;</td><td class="memItemRight" valign="bottom"><b>unsafe_begin</b> ()</td></tr>
  142. <tr class="separator:a6658faeae3c10135a553fedadddde239"><td class="memSeparator" colspan="2">&#160;</td></tr>
  143. <tr class="memitem:aa7593de5e76006ed3adef4d060f0009c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa7593de5e76006ed3adef4d060f0009c"></a>
  144. iterator&#160;</td><td class="memItemRight" valign="bottom"><b>unsafe_end</b> ()</td></tr>
  145. <tr class="separator:aa7593de5e76006ed3adef4d060f0009c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  146. <tr class="memitem:a0f84b37020f4267f17c7e91acfc0c446"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0f84b37020f4267f17c7e91acfc0c446"></a>
  147. const_iterator&#160;</td><td class="memItemRight" valign="bottom"><b>unsafe_begin</b> () const </td></tr>
  148. <tr class="separator:a0f84b37020f4267f17c7e91acfc0c446"><td class="memSeparator" colspan="2">&#160;</td></tr>
  149. <tr class="memitem:a118a79d7e20cdbd807fa7fccc2a5b848"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a118a79d7e20cdbd807fa7fccc2a5b848"></a>
  150. const_iterator&#160;</td><td class="memItemRight" valign="bottom"><b>unsafe_end</b> () const </td></tr>
  151. <tr class="separator:a118a79d7e20cdbd807fa7fccc2a5b848"><td class="memSeparator" colspan="2">&#160;</td></tr>
  152. </table><table class="memberdecls">
  153. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
  154. Friends</h2></td></tr>
  155. <tr class="memitem:a1f5eec0de2e660ea5372d19393f0920b"><td class="memTemplParams" colspan="2"><a class="anchor" id="a1f5eec0de2e660ea5372d19393f0920b"></a>
  156. template&lt;typename Container , typename Value &gt; </td></tr>
  157. <tr class="memitem:a1f5eec0de2e660ea5372d19393f0920b"><td class="memTemplItemLeft" align="right" valign="top">class&#160;</td><td class="memTemplItemRight" valign="bottom"><b>internal::concurrent_queue_iterator</b></td></tr>
  158. <tr class="separator:a1f5eec0de2e660ea5372d19393f0920b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  159. </table>
  160. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  161. <div class="textblock"><h3>template&lt;typename T, typename A = cache_aligned_allocator&lt;T&gt;&gt;<br/>
  162. class tbb::strict_ppl::concurrent_queue&lt; T, A &gt;</h3>
  163. <p>A high-performance thread-safe non-blocking concurrent queue. </p>
  164. <p>Multiple threads may each push and pop concurrently. Assignment construction is not allowed. </p>
  165. </div><h2 class="groupheader">Member Function Documentation</h2>
  166. <a class="anchor" id="aabb1acef18196fa11ed7db8e046c3943"></a>
  167. <div class="memitem">
  168. <div class="memproto">
  169. <div class="memtemplate">
  170. template&lt;typename T , typename A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  171. <table class="mlabels">
  172. <tr>
  173. <td class="mlabels-left">
  174. <table class="memname">
  175. <tr>
  176. <td class="memname">bool <a class="el" href="a00038.html">tbb::strict_ppl::concurrent_queue</a>&lt; T, A &gt;::try_pop </td>
  177. <td>(</td>
  178. <td class="paramtype">T &amp;&#160;</td>
  179. <td class="paramname"><em>result</em>)</td><td></td>
  180. <td></td>
  181. </tr>
  182. </table>
  183. </td>
  184. <td class="mlabels-right">
  185. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  186. </tr>
  187. </table>
  188. </div><div class="memdoc">
  189. <p>Attempt to dequeue an item from head of queue. </p>
  190. <p>Does not wait for item to become available. Returns true if successful; false otherwise. </p>
  191. </div>
  192. </div>
  193. <hr/>The documentation for this class was generated from the following file:<ul>
  194. <li>concurrent_queue.h</li>
  195. </ul>
  196. </div><!-- contents -->
  197. <hr>
  198. <p></p>
  199. Copyright &copy; 2005-2014 Intel Corporation. All Rights Reserved.
  200. <p></p>
  201. Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
  202. registered trademarks or trademarks of Intel Corporation or its
  203. subsidiaries in the United States and other countries.
  204. <p></p>
  205. * Other names and brands may be claimed as the property of others.