| <!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.13"/> |
| <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| <title>Apache Singa: PriorityQueue< 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">Apache Singa |
| </div> |
| <div id="projectbrief">A General Distributed Deep Learning Library</div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.13 --> |
| <script type="text/javascript"> |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| </script> |
| <script type="text/javascript" src="menudata.js"></script> |
| <script type="text/javascript" src="menu.js"></script> |
| <script type="text/javascript"> |
| $(function() { |
| initMenu('',true,false,'search.php','Search'); |
| $(document).ready(function() { init_search(); }); |
| }); |
| </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><!-- top --> |
| <div class="header"> |
| <div class="summary"> |
| <a href="#nested-classes">Classes</a> | |
| <a href="#pub-methods">Public Member Functions</a> | |
| <a href="classPriorityQueue-members.html">List of all members</a> </div> |
| <div class="headertitle"> |
| <div class="title">PriorityQueue< T > Class Template Reference</div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| |
| <p>Thread safe priority queue. |
| <a href="classPriorityQueue.html#details">More...</a></p> |
| |
| <p><code>#include <<a class="el" href="safe__queue_8h_source.html">safe_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:a5c1c5a72e53dcf23e92b7877f9ed764a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classPriorityQueue.html#a5c1c5a72e53dcf23e92b7877f9ed764a">Push</a> (const T &e, int priority)</td></tr> |
| <tr class="memdesc:a5c1c5a72e53dcf23e92b7877f9ed764a"><td class="mdescLeft"> </td><td class="mdescRight">Push an element into the queue with a given priority. <a href="#a5c1c5a72e53dcf23e92b7877f9ed764a">More...</a><br /></td></tr> |
| <tr class="separator:a5c1c5a72e53dcf23e92b7877f9ed764a"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a5ad922c1a6314471d82498e195e3e223"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classPriorityQueue.html#a5ad922c1a6314471d82498e195e3e223">Pop</a> (T &e)</td></tr> |
| <tr class="memdesc:a5ad922c1a6314471d82498e195e3e223"><td class="mdescLeft"> </td><td class="mdescRight">Pop an element from the queue with the highest priority. <a href="#a5ad922c1a6314471d82498e195e3e223">More...</a><br /></td></tr> |
| <tr class="separator:a5ad922c1a6314471d82498e195e3e223"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a17af3058e1a4168184c1fd308af858c1"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classPriorityQueue.html#a17af3058e1a4168184c1fd308af858c1">Pop</a> (T &e, std::uint64_t timeout)</td></tr> |
| <tr class="memdesc:a17af3058e1a4168184c1fd308af858c1"><td class="mdescLeft"> </td><td class="mdescRight">Pop the item with the highest priority from the queue until one element is poped or timeout. <a href="#a17af3058e1a4168184c1fd308af858c1">More...</a><br /></td></tr> |
| <tr class="separator:a17af3058e1a4168184c1fd308af858c1"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a39433c1537f78686e95f0242d3d1d245"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classPriorityQueue.html#a39433c1537f78686e95f0242d3d1d245">TryPop</a> (T &e)</td></tr> |
| <tr class="memdesc:a39433c1537f78686e95f0242d3d1d245"><td class="mdescLeft"> </td><td class="mdescRight">Try to pop an element from the queue. <a href="#a39433c1537f78686e95f0242d3d1d245">More...</a><br /></td></tr> |
| <tr class="separator:a39433c1537f78686e95f0242d3d1d245"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a4e37ab2e501407763e3a1f35ce417739"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classPriorityQueue.html#a4e37ab2e501407763e3a1f35ce417739">Size</a> () const</td></tr> |
| <tr class="separator:a4e37ab2e501407763e3a1f35ce417739"><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<typename T><br /> |
| class PriorityQueue< T ></h3> |
| |
| <p>Thread safe priority queue. </p> |
| </div><h2 class="groupheader">Member Function Documentation</h2> |
| <a id="a5ad922c1a6314471d82498e195e3e223"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a5ad922c1a6314471d82498e195e3e223">◆ </a></span>Pop() <span class="overload">[1/2]</span></h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">void <a class="el" href="classPriorityQueue.html">PriorityQueue</a>< T >::Pop </td> |
| <td>(</td> |
| <td class="paramtype">T & </td> |
| <td class="paramname"><em>e</em></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>Pop an element from the queue with the highest priority. </p> |
| <p>It blocks until one element is poped. </p> |
| |
| </div> |
| </div> |
| <a id="a17af3058e1a4168184c1fd308af858c1"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a17af3058e1a4168184c1fd308af858c1">◆ </a></span>Pop() <span class="overload">[2/2]</span></h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">bool <a class="el" href="classPriorityQueue.html">PriorityQueue</a>< T >::Pop </td> |
| <td>(</td> |
| <td class="paramtype">T & </td> |
| <td class="paramname"><em>e</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::uint64_t </td> |
| <td class="paramname"><em>timeout</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</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>Pop the item with the highest priority from the queue until one element is poped or timeout. </p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramdir">[in]</td><td class="paramname">timeout,return</td><td>false if no element is poped after this number of microseconds. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| |
| </div> |
| </div> |
| <a id="a5c1c5a72e53dcf23e92b7877f9ed764a"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a5c1c5a72e53dcf23e92b7877f9ed764a">◆ </a></span>Push()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">bool <a class="el" href="classPriorityQueue.html">PriorityQueue</a>< T >::Push </td> |
| <td>(</td> |
| <td class="paramtype">const T & </td> |
| <td class="paramname"><em>e</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>priority</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</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>Push an element into the queue with a given priority. </p> |
| <p>The queue should not be a priority queue. </p><dl class="section return"><dt>Returns</dt><dd>true if success; otherwise false, e.g., due to capacity constraint. </dd></dl> |
| |
| </div> |
| </div> |
| <a id="a4e37ab2e501407763e3a1f35ce417739"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a4e37ab2e501407763e3a1f35ce417739">◆ </a></span>Size()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">unsigned int <a class="el" href="classPriorityQueue.html">PriorityQueue</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>Number of elements in the queue. </dd></dl> |
| |
| </div> |
| </div> |
| <a id="a39433c1537f78686e95f0242d3d1d245"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a39433c1537f78686e95f0242d3d1d245">◆ </a></span>TryPop()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">bool <a class="el" href="classPriorityQueue.html">PriorityQueue</a>< T >::TryPop </td> |
| <td>(</td> |
| <td class="paramtype">T & </td> |
| <td class="paramname"><em>e</em></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>Try to pop an element from the queue. </p> |
| <dl class="section return"><dt>Returns</dt><dd>false if the queue is empty now. </dd></dl> |
| |
| </div> |
| </div> |
| <hr/>The documentation for this class was generated from the following file:<ul> |
| <li>/home/moaz/incubator-singa/include/singa/utils/<a class="el" href="safe__queue_8h_source.html">safe_queue.h</a></li> |
| </ul> |
| </div><!-- contents --> |
| <!-- start footer part --> |
| <hr class="footer"/><address class="footer"><small> |
| Generated on Mon Apr 22 2019 12:27:05 for Apache Singa by  <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/> |
| </a> 1.8.13 |
| </small></address> |
| </body> |
| </html> |