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.

365 lines
27 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::concurrent_bounded_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"><a class="el" href="a00034.html">concurrent_bounded_queue</a></li> </ul>
  37. </div>
  38. </div><!-- top -->
  39. <div class="header">
  40. <div class="summary">
  41. <a href="#nested-classes">Classes</a> &#124;
  42. <a href="#pub-types">Public Types</a> &#124;
  43. <a href="#pub-methods">Public Member Functions</a> &#124;
  44. <a href="#friends">Friends</a> &#124;
  45. <a href="a00256.html">List of all members</a> </div>
  46. <div class="headertitle">
  47. <div class="title">tbb::concurrent_bounded_queue&lt; T, A &gt; Class Template Reference<div class="ingroups"><a class="el" href="a00235.html">Containers</a></div></div> </div>
  48. </div><!--header-->
  49. <div class="contents">
  50. <p>A high-performance thread-safe blocking concurrent bounded queue.
  51. <a href="a00034.html#details">More...</a></p>
  52. <p><code>#include &lt;concurrent_queue.h&gt;</code></p>
  53. <div class="dynheader">
  54. Inheritance diagram for tbb::concurrent_bounded_queue&lt; T, A &gt;:</div>
  55. <div class="dyncontent">
  56. <div class="center">
  57. <img src="a00034.png" usemap="#tbb::concurrent_bounded_queue&lt; T, A &gt;_map" alt=""/>
  58. <map id="tbb::concurrent_bounded_queue&lt; T, A &gt;_map" name="tbb::concurrent_bounded_queue&lt; T, A &gt;_map">
  59. <area href="a00039.html" title="A high-performance thread-safe blocking concurrent bounded queue. " alt="tbb::deprecated::concurrent_queue&lt; T, A &gt;" shape="rect" coords="0,112,257,136"/>
  60. </map>
  61. </div></div>
  62. <table class="memberdecls">
  63. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
  64. Public Types</h2></td></tr>
  65. <tr class="memitem:a6eb564625fef03dd9a5881d5d4e52f9f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6eb564625fef03dd9a5881d5d4e52f9f"></a>
  66. typedef T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a6eb564625fef03dd9a5881d5d4e52f9f">value_type</a></td></tr>
  67. <tr class="memdesc:a6eb564625fef03dd9a5881d5d4e52f9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Element type in the queue. <br/></td></tr>
  68. <tr class="separator:a6eb564625fef03dd9a5881d5d4e52f9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  69. <tr class="memitem:acbfceb845de1c770e2b56409f09b0364"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acbfceb845de1c770e2b56409f09b0364"></a>
  70. typedef A&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#acbfceb845de1c770e2b56409f09b0364">allocator_type</a></td></tr>
  71. <tr class="memdesc:acbfceb845de1c770e2b56409f09b0364"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocator type. <br/></td></tr>
  72. <tr class="separator:acbfceb845de1c770e2b56409f09b0364"><td class="memSeparator" colspan="2">&#160;</td></tr>
  73. <tr class="memitem:a5fa4002bcd265d9d3ed305e3b686f1da"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5fa4002bcd265d9d3ed305e3b686f1da"></a>
  74. typedef T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a5fa4002bcd265d9d3ed305e3b686f1da">reference</a></td></tr>
  75. <tr class="memdesc:a5fa4002bcd265d9d3ed305e3b686f1da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reference type. <br/></td></tr>
  76. <tr class="separator:a5fa4002bcd265d9d3ed305e3b686f1da"><td class="memSeparator" colspan="2">&#160;</td></tr>
  77. <tr class="memitem:af838e520ce0db2c22369748c019b11cb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af838e520ce0db2c22369748c019b11cb"></a>
  78. typedef const T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#af838e520ce0db2c22369748c019b11cb">const_reference</a></td></tr>
  79. <tr class="memdesc:af838e520ce0db2c22369748c019b11cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Const reference type. <br/></td></tr>
  80. <tr class="separator:af838e520ce0db2c22369748c019b11cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
  81. <tr class="memitem:ae73fa352d781bdb9d01bfb77f2a8bc28"><td class="memItemLeft" align="right" valign="top">typedef std::ptrdiff_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ae73fa352d781bdb9d01bfb77f2a8bc28">size_type</a></td></tr>
  82. <tr class="memdesc:ae73fa352d781bdb9d01bfb77f2a8bc28"><td class="mdescLeft">&#160;</td><td class="mdescRight">Integral type for representing size of the queue. <a href="#ae73fa352d781bdb9d01bfb77f2a8bc28">More...</a><br/></td></tr>
  83. <tr class="separator:ae73fa352d781bdb9d01bfb77f2a8bc28"><td class="memSeparator" colspan="2">&#160;</td></tr>
  84. <tr class="memitem:a72725361e050c5a981035a20ef1b773e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a72725361e050c5a981035a20ef1b773e"></a>
  85. typedef std::ptrdiff_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a72725361e050c5a981035a20ef1b773e">difference_type</a></td></tr>
  86. <tr class="memdesc:a72725361e050c5a981035a20ef1b773e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Difference type for iterator. <br/></td></tr>
  87. <tr class="separator:a72725361e050c5a981035a20ef1b773e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  88. <tr class="memitem:a42dfb71b1e4bdc0da3c1217d0d40ddd5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a42dfb71b1e4bdc0da3c1217d0d40ddd5"></a>
  89. typedef <br class="typebreak"/>
  90. internal::concurrent_queue_iterator<br class="typebreak"/>
  91. &lt; <a class="el" href="a00034.html">concurrent_bounded_queue</a>, T &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>iterator</b></td></tr>
  92. <tr class="separator:a42dfb71b1e4bdc0da3c1217d0d40ddd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  93. <tr class="memitem:a18049841284051e18b854692bd04602c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a18049841284051e18b854692bd04602c"></a>
  94. typedef <br class="typebreak"/>
  95. internal::concurrent_queue_iterator<br class="typebreak"/>
  96. &lt; <a class="el" href="a00034.html">concurrent_bounded_queue</a>, <br class="typebreak"/>
  97. const T &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>const_iterator</b></td></tr>
  98. <tr class="separator:a18049841284051e18b854692bd04602c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. </table><table class="memberdecls">
  100. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  101. Public Member Functions</h2></td></tr>
  102. <tr class="memitem:a85f8a800cae02b601f36ad7a655a0126"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a85f8a800cae02b601f36ad7a655a0126"></a>
  103. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a85f8a800cae02b601f36ad7a655a0126">concurrent_bounded_queue</a> (const <a class="el" href="a00034.html#acbfceb845de1c770e2b56409f09b0364">allocator_type</a> &amp;a=<a class="el" href="a00034.html#acbfceb845de1c770e2b56409f09b0364">allocator_type</a>())</td></tr>
  104. <tr class="memdesc:a85f8a800cae02b601f36ad7a655a0126"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct empty queue. <br/></td></tr>
  105. <tr class="separator:a85f8a800cae02b601f36ad7a655a0126"><td class="memSeparator" colspan="2">&#160;</td></tr>
  106. <tr class="memitem:aad6fd2353d64c2c31d074cd99df58c02"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aad6fd2353d64c2c31d074cd99df58c02"></a>
  107. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#aad6fd2353d64c2c31d074cd99df58c02">concurrent_bounded_queue</a> (const <a class="el" href="a00034.html">concurrent_bounded_queue</a> &amp;src, const <a class="el" href="a00034.html#acbfceb845de1c770e2b56409f09b0364">allocator_type</a> &amp;a=<a class="el" href="a00034.html#acbfceb845de1c770e2b56409f09b0364">allocator_type</a>())</td></tr>
  108. <tr class="memdesc:aad6fd2353d64c2c31d074cd99df58c02"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor. <br/></td></tr>
  109. <tr class="separator:aad6fd2353d64c2c31d074cd99df58c02"><td class="memSeparator" colspan="2">&#160;</td></tr>
  110. <tr class="memitem:afcfdc998e106fdb7b2dfa5df880cd9cf"><td class="memTemplParams" colspan="2"><a class="anchor" id="afcfdc998e106fdb7b2dfa5df880cd9cf"></a>
  111. template&lt;typename InputIterator &gt; </td></tr>
  112. <tr class="memitem:afcfdc998e106fdb7b2dfa5df880cd9cf"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00034.html#afcfdc998e106fdb7b2dfa5df880cd9cf">concurrent_bounded_queue</a> (InputIterator begin, InputIterator end, const <a class="el" href="a00034.html#acbfceb845de1c770e2b56409f09b0364">allocator_type</a> &amp;a=<a class="el" href="a00034.html#acbfceb845de1c770e2b56409f09b0364">allocator_type</a>())</td></tr>
  113. <tr class="memdesc:afcfdc998e106fdb7b2dfa5df880cd9cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">[begin,end) constructor <br/></td></tr>
  114. <tr class="separator:afcfdc998e106fdb7b2dfa5df880cd9cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
  115. <tr class="memitem:ab1291bf6837ecfb8836c24dde5dd80b5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab1291bf6837ecfb8836c24dde5dd80b5"></a>
  116. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ab1291bf6837ecfb8836c24dde5dd80b5">~concurrent_bounded_queue</a> ()</td></tr>
  117. <tr class="memdesc:ab1291bf6837ecfb8836c24dde5dd80b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy queue. <br/></td></tr>
  118. <tr class="separator:ab1291bf6837ecfb8836c24dde5dd80b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  119. <tr class="memitem:ae5e9051772bbc93b2ccb8fd0a98a21f5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae5e9051772bbc93b2ccb8fd0a98a21f5"></a>
  120. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ae5e9051772bbc93b2ccb8fd0a98a21f5">push</a> (const T &amp;source)</td></tr>
  121. <tr class="memdesc:ae5e9051772bbc93b2ccb8fd0a98a21f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enqueue an item at tail of queue. <br/></td></tr>
  122. <tr class="separator:ae5e9051772bbc93b2ccb8fd0a98a21f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  123. <tr class="memitem:a87926c31967a918ce80690a9ed5d6fa8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a87926c31967a918ce80690a9ed5d6fa8">pop</a> (T &amp;destination)</td></tr>
  124. <tr class="memdesc:a87926c31967a918ce80690a9ed5d6fa8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dequeue item from head of queue. <a href="#a87926c31967a918ce80690a9ed5d6fa8">More...</a><br/></td></tr>
  125. <tr class="separator:a87926c31967a918ce80690a9ed5d6fa8"><td class="memSeparator" colspan="2">&#160;</td></tr>
  126. <tr class="memitem:a77a755d94cabf5208905d10d5b57419c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a77a755d94cabf5208905d10d5b57419c"></a>
  127. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a77a755d94cabf5208905d10d5b57419c">abort</a> ()</td></tr>
  128. <tr class="memdesc:a77a755d94cabf5208905d10d5b57419c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abort all pending queue operations. <br/></td></tr>
  129. <tr class="separator:a77a755d94cabf5208905d10d5b57419c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  130. <tr class="memitem:a03d93a240841a21788396bebd71c51bd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a03d93a240841a21788396bebd71c51bd">try_push</a> (const T &amp;source)</td></tr>
  131. <tr class="memdesc:a03d93a240841a21788396bebd71c51bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enqueue an item at tail of queue if queue is not already full. <a href="#a03d93a240841a21788396bebd71c51bd">More...</a><br/></td></tr>
  132. <tr class="separator:a03d93a240841a21788396bebd71c51bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  133. <tr class="memitem:a3086cb4dcdeee245ef5cf34f72fb3e10"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a3086cb4dcdeee245ef5cf34f72fb3e10">try_pop</a> (T &amp;destination)</td></tr>
  134. <tr class="memdesc:a3086cb4dcdeee245ef5cf34f72fb3e10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempt to dequeue an item from head of queue. <a href="#a3086cb4dcdeee245ef5cf34f72fb3e10">More...</a><br/></td></tr>
  135. <tr class="separator:a3086cb4dcdeee245ef5cf34f72fb3e10"><td class="memSeparator" colspan="2">&#160;</td></tr>
  136. <tr class="memitem:a9d6c20fd8c193c12b6a7b0c3101fd966"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00034.html#ae73fa352d781bdb9d01bfb77f2a8bc28">size_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a9d6c20fd8c193c12b6a7b0c3101fd966">size</a> () const </td></tr>
  137. <tr class="memdesc:a9d6c20fd8c193c12b6a7b0c3101fd966"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return number of pushes minus number of pops. <a href="#a9d6c20fd8c193c12b6a7b0c3101fd966">More...</a><br/></td></tr>
  138. <tr class="separator:a9d6c20fd8c193c12b6a7b0c3101fd966"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. <tr class="memitem:a8c59578f28c5fb4718b0eff43776e879"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8c59578f28c5fb4718b0eff43776e879"></a>
  140. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a8c59578f28c5fb4718b0eff43776e879">empty</a> () const </td></tr>
  141. <tr class="memdesc:a8c59578f28c5fb4718b0eff43776e879"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <a class="el" href="a00034.html#a9d6c20fd8c193c12b6a7b0c3101fd966" title="Return number of pushes minus number of pops. ">size()</a>&lt;=0. <br/></td></tr>
  142. <tr class="separator:a8c59578f28c5fb4718b0eff43776e879"><td class="memSeparator" colspan="2">&#160;</td></tr>
  143. <tr class="memitem:a526487063242569685af8c8d778d39e0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a526487063242569685af8c8d778d39e0"></a>
  144. <a class="el" href="a00034.html#ae73fa352d781bdb9d01bfb77f2a8bc28">size_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a526487063242569685af8c8d778d39e0">capacity</a> () const </td></tr>
  145. <tr class="memdesc:a526487063242569685af8c8d778d39e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum number of allowed elements. <br/></td></tr>
  146. <tr class="separator:a526487063242569685af8c8d778d39e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  147. <tr class="memitem:a768699675813575eec08c1f43afda395"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a768699675813575eec08c1f43afda395">set_capacity</a> (<a class="el" href="a00034.html#ae73fa352d781bdb9d01bfb77f2a8bc28">size_type</a> new_capacity)</td></tr>
  148. <tr class="memdesc:a768699675813575eec08c1f43afda395"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the capacity. <a href="#a768699675813575eec08c1f43afda395">More...</a><br/></td></tr>
  149. <tr class="separator:a768699675813575eec08c1f43afda395"><td class="memSeparator" colspan="2">&#160;</td></tr>
  150. <tr class="memitem:aaeba11bbcd368a7a3a6e6e2dd3082c9c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaeba11bbcd368a7a3a6e6e2dd3082c9c"></a>
  151. <a class="el" href="a00034.html#acbfceb845de1c770e2b56409f09b0364">allocator_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#aaeba11bbcd368a7a3a6e6e2dd3082c9c">get_allocator</a> () const </td></tr>
  152. <tr class="memdesc:aaeba11bbcd368a7a3a6e6e2dd3082c9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">return allocator object <br/></td></tr>
  153. <tr class="separator:aaeba11bbcd368a7a3a6e6e2dd3082c9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  154. <tr class="memitem:a246be3920e079ea4847933f106baa98f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a246be3920e079ea4847933f106baa98f"></a>
  155. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a246be3920e079ea4847933f106baa98f">clear</a> ()</td></tr>
  156. <tr class="memdesc:a246be3920e079ea4847933f106baa98f"><td class="mdescLeft">&#160;</td><td class="mdescRight">clear the queue. not thread-safe. <br/></td></tr>
  157. <tr class="separator:a246be3920e079ea4847933f106baa98f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  158. <tr class="memitem:ac0c931eaa1ddc30025e49d06cc383703"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac0c931eaa1ddc30025e49d06cc383703"></a>
  159. iterator&#160;</td><td class="memItemRight" valign="bottom"><b>unsafe_begin</b> ()</td></tr>
  160. <tr class="separator:ac0c931eaa1ddc30025e49d06cc383703"><td class="memSeparator" colspan="2">&#160;</td></tr>
  161. <tr class="memitem:a634cece9742cbaba56ba6f7777568e4c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a634cece9742cbaba56ba6f7777568e4c"></a>
  162. iterator&#160;</td><td class="memItemRight" valign="bottom"><b>unsafe_end</b> ()</td></tr>
  163. <tr class="separator:a634cece9742cbaba56ba6f7777568e4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  164. <tr class="memitem:a2ed2f8130fd679e89327cb292fb25510"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2ed2f8130fd679e89327cb292fb25510"></a>
  165. const_iterator&#160;</td><td class="memItemRight" valign="bottom"><b>unsafe_begin</b> () const </td></tr>
  166. <tr class="separator:a2ed2f8130fd679e89327cb292fb25510"><td class="memSeparator" colspan="2">&#160;</td></tr>
  167. <tr class="memitem:a873d62f59fd79959c0204f5fb44c774d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a873d62f59fd79959c0204f5fb44c774d"></a>
  168. const_iterator&#160;</td><td class="memItemRight" valign="bottom"><b>unsafe_end</b> () const </td></tr>
  169. <tr class="separator:a873d62f59fd79959c0204f5fb44c774d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  170. </table><table class="memberdecls">
  171. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
  172. Friends</h2></td></tr>
  173. <tr class="memitem:a1f5eec0de2e660ea5372d19393f0920b"><td class="memTemplParams" colspan="2"><a class="anchor" id="a1f5eec0de2e660ea5372d19393f0920b"></a>
  174. template&lt;typename Container , typename Value &gt; </td></tr>
  175. <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>
  176. <tr class="separator:a1f5eec0de2e660ea5372d19393f0920b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  177. </table>
  178. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  179. <div class="textblock"><h3>template&lt;typename T, class A = cache_aligned_allocator&lt;T&gt;&gt;<br/>
  180. class tbb::concurrent_bounded_queue&lt; T, A &gt;</h3>
  181. <p>A high-performance thread-safe blocking concurrent bounded queue. </p>
  182. <p>This is the pre-PPL TBB concurrent queue which supports boundedness and blocking semantics. Note that method names agree with the PPL-style concurrent queue. Multiple threads may each push and pop concurrently. Assignment construction is not allowed. </p>
  183. </div><h2 class="groupheader">Member Typedef Documentation</h2>
  184. <a class="anchor" id="ae73fa352d781bdb9d01bfb77f2a8bc28"></a>
  185. <div class="memitem">
  186. <div class="memproto">
  187. <div class="memtemplate">
  188. template&lt;typename T, class A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  189. <table class="memname">
  190. <tr>
  191. <td class="memname">typedef std::ptrdiff_t <a class="el" href="a00034.html">tbb::concurrent_bounded_queue</a>&lt; T, A &gt;::<a class="el" href="a00034.html#ae73fa352d781bdb9d01bfb77f2a8bc28">size_type</a></td>
  192. </tr>
  193. </table>
  194. </div><div class="memdoc">
  195. <p>Integral type for representing size of the queue. </p>
  196. <p>Note that the size_type is a signed integral type. This is because the size can be negative if there are pending pops without corresponding pushes. </p>
  197. </div>
  198. </div>
  199. <h2 class="groupheader">Member Function Documentation</h2>
  200. <a class="anchor" id="a87926c31967a918ce80690a9ed5d6fa8"></a>
  201. <div class="memitem">
  202. <div class="memproto">
  203. <div class="memtemplate">
  204. template&lt;typename T, class A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  205. <table class="mlabels">
  206. <tr>
  207. <td class="mlabels-left">
  208. <table class="memname">
  209. <tr>
  210. <td class="memname">void <a class="el" href="a00034.html">tbb::concurrent_bounded_queue</a>&lt; T, A &gt;::pop </td>
  211. <td>(</td>
  212. <td class="paramtype">T &amp;&#160;</td>
  213. <td class="paramname"><em>destination</em>)</td><td></td>
  214. <td></td>
  215. </tr>
  216. </table>
  217. </td>
  218. <td class="mlabels-right">
  219. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  220. </tr>
  221. </table>
  222. </div><div class="memdoc">
  223. <p>Dequeue item from head of queue. </p>
  224. <p>Block until an item becomes available, and then dequeue it. </p>
  225. </div>
  226. </div>
  227. <a class="anchor" id="a768699675813575eec08c1f43afda395"></a>
  228. <div class="memitem">
  229. <div class="memproto">
  230. <div class="memtemplate">
  231. template&lt;typename T, class A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  232. <table class="mlabels">
  233. <tr>
  234. <td class="mlabels-left">
  235. <table class="memname">
  236. <tr>
  237. <td class="memname">void <a class="el" href="a00034.html">tbb::concurrent_bounded_queue</a>&lt; T, A &gt;::set_capacity </td>
  238. <td>(</td>
  239. <td class="paramtype"><a class="el" href="a00034.html#ae73fa352d781bdb9d01bfb77f2a8bc28">size_type</a>&#160;</td>
  240. <td class="paramname"><em>new_capacity</em>)</td><td></td>
  241. <td></td>
  242. </tr>
  243. </table>
  244. </td>
  245. <td class="mlabels-right">
  246. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  247. </tr>
  248. </table>
  249. </div><div class="memdoc">
  250. <p>Set the capacity. </p>
  251. <p>Setting the capacity to 0 causes subsequent try_push operations to always fail, and subsequent push operations to block forever. </p>
  252. </div>
  253. </div>
  254. <a class="anchor" id="a9d6c20fd8c193c12b6a7b0c3101fd966"></a>
  255. <div class="memitem">
  256. <div class="memproto">
  257. <div class="memtemplate">
  258. template&lt;typename T, class A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  259. <table class="mlabels">
  260. <tr>
  261. <td class="mlabels-left">
  262. <table class="memname">
  263. <tr>
  264. <td class="memname"><a class="el" href="a00034.html#ae73fa352d781bdb9d01bfb77f2a8bc28">size_type</a> <a class="el" href="a00034.html">tbb::concurrent_bounded_queue</a>&lt; T, A &gt;::size </td>
  265. <td>(</td>
  266. <td class="paramname">)</td><td></td>
  267. <td> const</td>
  268. </tr>
  269. </table>
  270. </td>
  271. <td class="mlabels-right">
  272. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  273. </tr>
  274. </table>
  275. </div><div class="memdoc">
  276. <p>Return number of pushes minus number of pops. </p>
  277. <p>Note that the result can be negative if there are pops waiting for the corresponding pushes. The result can also exceed <a class="el" href="a00034.html#a526487063242569685af8c8d778d39e0" title="Maximum number of allowed elements. ">capacity()</a> if there are push operations in flight. </p>
  278. </div>
  279. </div>
  280. <a class="anchor" id="a3086cb4dcdeee245ef5cf34f72fb3e10"></a>
  281. <div class="memitem">
  282. <div class="memproto">
  283. <div class="memtemplate">
  284. template&lt;typename T, class A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  285. <table class="mlabels">
  286. <tr>
  287. <td class="mlabels-left">
  288. <table class="memname">
  289. <tr>
  290. <td class="memname">bool <a class="el" href="a00034.html">tbb::concurrent_bounded_queue</a>&lt; T, A &gt;::try_pop </td>
  291. <td>(</td>
  292. <td class="paramtype">T &amp;&#160;</td>
  293. <td class="paramname"><em>destination</em>)</td><td></td>
  294. <td></td>
  295. </tr>
  296. </table>
  297. </td>
  298. <td class="mlabels-right">
  299. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  300. </tr>
  301. </table>
  302. </div><div class="memdoc">
  303. <p>Attempt to dequeue an item from head of queue. </p>
  304. <p>Does not wait for item to become available. Returns true if successful; false otherwise. </p>
  305. <p>Referenced by <a class="el" href="a00039.html#a8d6825341ca673ea316202474a021174">tbb::deprecated::concurrent_queue&lt; T, A &gt;::pop_if_present()</a>.</p>
  306. </div>
  307. </div>
  308. <a class="anchor" id="a03d93a240841a21788396bebd71c51bd"></a>
  309. <div class="memitem">
  310. <div class="memproto">
  311. <div class="memtemplate">
  312. template&lt;typename T, class A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  313. <table class="mlabels">
  314. <tr>
  315. <td class="mlabels-left">
  316. <table class="memname">
  317. <tr>
  318. <td class="memname">bool <a class="el" href="a00034.html">tbb::concurrent_bounded_queue</a>&lt; T, A &gt;::try_push </td>
  319. <td>(</td>
  320. <td class="paramtype">const T &amp;&#160;</td>
  321. <td class="paramname"><em>source</em>)</td><td></td>
  322. <td></td>
  323. </tr>
  324. </table>
  325. </td>
  326. <td class="mlabels-right">
  327. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  328. </tr>
  329. </table>
  330. </div><div class="memdoc">
  331. <p>Enqueue an item at tail of queue if queue is not already full. </p>
  332. <p>Does not wait for queue to become not full. Returns true if item is pushed; false if queue was already full. </p>
  333. <p>Referenced by <a class="el" href="a00039.html#a129cde9f5f101ddd623619c838be07f3">tbb::deprecated::concurrent_queue&lt; T, A &gt;::push_if_not_full()</a>.</p>
  334. </div>
  335. </div>
  336. <hr/>The documentation for this class was generated from the following file:<ul>
  337. <li>concurrent_queue.h</li>
  338. </ul>
  339. </div><!-- contents -->
  340. <hr>
  341. <p></p>
  342. Copyright &copy; 2005-2014 Intel Corporation. All Rights Reserved.
  343. <p></p>
  344. Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
  345. registered trademarks or trademarks of Intel Corporation or its
  346. subsidiaries in the United States and other countries.
  347. <p></p>
  348. * Other names and brands may be claimed as the property of others.