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.
310 lines
23 KiB
310 lines
23 KiB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>tbb::concurrent_bounded_queue< T, A > Class Template Reference</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.4.7 -->
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li id="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
</ul></div>
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul></div>
|
|
<div class="nav">
|
|
<a class="el" href="a00428.html">tbb</a>::<a class="el" href="a00280.html">concurrent_bounded_queue</a></div>
|
|
<h1>tbb::concurrent_bounded_queue< T, A > Class Template Reference<br>
|
|
<small>
|
|
[<a class="el" href="a00442.html">Containers</a>]</small>
|
|
</h1><!-- doxytag: class="tbb::concurrent_bounded_queue" -->A high-performance thread-safe blocking concurrent bounded queue.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <concurrent_queue.h></code>
|
|
<p>
|
|
<p>Inheritance diagram for tbb::concurrent_bounded_queue< T, A >:
|
|
<p><center><img src="a00280.png" usemap="#tbb::concurrent_bounded_queue< T, A >_map" border="0" alt=""></center>
|
|
<map name="tbb::concurrent_bounded_queue< T, A >_map">
|
|
<area href="a00287.html" alt="tbb::deprecated::concurrent_queue< T, A >" shape="rect" coords="0,56,257,80">
|
|
</map>
|
|
<a href="a00036.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="98245517a931e5893f6601e66c51fc75"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::value_type" ref="98245517a931e5893f6601e66c51fc75" args="" -->
|
|
typedef T </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#98245517a931e5893f6601e66c51fc75">value_type</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Element type in the queue. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2e2726fccf6d975dc1071608cc0bbf90"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::allocator_type" ref="2e2726fccf6d975dc1071608cc0bbf90" args="" -->
|
|
typedef A </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#2e2726fccf6d975dc1071608cc0bbf90">allocator_type</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocator type. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dcd44ca6a88c0dc7a847a47a10811f0c"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::reference" ref="dcd44ca6a88c0dc7a847a47a10811f0c" args="" -->
|
|
typedef T & </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#dcd44ca6a88c0dc7a847a47a10811f0c">reference</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Reference type. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="796713d0b9ba93a4721cbe13e4474068"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::const_reference" ref="796713d0b9ba93a4721cbe13e4474068" args="" -->
|
|
typedef const T & </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#796713d0b9ba93a4721cbe13e4474068">const_reference</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Const reference type. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::ptrdiff_t </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#a80e4c11dbb324e4b92a24a77bbcde68">size_type</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Integral type for representing size of the queue. <a href="#a80e4c11dbb324e4b92a24a77bbcde68"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4b45c91297e69515d83d5eef85ae1f49"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::difference_type" ref="4b45c91297e69515d83d5eef85ae1f49" args="" -->
|
|
typedef std::ptrdiff_t </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#4b45c91297e69515d83d5eef85ae1f49">difference_type</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Difference type for iterator. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="aeea2ad38b7e7fc2866f063dfed24c52"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::iterator" ref="aeea2ad38b7e7fc2866f063dfed24c52" args="" -->
|
|
typedef internal::concurrent_queue_iterator<<br>
|
|
<a class="el" href="a00280.html">concurrent_bounded_queue</a>,<br>
|
|
T > </td><td class="memItemRight" valign="bottom"><b>iterator</b></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0edd1a90e6ffa503bac1c4027116dbff"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::const_iterator" ref="0edd1a90e6ffa503bac1c4027116dbff" args="" -->
|
|
typedef internal::concurrent_queue_iterator<<br>
|
|
<a class="el" href="a00280.html">concurrent_bounded_queue</a>,<br>
|
|
const T > </td><td class="memItemRight" valign="bottom"><b>const_iterator</b></td></tr>
|
|
|
|
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e3525226732963ff0f13e89d8e6dab5b"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::concurrent_bounded_queue" ref="e3525226732963ff0f13e89d8e6dab5b" args="(const allocator_type &a=allocator_type())" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#e3525226732963ff0f13e89d8e6dab5b">concurrent_bounded_queue</a> (const <a class="el" href="a00280.html#2e2726fccf6d975dc1071608cc0bbf90">allocator_type</a> &a=<a class="el" href="a00280.html#2e2726fccf6d975dc1071608cc0bbf90">allocator_type</a>())</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct empty queue. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7b7fb414d2eaa8a7f5d68fc4cd63ac50"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::concurrent_bounded_queue" ref="7b7fb414d2eaa8a7f5d68fc4cd63ac50" args="(const concurrent_bounded_queue &src, const allocator_type &a=allocator_type())" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#7b7fb414d2eaa8a7f5d68fc4cd63ac50">concurrent_bounded_queue</a> (const <a class="el" href="a00280.html">concurrent_bounded_queue</a> &src, const <a class="el" href="a00280.html#2e2726fccf6d975dc1071608cc0bbf90">allocator_type</a> &a=<a class="el" href="a00280.html#2e2726fccf6d975dc1071608cc0bbf90">allocator_type</a>())</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <br></td></tr>
|
|
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="a5e04dcd7db9fd9b583b4e7df832246a"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::concurrent_bounded_queue" ref="a5e04dcd7db9fd9b583b4e7df832246a" args="(InputIterator begin, InputIterator end, const allocator_type &a=allocator_type())" -->
|
|
template<typename InputIterator> </td></tr>
|
|
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top"> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00280.html#a5e04dcd7db9fd9b583b4e7df832246a">concurrent_bounded_queue</a> (InputIterator begin, InputIterator end, const <a class="el" href="a00280.html#2e2726fccf6d975dc1071608cc0bbf90">allocator_type</a> &a=<a class="el" href="a00280.html#2e2726fccf6d975dc1071608cc0bbf90">allocator_type</a>())</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">[begin,end) constructor <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="acaf5b510dc0dfc7780b8c956cf773cf"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::~concurrent_bounded_queue" ref="acaf5b510dc0dfc7780b8c956cf773cf" args="()" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#acaf5b510dc0dfc7780b8c956cf773cf">~concurrent_bounded_queue</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy queue. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ceb08c743b11ba88c878e73fff8af20b"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::push" ref="ceb08c743b11ba88c878e73fff8af20b" args="(const T &source)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#ceb08c743b11ba88c878e73fff8af20b">push</a> (const T &source)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Enqueue an item at tail of queue. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#41f4c6bd7a82ab070e840bbf81b0b123">pop</a> (T &destination)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Dequeue item from head of queue. <a href="#41f4c6bd7a82ab070e840bbf81b0b123"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="86c77a6c1317239405968f5afc7b10d3"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::abort" ref="86c77a6c1317239405968f5afc7b10d3" args="()" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#86c77a6c1317239405968f5afc7b10d3">abort</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Abort all pending queue operations. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#2bd6232531279fb3ccbd296bea23066b">try_push</a> (const T &source)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Enqueue an item at tail of queue if queue is not already full. <a href="#2bd6232531279fb3ccbd296bea23066b"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#0ca487019bbb00a196442aff78a1e4f7">try_pop</a> (T &destination)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Attempt to dequeue an item from head of queue. <a href="#0ca487019bbb00a196442aff78a1e4f7"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00280.html#a80e4c11dbb324e4b92a24a77bbcde68">size_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#7dc14d1a579a4cccda9f857585e1768d">size</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return number of pushes minus number of pops. <a href="#7dc14d1a579a4cccda9f857585e1768d"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f64924f2ee9225c368a270fc3c394db9"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::empty" ref="f64924f2ee9225c368a270fc3c394db9" args="() const " -->
|
|
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#f64924f2ee9225c368a270fc3c394db9">empty</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Equivalent to <a class="el" href="a00280.html#7dc14d1a579a4cccda9f857585e1768d">size()</a><=0. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b2888b3e4e837d7e03f2c731963a402b"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::capacity" ref="b2888b3e4e837d7e03f2c731963a402b" args="() const " -->
|
|
<a class="el" href="a00280.html#a80e4c11dbb324e4b92a24a77bbcde68">size_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#b2888b3e4e837d7e03f2c731963a402b">capacity</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Maximum number of allowed elements. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#f3c6c934f85fd02aedbc83a16943193b">set_capacity</a> (<a class="el" href="a00280.html#a80e4c11dbb324e4b92a24a77bbcde68">size_type</a> new_capacity)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the capacity. <a href="#f3c6c934f85fd02aedbc83a16943193b"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="415eb87e53b1c6a266de06ecbc490d16"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::get_allocator" ref="415eb87e53b1c6a266de06ecbc490d16" args="() const " -->
|
|
<a class="el" href="a00280.html#2e2726fccf6d975dc1071608cc0bbf90">allocator_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#415eb87e53b1c6a266de06ecbc490d16">get_allocator</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">return allocator object <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="90b31e2954c6e4596c7900435a5f4bc1"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::clear" ref="90b31e2954c6e4596c7900435a5f4bc1" args="()" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00280.html#90b31e2954c6e4596c7900435a5f4bc1">clear</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">clear the queue. not thread-safe. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5a2637188e104503ac2c0dff633014e8"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::unsafe_begin" ref="5a2637188e104503ac2c0dff633014e8" args="()" -->
|
|
iterator </td><td class="memItemRight" valign="bottom"><b>unsafe_begin</b> ()</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c7267334ef11087c76c810abb9d5cbc2"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::unsafe_end" ref="c7267334ef11087c76c810abb9d5cbc2" args="()" -->
|
|
iterator </td><td class="memItemRight" valign="bottom"><b>unsafe_end</b> ()</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8be757841d0bbf7744508aaf6a141d08"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::unsafe_begin" ref="8be757841d0bbf7744508aaf6a141d08" args="() const " -->
|
|
const_iterator </td><td class="memItemRight" valign="bottom"><b>unsafe_begin</b> () const </td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3aac91d288bf227d9d06717b44ef28f7"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::unsafe_end" ref="3aac91d288bf227d9d06717b44ef28f7" args="() const " -->
|
|
const_iterator </td><td class="memItemRight" valign="bottom"><b>unsafe_end</b> () const </td></tr>
|
|
|
|
<tr><td colspan="2"><br><h2>Friends</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="05bffad9626d51abbd4bb82ae2a1cceb"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::internal::concurrent_queue_iterator" ref="05bffad9626d51abbd4bb82ae2a1cceb" args="" -->
|
|
class </td><td class="memItemRight" valign="bottom"><b>internal::concurrent_queue_iterator</b></td></tr>
|
|
|
|
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b>destroyer</b></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class used to ensure exception-safety of method "pop". <br></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
<h3>template<typename T, class A = cache_aligned_allocator<T>><br>
|
|
class tbb::concurrent_bounded_queue< T, A ></h3>
|
|
|
|
A high-performance thread-safe blocking concurrent bounded queue.
|
|
<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>
|
|
<hr><h2>Member Typedef Documentation</h2>
|
|
<a class="anchor" name="a80e4c11dbb324e4b92a24a77bbcde68"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::size_type" ref="a80e4c11dbb324e4b92a24a77bbcde68" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename T, class A = cache_aligned_allocator<T>> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef std::ptrdiff_t <a class="el" href="a00280.html">tbb::concurrent_bounded_queue</a>< T, A >::<a class="el" href="a00280.html#a80e4c11dbb324e4b92a24a77bbcde68">size_type</a> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Integral type for representing size of the queue.
|
|
<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.
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="41f4c6bd7a82ab070e840bbf81b0b123"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::pop" ref="41f4c6bd7a82ab070e840bbf81b0b123" args="(T &destination)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename T, class A = cache_aligned_allocator<T>> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void <a class="el" href="a00280.html">tbb::concurrent_bounded_queue</a>< T, A >::pop </td>
|
|
<td>(</td>
|
|
<td class="paramtype">T & </td>
|
|
<td class="paramname"> <em>destination</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Dequeue item from head of queue.
|
|
<p>
|
|
Block until an item becomes available, and then dequeue it.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="f3c6c934f85fd02aedbc83a16943193b"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::set_capacity" ref="f3c6c934f85fd02aedbc83a16943193b" args="(size_type new_capacity)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename T, class A = cache_aligned_allocator<T>> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void <a class="el" href="a00280.html">tbb::concurrent_bounded_queue</a>< T, A >::set_capacity </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="a00280.html#a80e4c11dbb324e4b92a24a77bbcde68">size_type</a> </td>
|
|
<td class="paramname"> <em>new_capacity</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Set the capacity.
|
|
<p>
|
|
Setting the capacity to 0 causes subsequent try_push operations to always fail, and subsequent push operations to block forever.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="7dc14d1a579a4cccda9f857585e1768d"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::size" ref="7dc14d1a579a4cccda9f857585e1768d" args="() const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename T, class A = cache_aligned_allocator<T>> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="a00280.html#a80e4c11dbb324e4b92a24a77bbcde68">size_type</a> <a class="el" href="a00280.html">tbb::concurrent_bounded_queue</a>< T, A >::size </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"> const<code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Return number of pushes minus number of pops.
|
|
<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="a00280.html#b2888b3e4e837d7e03f2c731963a402b">capacity()</a> if there are push operations in flight.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="0ca487019bbb00a196442aff78a1e4f7"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::try_pop" ref="0ca487019bbb00a196442aff78a1e4f7" args="(T &destination)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename T, class A = cache_aligned_allocator<T>> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="a00280.html">tbb::concurrent_bounded_queue</a>< T, A >::try_pop </td>
|
|
<td>(</td>
|
|
<td class="paramtype">T & </td>
|
|
<td class="paramname"> <em>destination</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Attempt to dequeue an item from head of queue.
|
|
<p>
|
|
Does not wait for item to become available. Returns true if successful; false otherwise.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="2bd6232531279fb3ccbd296bea23066b"></a><!-- doxytag: member="tbb::concurrent_bounded_queue::try_push" ref="2bd6232531279fb3ccbd296bea23066b" args="(const T &source)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename T, class A = cache_aligned_allocator<T>> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="a00280.html">tbb::concurrent_bounded_queue</a>< T, A >::try_push </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const T & </td>
|
|
<td class="paramname"> <em>source</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Enqueue an item at tail of queue if queue is not already full.
|
|
<p>
|
|
Does not wait for queue to become not full. Returns true if item is pushed; false if queue was already full.
|
|
</div>
|
|
</div><p>
|
|
<hr>The documentation for this class was generated from the following file:<ul>
|
|
<li>concurrent_queue.h</ul>
|
|
<hr>
|
|
<p></p>
|
|
Copyright © 2005-2013 Intel Corporation. All Rights Reserved.
|
|
<p></p>
|
|
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
|
|
registered trademarks or trademarks of Intel Corporation or its
|
|
subsidiaries in the United States and other countries.
|
|
<p></p>
|
|
* Other names and brands may be claimed as the property of others.
|