<!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.15"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Audaspace: ThreadPool Class 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">Audaspace  <span id="projectnumber">1.3.0</span> </div> <div id="projectbrief">A high level audio library.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.15 --> <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><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="classThreadPool-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">ThreadPool Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>This represents pool of threads. <a href="classThreadPool.html#details">More...</a></p> <p><code>#include <<a class="el" href="ThreadPool_8h_source.html">ThreadPool.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:a66412ad3d3b4f5b8b4d5156a7737091a"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPool.html#a66412ad3d3b4f5b8b4d5156a7737091a">ThreadPool</a> (unsigned int count)</td></tr> <tr class="memdesc:a66412ad3d3b4f5b8b4d5156a7737091a"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new <a class="el" href="classThreadPool.html" title="This represents pool of threads.">ThreadPool</a> object. <a href="#a66412ad3d3b4f5b8b4d5156a7737091a">More...</a><br /></td></tr> <tr class="separator:a66412ad3d3b4f5b8b4d5156a7737091a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ace6a27ffb731ab1c4c73c15e885d4288"><td class="memTemplParams" colspan="2">template<class T , class... Args> </td></tr> <tr class="memitem:ace6a27ffb731ab1c4c73c15e885d4288"><td class="memTemplItemLeft" align="right" valign="top">std::future< typename std::result_of< T(Args...)>::type > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classThreadPool.html#ace6a27ffb731ab1c4c73c15e885d4288">enqueue</a> (T &&t, Args &&... args)</td></tr> <tr class="memdesc:ace6a27ffb731ab1c4c73c15e885d4288"><td class="mdescLeft"> </td><td class="mdescRight">Enqueues a new task for the threads to realize. <a href="#ace6a27ffb731ab1c4c73c15e885d4288">More...</a><br /></td></tr> <tr class="separator:ace6a27ffb731ab1c4c73c15e885d4288"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab3c186542ff6618d33a1d3b0578e8532"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPool.html#ab3c186542ff6618d33a1d3b0578e8532">getNumOfThreads</a> ()</td></tr> <tr class="memdesc:ab3c186542ff6618d33a1d3b0578e8532"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the number of threads of the pool. <a href="#ab3c186542ff6618d33a1d3b0578e8532">More...</a><br /></td></tr> <tr class="separator:ab3c186542ff6618d33a1d3b0578e8532"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>This represents pool of threads. </p> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a id="a66412ad3d3b4f5b8b4d5156a7737091a"></a> <h2 class="memtitle"><span class="permalink"><a href="#a66412ad3d3b4f5b8b4d5156a7737091a">◆ </a></span>ThreadPool()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">ThreadPool::ThreadPool </td> <td>(</td> <td class="paramtype">unsigned int </td> <td class="paramname"><em>count</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Creates a new <a class="el" href="classThreadPool.html" title="This represents pool of threads.">ThreadPool</a> object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">count</td><td>The number of threads of the pool. It must not be 0. </td></tr> </table> </dd> </dl> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a id="ace6a27ffb731ab1c4c73c15e885d4288"></a> <h2 class="memtitle"><span class="permalink"><a href="#ace6a27ffb731ab1c4c73c15e885d4288">◆ </a></span>enqueue()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T , class... Args> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">std::future<typename std::result_of<T(Args...)>::type> ThreadPool::enqueue </td> <td>(</td> <td class="paramtype">T && </td> <td class="paramname"><em>t</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">Args &&... </td> <td class="paramname"><em>args</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>Enqueues a new task for the threads to realize. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">t</td><td>A function that realices a task. </td></tr> <tr><td class="paramname">args</td><td>The arguments of the task. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>A future of the same type as the return type of the task. </dd></dl> </div> </div> <a id="ab3c186542ff6618d33a1d3b0578e8532"></a> <h2 class="memtitle"><span class="permalink"><a href="#ab3c186542ff6618d33a1d3b0578e8532">◆ </a></span>getNumOfThreads()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned int ThreadPool::getNumOfThreads </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Retrieves the number of threads of the pool. </p> <dl class="section return"><dt>Returns</dt><dd>The number of threads. </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>util/<a class="el" href="ThreadPool_8h_source.html">ThreadPool.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.15 </small></address> </body> </html>