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.

348 lines
24 KiB

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
  3. <title>tbb::interface5::concurrent_priority_queue&lt; T, Compare, A &gt; Class Template Reference</title>
  4. <link href="doxygen.css" rel="stylesheet" type="text/css">
  5. <link href="tabs.css" rel="stylesheet" type="text/css">
  6. </head><body>
  7. <!-- Generated by Doxygen 1.4.7 -->
  8. <div class="tabs">
  9. <ul>
  10. <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
  11. <li><a href="modules.html"><span>Modules</span></a></li>
  12. <li><a href="namespaces.html"><span>Namespaces</span></a></li>
  13. <li id="current"><a href="annotated.html"><span>Classes</span></a></li>
  14. <li><a href="files.html"><span>Files</span></a></li>
  15. <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  16. </ul></div>
  17. <div class="tabs">
  18. <ul>
  19. <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
  20. <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
  21. <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  22. </ul></div>
  23. <div class="nav">
  24. <a class="el" href="a00428.html">tbb</a>::<b>interface5</b>::<a class="el" href="a00285.html">concurrent_priority_queue</a></div>
  25. <h1>tbb::interface5::concurrent_priority_queue&lt; T, Compare, A &gt; Class Template Reference</h1><!-- doxytag: class="tbb::interface5::concurrent_priority_queue" -->Concurrent priority queue.
  26. <a href="#_details">More...</a>
  27. <p>
  28. <code>#include &lt;concurrent_priority_queue.h&gt;</code>
  29. <p>
  30. <a href="a00031.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
  31. <tr><td></td></tr>
  32. <tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
  33. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7c611a6b5b8f94b0e7f2afc97e31efb1"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::value_type" ref="7c611a6b5b8f94b0e7f2afc97e31efb1" args="" -->
  34. typedef T&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#7c611a6b5b8f94b0e7f2afc97e31efb1">value_type</a></td></tr>
  35. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Element type in the queue. <br></td></tr>
  36. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5804b3c708ef4e50d603f918ef2b9e58"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::reference" ref="5804b3c708ef4e50d603f918ef2b9e58" args="" -->
  37. typedef T &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#5804b3c708ef4e50d603f918ef2b9e58">reference</a></td></tr>
  38. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reference type. <br></td></tr>
  39. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a4ded8601a434098605be0dcc4febc60"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::const_reference" ref="a4ded8601a434098605be0dcc4febc60" args="" -->
  40. typedef const T &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#a4ded8601a434098605be0dcc4febc60">const_reference</a></td></tr>
  41. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Const reference type. <br></td></tr>
  42. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b679eea8d01d041625a39f719ca2b7ed"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::size_type" ref="b679eea8d01d041625a39f719ca2b7ed" args="" -->
  43. typedef size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#b679eea8d01d041625a39f719ca2b7ed">size_type</a></td></tr>
  44. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Integral type for representing size of the queue. <br></td></tr>
  45. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="77399bc76b3ecd60e33f7e35a5becd87"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::difference_type" ref="77399bc76b3ecd60e33f7e35a5becd87" args="" -->
  46. typedef ptrdiff_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#77399bc76b3ecd60e33f7e35a5becd87">difference_type</a></td></tr>
  47. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Difference type for iterator. <br></td></tr>
  48. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1712cb3a46bc1821fccc5e2cd83d5cd7"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::allocator_type" ref="1712cb3a46bc1821fccc5e2cd83d5cd7" args="" -->
  49. typedef A&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#1712cb3a46bc1821fccc5e2cd83d5cd7">allocator_type</a></td></tr>
  50. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocator type. <br></td></tr>
  51. <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
  52. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="eefa40599afe00ea393897d8f5662e65"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::concurrent_priority_queue" ref="eefa40599afe00ea393897d8f5662e65" args="(const allocator_type &amp;a=allocator_type())" -->
  53. &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#eefa40599afe00ea393897d8f5662e65">concurrent_priority_queue</a> (const <a class="el" href="a00285.html#1712cb3a46bc1821fccc5e2cd83d5cd7">allocator_type</a> &amp;a=<a class="el" href="a00285.html#1712cb3a46bc1821fccc5e2cd83d5cd7">allocator_type</a>())</td></tr>
  54. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a new <a class="el" href="a00285.html">concurrent_priority_queue</a> with default capacity. <br></td></tr>
  55. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4555b4a55415a70024c4004b51e9f385"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::concurrent_priority_queue" ref="4555b4a55415a70024c4004b51e9f385" args="(size_type init_capacity, const allocator_type &amp;a=allocator_type())" -->
  56. &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#4555b4a55415a70024c4004b51e9f385">concurrent_priority_queue</a> (<a class="el" href="a00285.html#b679eea8d01d041625a39f719ca2b7ed">size_type</a> init_capacity, const <a class="el" href="a00285.html#1712cb3a46bc1821fccc5e2cd83d5cd7">allocator_type</a> &amp;a=<a class="el" href="a00285.html#1712cb3a46bc1821fccc5e2cd83d5cd7">allocator_type</a>())</td></tr>
  57. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a new <a class="el" href="a00285.html">concurrent_priority_queue</a> with init_sz capacity. <br></td></tr>
  58. <tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="9147cb4207017c260a0c3929c12cd40f"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::concurrent_priority_queue" ref="9147cb4207017c260a0c3929c12cd40f" args="(InputIterator begin, InputIterator end, const allocator_type &amp;a=allocator_type())" -->
  59. template&lt;typename InputIterator&gt; </td></tr>
  60. <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00285.html#9147cb4207017c260a0c3929c12cd40f">concurrent_priority_queue</a> (InputIterator begin, InputIterator end, const <a class="el" href="a00285.html#1712cb3a46bc1821fccc5e2cd83d5cd7">allocator_type</a> &amp;a=<a class="el" href="a00285.html#1712cb3a46bc1821fccc5e2cd83d5cd7">allocator_type</a>())</td></tr>
  61. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">[begin,end) constructor <br></td></tr>
  62. <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#509419e320f200456d89dc54a65140b3">concurrent_priority_queue</a> (const <a class="el" href="a00285.html">concurrent_priority_queue</a> &amp;src)</td></tr>
  63. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Copy constructor. <a href="#509419e320f200456d89dc54a65140b3"></a><br></td></tr>
  64. <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#c8b20e7430c5302936030bef59a562be">concurrent_priority_queue</a> (const <a class="el" href="a00285.html">concurrent_priority_queue</a> &amp;src, const <a class="el" href="a00285.html#1712cb3a46bc1821fccc5e2cd83d5cd7">allocator_type</a> &amp;a)</td></tr>
  65. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Copy constructor with specific allocator. <a href="#c8b20e7430c5302936030bef59a562be"></a><br></td></tr>
  66. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00285.html">concurrent_priority_queue</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#2ab7f7808891027ac0f0f5b3a4be51e9">operator=</a> (const <a class="el" href="a00285.html">concurrent_priority_queue</a> &amp;src)</td></tr>
  67. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assignment operator. <a href="#2ab7f7808891027ac0f0f5b3a4be51e9"></a><br></td></tr>
  68. <tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#317c508fa92df218be5d014c26c09bb7">empty</a> () const </td></tr>
  69. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if empty, false otherwise. <a href="#317c508fa92df218be5d014c26c09bb7"></a><br></td></tr>
  70. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00285.html#b679eea8d01d041625a39f719ca2b7ed">size_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#8b2ae25c61338c6fd59e94fe09822ba5">size</a> () const </td></tr>
  71. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the current number of elements contained in the queue. <a href="#8b2ae25c61338c6fd59e94fe09822ba5"></a><br></td></tr>
  72. <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#d905af7b8f6defff562f5ae9c3275763">push</a> (<a class="el" href="a00285.html#a4ded8601a434098605be0dcc4febc60">const_reference</a> elem)</td></tr>
  73. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pushes elem onto the queue, increasing capacity of queue if necessary. <a href="#d905af7b8f6defff562f5ae9c3275763"></a><br></td></tr>
  74. <tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#e036461a29cc40902a2bb79abf9f5146">try_pop</a> (<a class="el" href="a00285.html#5804b3c708ef4e50d603f918ef2b9e58">reference</a> elem)</td></tr>
  75. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets a reference to and removes highest priority element. <a href="#e036461a29cc40902a2bb79abf9f5146"></a><br></td></tr>
  76. <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#0bdcdf7cde9fd369edca845bec34ca94">clear</a> ()</td></tr>
  77. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clear the queue; not thread-safe. <a href="#0bdcdf7cde9fd369edca845bec34ca94"></a><br></td></tr>
  78. <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#0ecdc6a04aa259374425d424ca2a6082">swap</a> (<a class="el" href="a00285.html">concurrent_priority_queue</a> &amp;q)</td></tr>
  79. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Swap this queue with another; not thread-safe. <a href="#0ecdc6a04aa259374425d424ca2a6082"></a><br></td></tr>
  80. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d545d444fb0d16148f9b61fd89f9a337"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::get_allocator" ref="d545d444fb0d16148f9b61fd89f9a337" args="() const " -->
  81. <a class="el" href="a00285.html#1712cb3a46bc1821fccc5e2cd83d5cd7">allocator_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00285.html#d545d444fb0d16148f9b61fd89f9a337">get_allocator</a> () const </td></tr>
  82. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return allocator object. <br></td></tr>
  83. <tr><td colspan="2"><br><h2>Classes</h2></td></tr>
  84. <tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><b>cpq_operation</b></td></tr>
  85. <tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><b>my_functor_t</b></td></tr>
  86. </table>
  87. <hr><a name="_details"></a><h2>Detailed Description</h2>
  88. <h3>template&lt;typename T, typename Compare = std::less&lt;T&gt;, typename A = cache_aligned_allocator&lt;T&gt;&gt;<br>
  89. class tbb::interface5::concurrent_priority_queue&lt; T, Compare, A &gt;</h3>
  90. Concurrent priority queue.
  91. <p>
  92. <hr><h2>Constructor &amp; Destructor Documentation</h2>
  93. <a class="anchor" name="509419e320f200456d89dc54a65140b3"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::concurrent_priority_queue" ref="509419e320f200456d89dc54a65140b3" args="(const concurrent_priority_queue &amp;src)" -->
  94. <div class="memitem">
  95. <div class="memproto">
  96. <div class="memtemplate">
  97. template&lt;typename T, typename Compare = std::less&lt;T&gt;, typename A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  98. <table class="memname">
  99. <tr>
  100. <td class="memname"><a class="el" href="a00285.html">tbb::interface5::concurrent_priority_queue</a>&lt; T, Compare, A &gt;::<a class="el" href="a00285.html">concurrent_priority_queue</a> </td>
  101. <td>(</td>
  102. <td class="paramtype">const <a class="el" href="a00285.html">concurrent_priority_queue</a>&lt; T, Compare, A &gt; &amp;&nbsp;</td>
  103. <td class="paramname"> <em>src</em> </td>
  104. <td>&nbsp;)&nbsp;</td>
  105. <td width="100%"><code> [inline, explicit]</code></td>
  106. </tr>
  107. </table>
  108. </div>
  109. <div class="memdoc">
  110. <p>
  111. Copy constructor.
  112. <p>
  113. This operation is unsafe if there are pending concurrent operations on the src queue.
  114. </div>
  115. </div><p>
  116. <a class="anchor" name="c8b20e7430c5302936030bef59a562be"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::concurrent_priority_queue" ref="c8b20e7430c5302936030bef59a562be" args="(const concurrent_priority_queue &amp;src, const allocator_type &amp;a)" -->
  117. <div class="memitem">
  118. <div class="memproto">
  119. <div class="memtemplate">
  120. template&lt;typename T, typename Compare = std::less&lt;T&gt;, typename A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  121. <table class="memname">
  122. <tr>
  123. <td class="memname"><a class="el" href="a00285.html">tbb::interface5::concurrent_priority_queue</a>&lt; T, Compare, A &gt;::<a class="el" href="a00285.html">concurrent_priority_queue</a> </td>
  124. <td>(</td>
  125. <td class="paramtype">const <a class="el" href="a00285.html">concurrent_priority_queue</a>&lt; T, Compare, A &gt; &amp;&nbsp;</td>
  126. <td class="paramname"> <em>src</em>, </td>
  127. </tr>
  128. <tr>
  129. <td class="paramkey"></td>
  130. <td></td>
  131. <td class="paramtype">const <a class="el" href="a00285.html#1712cb3a46bc1821fccc5e2cd83d5cd7">allocator_type</a> &amp;&nbsp;</td>
  132. <td class="paramname"> <em>a</em></td><td>&nbsp;</td>
  133. </tr>
  134. <tr>
  135. <td></td>
  136. <td>)</td>
  137. <td></td><td></td><td width="100%"><code> [inline]</code></td>
  138. </tr>
  139. </table>
  140. </div>
  141. <div class="memdoc">
  142. <p>
  143. Copy constructor with specific allocator.
  144. <p>
  145. This operation is unsafe if there are pending concurrent operations on the src queue.
  146. </div>
  147. </div><p>
  148. <hr><h2>Member Function Documentation</h2>
  149. <a class="anchor" name="0bdcdf7cde9fd369edca845bec34ca94"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::clear" ref="0bdcdf7cde9fd369edca845bec34ca94" args="()" -->
  150. <div class="memitem">
  151. <div class="memproto">
  152. <div class="memtemplate">
  153. template&lt;typename T, typename Compare = std::less&lt;T&gt;, typename A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  154. <table class="memname">
  155. <tr>
  156. <td class="memname">void <a class="el" href="a00285.html">tbb::interface5::concurrent_priority_queue</a>&lt; T, Compare, A &gt;::clear </td>
  157. <td>(</td>
  158. <td class="paramname"> </td>
  159. <td>&nbsp;)&nbsp;</td>
  160. <td width="100%"><code> [inline]</code></td>
  161. </tr>
  162. </table>
  163. </div>
  164. <div class="memdoc">
  165. <p>
  166. Clear the queue; not thread-safe.
  167. <p>
  168. This operation is unsafe if there are pending concurrent operations on the queue. Resets size, effectively emptying queue; does not free space. May not clear elements added in pending operations.
  169. </div>
  170. </div><p>
  171. <a class="anchor" name="317c508fa92df218be5d014c26c09bb7"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::empty" ref="317c508fa92df218be5d014c26c09bb7" args="() const " -->
  172. <div class="memitem">
  173. <div class="memproto">
  174. <div class="memtemplate">
  175. template&lt;typename T, typename Compare = std::less&lt;T&gt;, typename A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  176. <table class="memname">
  177. <tr>
  178. <td class="memname">bool <a class="el" href="a00285.html">tbb::interface5::concurrent_priority_queue</a>&lt; T, Compare, A &gt;::empty </td>
  179. <td>(</td>
  180. <td class="paramname"> </td>
  181. <td>&nbsp;)&nbsp;</td>
  182. <td width="100%"> const<code> [inline]</code></td>
  183. </tr>
  184. </table>
  185. </div>
  186. <div class="memdoc">
  187. <p>
  188. Returns true if empty, false otherwise.
  189. <p>
  190. Returned value may not reflect results of pending operations. This operation reads shared data and will trigger a race condition.
  191. </div>
  192. </div><p>
  193. <a class="anchor" name="2ab7f7808891027ac0f0f5b3a4be51e9"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::operator=" ref="2ab7f7808891027ac0f0f5b3a4be51e9" args="(const concurrent_priority_queue &amp;src)" -->
  194. <div class="memitem">
  195. <div class="memproto">
  196. <div class="memtemplate">
  197. template&lt;typename T, typename Compare = std::less&lt;T&gt;, typename A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  198. <table class="memname">
  199. <tr>
  200. <td class="memname"><a class="el" href="a00285.html">concurrent_priority_queue</a>&amp; <a class="el" href="a00285.html">tbb::interface5::concurrent_priority_queue</a>&lt; T, Compare, A &gt;::operator= </td>
  201. <td>(</td>
  202. <td class="paramtype">const <a class="el" href="a00285.html">concurrent_priority_queue</a>&lt; T, Compare, A &gt; &amp;&nbsp;</td>
  203. <td class="paramname"> <em>src</em> </td>
  204. <td>&nbsp;)&nbsp;</td>
  205. <td width="100%"><code> [inline]</code></td>
  206. </tr>
  207. </table>
  208. </div>
  209. <div class="memdoc">
  210. <p>
  211. Assignment operator.
  212. <p>
  213. This operation is unsafe if there are pending concurrent operations on the src queue.
  214. </div>
  215. </div><p>
  216. <a class="anchor" name="d905af7b8f6defff562f5ae9c3275763"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::push" ref="d905af7b8f6defff562f5ae9c3275763" args="(const_reference elem)" -->
  217. <div class="memitem">
  218. <div class="memproto">
  219. <div class="memtemplate">
  220. template&lt;typename T, typename Compare = std::less&lt;T&gt;, typename A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  221. <table class="memname">
  222. <tr>
  223. <td class="memname">void <a class="el" href="a00285.html">tbb::interface5::concurrent_priority_queue</a>&lt; T, Compare, A &gt;::push </td>
  224. <td>(</td>
  225. <td class="paramtype"><a class="el" href="a00285.html#a4ded8601a434098605be0dcc4febc60">const_reference</a>&nbsp;</td>
  226. <td class="paramname"> <em>elem</em> </td>
  227. <td>&nbsp;)&nbsp;</td>
  228. <td width="100%"><code> [inline]</code></td>
  229. </tr>
  230. </table>
  231. </div>
  232. <div class="memdoc">
  233. <p>
  234. Pushes elem onto the queue, increasing capacity of queue if necessary.
  235. <p>
  236. This operation can be safely used concurrently with other push, try_pop or reserve operations.
  237. </div>
  238. </div><p>
  239. <a class="anchor" name="8b2ae25c61338c6fd59e94fe09822ba5"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::size" ref="8b2ae25c61338c6fd59e94fe09822ba5" args="() const " -->
  240. <div class="memitem">
  241. <div class="memproto">
  242. <div class="memtemplate">
  243. template&lt;typename T, typename Compare = std::less&lt;T&gt;, typename A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  244. <table class="memname">
  245. <tr>
  246. <td class="memname"><a class="el" href="a00285.html#b679eea8d01d041625a39f719ca2b7ed">size_type</a> <a class="el" href="a00285.html">tbb::interface5::concurrent_priority_queue</a>&lt; T, Compare, A &gt;::size </td>
  247. <td>(</td>
  248. <td class="paramname"> </td>
  249. <td>&nbsp;)&nbsp;</td>
  250. <td width="100%"> const<code> [inline]</code></td>
  251. </tr>
  252. </table>
  253. </div>
  254. <div class="memdoc">
  255. <p>
  256. Returns the current number of elements contained in the queue.
  257. <p>
  258. Returned value may not reflect results of pending operations. This operation reads shared data and will trigger a race condition.
  259. </div>
  260. </div><p>
  261. <a class="anchor" name="0ecdc6a04aa259374425d424ca2a6082"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::swap" ref="0ecdc6a04aa259374425d424ca2a6082" args="(concurrent_priority_queue &amp;q)" -->
  262. <div class="memitem">
  263. <div class="memproto">
  264. <div class="memtemplate">
  265. template&lt;typename T, typename Compare = std::less&lt;T&gt;, typename A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  266. <table class="memname">
  267. <tr>
  268. <td class="memname">void <a class="el" href="a00285.html">tbb::interface5::concurrent_priority_queue</a>&lt; T, Compare, A &gt;::swap </td>
  269. <td>(</td>
  270. <td class="paramtype"><a class="el" href="a00285.html">concurrent_priority_queue</a>&lt; T, Compare, A &gt; &amp;&nbsp;</td>
  271. <td class="paramname"> <em>q</em> </td>
  272. <td>&nbsp;)&nbsp;</td>
  273. <td width="100%"><code> [inline]</code></td>
  274. </tr>
  275. </table>
  276. </div>
  277. <div class="memdoc">
  278. <p>
  279. Swap this queue with another; not thread-safe.
  280. <p>
  281. This operation is unsafe if there are pending concurrent operations on the queue.
  282. </div>
  283. </div><p>
  284. <a class="anchor" name="e036461a29cc40902a2bb79abf9f5146"></a><!-- doxytag: member="tbb::interface5::concurrent_priority_queue::try_pop" ref="e036461a29cc40902a2bb79abf9f5146" args="(reference elem)" -->
  285. <div class="memitem">
  286. <div class="memproto">
  287. <div class="memtemplate">
  288. template&lt;typename T, typename Compare = std::less&lt;T&gt;, typename A = cache_aligned_allocator&lt;T&gt;&gt; </div>
  289. <table class="memname">
  290. <tr>
  291. <td class="memname">bool <a class="el" href="a00285.html">tbb::interface5::concurrent_priority_queue</a>&lt; T, Compare, A &gt;::try_pop </td>
  292. <td>(</td>
  293. <td class="paramtype"><a class="el" href="a00285.html#5804b3c708ef4e50d603f918ef2b9e58">reference</a>&nbsp;</td>
  294. <td class="paramname"> <em>elem</em> </td>
  295. <td>&nbsp;)&nbsp;</td>
  296. <td width="100%"><code> [inline]</code></td>
  297. </tr>
  298. </table>
  299. </div>
  300. <div class="memdoc">
  301. <p>
  302. Gets a reference to and removes highest priority element.
  303. <p>
  304. If a highest priority element was found, sets elem and returns true, otherwise returns false. This operation can be safely used concurrently with other push, try_pop or reserve operations.
  305. </div>
  306. </div><p>
  307. <hr>The documentation for this class was generated from the following file:<ul>
  308. <li>concurrent_priority_queue.h</ul>
  309. <hr>
  310. <p></p>
  311. Copyright &copy; 2005-2013 Intel Corporation. All Rights Reserved.
  312. <p></p>
  313. Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
  314. registered trademarks or trademarks of Intel Corporation or its
  315. subsidiaries in the United States and other countries.
  316. <p></p>
  317. * Other names and brands may be claimed as the property of others.