506 lines
27 KiB
HTML
506 lines
27 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.17"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Shaka Packager SDK: shaka::media::ProducerConsumerQueue< T > 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/searchdata.js"></script>
|
|
<script type="text/javascript" src="../../search/search.js"></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 id="projectalign" 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.17 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="../../menudata.js"></script>
|
|
<script type="text/javascript" src="../../menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('../../',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</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> |
|
|
<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< T > Class Template Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p><code>#include <<a class="el" href="../../d5/d15/producer__consumer__queue_8h_source.html">producer_consumer_queue.h</a>></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"> </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"> </td></tr>
|
|
<tr class="memitem:a80ff75afdbbf7f567dcb57a755542ffc"><td class="memItemLeft" align="right" valign="top"> </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"> </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> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a6eaf80daa8c96b0157f5fcd9763dbec1">Push</a> (const T &element, int64_t timeout_ms)</td></tr>
|
|
<tr class="separator:a6eaf80daa8c96b0157f5fcd9763dbec1"><td class="memSeparator" colspan="2"> </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> </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"> </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> </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"> </td></tr>
|
|
<tr class="memitem:ac600977b708381facf07f87e36b43d79"><td class="memItemLeft" align="right" valign="top">void </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"> </td></tr>
|
|
<tr class="memitem:a19881dbe30e5ace8b9844b81b1f33350"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a19881dbe30e5ace8b9844b81b1f33350">Empty</a> () const</td></tr>
|
|
<tr class="separator:a19881dbe30e5ace8b9844b81b1f33350"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a12f9de3067fe5cf43fd002b56a9811a4"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a12f9de3067fe5cf43fd002b56a9811a4">Size</a> () const</td></tr>
|
|
<tr class="separator:a12f9de3067fe5cf43fd002b56a9811a4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3ad0ff1e27d529820e27656581a8542b"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a3ad0ff1e27d529820e27656581a8542b">HeadPos</a> () const</td></tr>
|
|
<tr class="separator:a3ad0ff1e27d529820e27656581a8542b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a7d92eabaee0d6a862e759a154e1e5df6"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a7d92eabaee0d6a862e759a154e1e5df6">TailPos</a> () const</td></tr>
|
|
<tr class="separator:a7d92eabaee0d6a862e759a154e1e5df6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a83045f2ceb8b6ce77b66dddef00d93be"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html#a83045f2ceb8b6ce77b66dddef00d93be">Stopped</a> () const</td></tr>
|
|
<tr class="separator:a83045f2ceb8b6ce77b66dddef00d93be"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><h3>template<class T><br />
|
|
class shaka::media::ProducerConsumerQueue< T ></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 class="definition">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 & Destructor Documentation</h2>
|
|
<a id="ad7ccb149baa88e5f8356be18344d2baf"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad7ccb149baa88e5f8356be18344d2baf">◆ </a></span>ProducerConsumerQueue() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </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>< T >::<a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">ProducerConsumerQueue</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype">size_t </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 class="definition">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 id="a80ff75afdbbf7f567dcb57a755542ffc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a80ff75afdbbf7f567dcb57a755542ffc">◆ </a></span>ProducerConsumerQueue() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">shaka::media::ProducerConsumerQueue</a>< T >::<a class="el" href="../../d5/d33/classshaka_1_1media_1_1ProducerConsumerQueue.html">ProducerConsumerQueue</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>capacity</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>starting_pos</em> </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 class="definition">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 id="a19881dbe30e5ace8b9844b81b1f33350"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a19881dbe30e5ace8b9844b81b1f33350">◆ </a></span>Empty()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </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>< T >::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 class="definition">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 id="a3ad0ff1e27d529820e27656581a8542b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3ad0ff1e27d529820e27656581a8542b">◆ </a></span>HeadPos()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </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>< T >::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 class="definition">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 id="a92d6cca0ecfb54f6edf9a0408305e9cd"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a92d6cca0ecfb54f6edf9a0408305e9cd">◆ </a></span>Peek()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </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>< T >::Peek </td>
|
|
<td>(</td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>pos</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">T * </td>
|
|
<td class="paramname"><em>element</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int64_t </td>
|
|
<td class="paramname"><em>timeout_ms</em> </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 < Head(), TIME_OUT if times out, OK otherwise. </dd></dl>
|
|
|
|
<p class="definition">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 id="a935e9ddee232be82d224c9b81b3b4f88"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a935e9ddee232be82d224c9b81b3b4f88">◆ </a></span>Pop()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </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>< T >::Pop </td>
|
|
<td>(</td>
|
|
<td class="paramtype">T * </td>
|
|
<td class="paramname"><em>element</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int64_t </td>
|
|
<td class="paramname"><em>timeout_ms</em> </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 class="definition">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 id="a6eaf80daa8c96b0157f5fcd9763dbec1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6eaf80daa8c96b0157f5fcd9763dbec1">◆ </a></span>Push()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </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>< T >::Push </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const T & </td>
|
|
<td class="paramname"><em>element</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int64_t </td>
|
|
<td class="paramname"><em>timeout_ms</em> </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 class="definition">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 id="a12f9de3067fe5cf43fd002b56a9811a4"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a12f9de3067fe5cf43fd002b56a9811a4">◆ </a></span>Size()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </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>< T >::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 class="definition">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 id="ac600977b708381facf07f87e36b43d79"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac600977b708381facf07f87e36b43d79">◆ </a></span>Stop()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </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>< T >::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 class="definition">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 id="a83045f2ceb8b6ce77b66dddef00d93be"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a83045f2ceb8b6ce77b66dddef00d93be">◆ </a></span>Stopped()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </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>< T >::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 class="definition">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 id="a7d92eabaee0d6a862e759a154e1e5df6"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a7d92eabaee0d6a862e759a154e1e5df6">◆ </a></span>TailPos()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T > </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>< T >::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 class="definition">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 Tue Jun 22 2021 00:16:05 for Shaka Packager SDK by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.17
|
|
</small></address>
|
|
</body>
|
|
</html>
|