shaka-packager/docs/d5/d33/classshaka_1_1media_1_1Prod...

510 lines
28 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Shaka Packager SDK: shaka::media::ProducerConsumerQueue&lt; T &gt; Class Template Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Shaka Packager SDK
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
<li><a href="../../namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="../../annotated.html"><span>Classes</span></a></li>
<li><a href="../../files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="../../search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="../../annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="../../classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="../../hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="../../functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="../../d8/daf/namespaceshaka.html">shaka</a></li><li class="navelem"><b>media</b></li><li class="navelem"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">ProducerConsumerQueue</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="../../dd/dc4/classshaka_1_1media_1_1ProducerConsumerQueue-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">shaka::media::ProducerConsumerQueue&lt; T &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad7ccb149baa88e5f8356be18344d2baf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#ad7ccb149baa88e5f8356be18344d2baf">ProducerConsumerQueue</a> (size_t capacity)</td></tr>
<tr class="separator:ad7ccb149baa88e5f8356be18344d2baf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80ff75afdbbf7f567dcb57a755542ffc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a80ff75afdbbf7f567dcb57a755542ffc">ProducerConsumerQueue</a> (size_t capacity, size_t starting_pos)</td></tr>
<tr class="separator:a80ff75afdbbf7f567dcb57a755542ffc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6eaf80daa8c96b0157f5fcd9763dbec1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a6eaf80daa8c96b0157f5fcd9763dbec1">Push</a> (const T &amp;element, int64_t timeout_ms)</td></tr>
<tr class="separator:a6eaf80daa8c96b0157f5fcd9763dbec1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a935e9ddee232be82d224c9b81b3b4f88"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a935e9ddee232be82d224c9b81b3b4f88">Pop</a> (T *element, int64_t timeout_ms)</td></tr>
<tr class="separator:a935e9ddee232be82d224c9b81b3b4f88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92d6cca0ecfb54f6edf9a0408305e9cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a92d6cca0ecfb54f6edf9a0408305e9cd">Peek</a> (size_t pos, T *element, int64_t timeout_ms)</td></tr>
<tr class="separator:a92d6cca0ecfb54f6edf9a0408305e9cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac600977b708381facf07f87e36b43d79"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#ac600977b708381facf07f87e36b43d79">Stop</a> ()</td></tr>
<tr class="separator:ac600977b708381facf07f87e36b43d79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad20705b713d6b5ded3312d800740b7ff"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#ad20705b713d6b5ded3312d800740b7ff">Empty</a> () const </td></tr>
<tr class="separator:ad20705b713d6b5ded3312d800740b7ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f2483c665f2693f583e7b467101d844"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a4f2483c665f2693f583e7b467101d844">Size</a> () const </td></tr>
<tr class="separator:a4f2483c665f2693f583e7b467101d844"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c5d10a81c6b9e6db8b8d6b61baf1902"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a0c5d10a81c6b9e6db8b8d6b61baf1902">HeadPos</a> () const </td></tr>
<tr class="separator:a0c5d10a81c6b9e6db8b8d6b61baf1902"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a48278d994c0c170b408191d7d994b7"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a8a48278d994c0c170b408191d7d994b7">TailPos</a> () const </td></tr>
<tr class="separator:a8a48278d994c0c170b408191d7d994b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d88bdebfa412f2847f1d96fd804bba1"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a3d88bdebfa412f2847f1d96fd804bba1">Stopped</a> () const </td></tr>
<tr class="separator:a3d88bdebfa412f2847f1d96fd804bba1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;class T&gt;<br/>
class shaka::media::ProducerConsumerQueue&lt; T &gt;</h3>
<p>A thread safe producer consumer queue implementation. It allows the standard push and pop operations. It also maintains a monotonically-increasing element position and allows peeking at the element at certain position. </p>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00028">28</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad7ccb149baa88e5f8356be18344d2baf"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::<a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">ProducerConsumerQueue</a> </td>
<td>(</td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>capacity</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">ProducerConsumerQueue</a> starting from position 0. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">capacity</td><td>is the maximum number of elements that the queue can hold at once. A value of zero means unlimited capacity. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00138">138</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<a class="anchor" id="a80ff75afdbbf7f567dcb57a755542ffc"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::<a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">ProducerConsumerQueue</a> </td>
<td>(</td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>capacity</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>starting_pos</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">ProducerConsumerQueue</a> starting from indicated position. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">capacity</td><td>is the maximum number of elements that the queue can hold at once. A value of zero means unlimited capacity. </td></tr>
<tr><td class="paramname">starting_pos</td><td>is the starting head position. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00147">147</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ad20705b713d6b5ded3312d800740b7ff"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::Empty </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>true if there are no elements in the queue. </dd></dl>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00088">88</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0c5d10a81c6b9e6db8b8d6b61baf1902"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::HeadPos </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The position of the head element in the queue. Note that the returned value may be meaningless if the queue is empty. </dd></dl>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00101">101</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<a class="anchor" id="a92d6cca0ecfb54f6edf9a0408305e9cd"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::Peek </td>
<td>(</td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>pos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T *&#160;</td>
<td class="paramname"><em>element</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>timeout_ms</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Peek at the element at the specified position from the queue. If the element is not available yet, block until it to be available or time out or stopped. NOTE: Elements before (pos - capacity/2) will be removed from the queue after Peek operation. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir"></td><td class="paramname">pos</td><td>refers to the element position. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">element</td><td>receives the peeked element. </td></tr>
<tr><td class="paramdir"></td><td class="paramname">timeout_ms</td><td>indicates timeout in milliseconds. A value of zero means return immediately. A negative value means waiting indefinitely. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>STOPPED if Stop has been called and <em>pos</em> is out of range, INVALID_ARGUMENT if the pos &lt; Head(), TIME_OUT if times out, OK otherwise. </dd></dl>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00252">252</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<a class="anchor" id="a935e9ddee232be82d224c9b81b3b4f88"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::Pop </td>
<td>(</td>
<td class="paramtype">T *&#160;</td>
<td class="paramname"><em>element</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>timeout_ms</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Pop an element from the front of the queue. If the queue is empty, block for an element to be available to be consumed or time out or stopped. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">element</td><td>receives the popped element. </td></tr>
<tr><td class="paramdir"></td><td class="paramname">timeout_ms</td><td>indicates timeout in milliseconds. A value of zero means return immediately. A negative value means waiting indefinitely. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>STOPPED if Stop has been called and the queue is completely empty, TIME_OUT if times out, OK otherwise. </dd></dl>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00210">210</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6eaf80daa8c96b0157f5fcd9763dbec1"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::Push </td>
<td>(</td>
<td class="paramtype">const T &amp;&#160;</td>
<td class="paramname"><em>element</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>timeout_ms</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Push an element to the back of the queue. If the queue has reached its capacity limit, block until spare capacity is available or time out or stopped. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">element</td><td>refers the element to be pushed. </td></tr>
<tr><td class="paramname">timeout_ms</td><td>indicates timeout in milliseconds. A value of zero means return immediately. A negative value means waiting indefinitely. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK if the element was pushed successfully, STOPPED if Stop has has been called, TIME_OUT if times out. </dd></dl>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00161">161</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4f2483c665f2693f583e7b467101d844"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::Size </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The number of elements in the queue. </dd></dl>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00094">94</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac600977b708381facf07f87e36b43d79"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::Stop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Terminate Pop and Peek requests once the queue drains entirely. Also terminate all waiting and future Push requests immediately. Stop cannot stall. </p>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00079">79</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3d88bdebfa412f2847f1d96fd804bba1"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::Stopped </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>true if the queue has been stopped using <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#ac600977b708381facf07f87e36b43d79">Stop()</a>. This allows producers to check if they can add new elements to the queue. </dd></dl>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00115">115</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8a48278d994c0c170b408191d7d994b7"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>&lt; T &gt;::TailPos </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The position of the tail element in the queue. Note that the returned value may be meaningless if the queue is empty. </dd></dl>
<p>Definition at line <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html#l00108">108</a> of file <a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>packager/media/base/<a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Dec 11 2017 18:13:54 for Shaka Packager SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>