Skip to content
Snippets Groups Projects
Commit 33c8197f authored by Gontier Antonin's avatar Gontier Antonin :fox:
Browse files

Ajout de la doc de ThreadPool.h

parent 8feaf72e
No related branches found
No related tags found
No related merge requests found
Showing
with 128 additions and 55 deletions
......@@ -91,7 +91,7 @@ $(document).ready(function(){initNavTree('Random_8h_source.html','');});
<div class="title">Random.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="Random_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> This file is part of Leela Zero.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> Copyright (C) 2017 Gian-Carlo Pascutto</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> Leela Zero is free software: you can redistribute it and/or modify</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> it under the terms of the GNU General Public License as published by</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> the Free Software Foundation, either version 3 of the License, or</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> (at your option) any later version.</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> Leela Zero is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> GNU General Public License for more details.</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> You should have received a copy of the GNU General Public License</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> along with Leela Zero. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#ifndef RANDOM_H_INCLUDED</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#define RANDOM_H_INCLUDED</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;cstdint&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;limits&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceUtils.html">Utils</a> {</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html"> 40</a></span>&#160; <span class="keyword">class </span><a class="code" href="classUtils_1_1Random.html">Random</a> {</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <a class="code" href="classUtils_1_1Random.html#ab2e106214e6cc251cf130ce3b0d3f855">Random</a>() = <span class="keyword">delete</span>;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <a class="code" href="classUtils_1_1Random.html#ab2e106214e6cc251cf130ce3b0d3f855">Random</a>(std::uint64_t seed = 0);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classUtils_1_1Random.html#a8c7708e5134b2e1b96b99098e619f1b1">seedrandom</a>(std::uint64_t s);</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="comment">// Random numbers from [0, max - 1]</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">template</span>&lt;<span class="keywordtype">int</span> MAX&gt;</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html#a833d6c9fa0981359fdd7ff50b1ce5ca5"> 73</a></span>&#160; std::uint32_t <a class="code" href="classUtils_1_1Random.html#a833d6c9fa0981359fdd7ff50b1ce5ca5">randfix</a>() {</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; static_assert(0 &lt; MAX &amp;&amp; MAX &lt; std::numeric_limits&lt;std::uint32_t&gt;::max(),<span class="stringliteral">&quot;randfix out of range&quot;</span>);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="comment">// Last bit isn&#39;t random, so don&#39;t use it in isolation. We specialize</span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">// this case.</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; static_assert(MAX != 2, <span class="stringliteral">&quot;don&#39;t isolate the LSB with xoroshiro128+&quot;</span>);</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordflow">return</span> gen() % MAX;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; }</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; std::uint64_t <a class="code" href="classUtils_1_1Random.html#a5b70b55074f85821f54fead169c4fad2">randuint64</a>();</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="comment">// Random number from [0, max - 1]</span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;<span class="comment"></span> std::uint64_t <a class="code" href="classUtils_1_1Random.html#a5b70b55074f85821f54fead169c4fad2">randuint64</a>(<span class="keyword">const</span> std::uint64_t <a class="code" href="classUtils_1_1Random.html#aec7ce0b88412fd1d4ee9184c4905112a">max</a>);</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="comment">// return the thread local RNG</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="comment"></span> <span class="keyword">static</span> <a class="code" href="classUtils_1_1Random.html">Random</a>&amp; <a class="code" href="classUtils_1_1Random.html#a885267b8e35bfdd9d6342e5acb834a18">get_Rng</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="comment">// UniformRandomBitGenerator interface</span></div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c"> 108</a></span>&#160; <span class="keyword">using</span> <a class="code" href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c">result_type</a> = std::uint64_t;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html#a0ebc60d9e2ee8f5908b16f3285db8800"> 116</a></span>&#160; constexpr <span class="keyword">static</span> <a class="code" href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c">result_type</a> <a class="code" href="classUtils_1_1Random.html#a0ebc60d9e2ee8f5908b16f3285db8800">min</a>() {</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordflow">return</span> std::numeric_limits&lt;result_type&gt;::min();</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; }</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html#aec7ce0b88412fd1d4ee9184c4905112a"> 126</a></span>&#160; constexpr <span class="keyword">static</span> <a class="code" href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c">result_type</a> <a class="code" href="classUtils_1_1Random.html#aec7ce0b88412fd1d4ee9184c4905112a">max</a>() {</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordflow">return</span> std::numeric_limits&lt;result_type&gt;::max();</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; }</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html#aee6aa8e62561a37af49c8a75cf9faf81"> 136</a></span>&#160; <a class="code" href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c">result_type</a> <a class="code" href="classUtils_1_1Random.html#aee6aa8e62561a37af49c8a75cf9faf81">operator()</a>() {</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">return</span> gen();</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; }</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; std::uint64_t gen(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; std::uint64_t m_s[2]; </div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; };</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="comment">// Specialization for last bit: use sign test</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keyword">template</span>&lt;&gt;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keyword">inline</span> std::uint32_t Random::randfix&lt;2&gt;() {</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="keywordflow">return</span> (gen() &gt; (std::numeric_limits&lt;std::uint64_t&gt;::max() / 2));</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; }</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;}</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="classUtils_1_1Random_html_a5b70b55074f85821f54fead169c4fad2"><div class="ttname"><a href="classUtils_1_1Random.html#a5b70b55074f85821f54fead169c4fad2">Utils::Random::randuint64</a></div><div class="ttdeci">std::uint64_t randuint64()</div><div class="ttdoc">Generate raw random number.</div><div class="ttdef"><b>Definition:</b> Random.cpp:64</div></div>
<a href="Random_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> This file is part of Leela Zero.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> Copyright (C) 2017 Gian-Carlo Pascutto</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> Leela Zero is free software: you can redistribute it and/or modify</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> it under the terms of the GNU General Public License as published by</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> the Free Software Foundation, either version 3 of the License, or</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> (at your option) any later version.</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> Leela Zero is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> GNU General Public License for more details.</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> You should have received a copy of the GNU General Public License</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> along with Leela Zero. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#ifndef RANDOM_H_INCLUDED</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#define RANDOM_H_INCLUDED</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;cstdint&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;limits&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceUtils.html">Utils</a> {</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html"> 40</a></span>&#160; <span class="keyword">class </span><a class="code" href="classUtils_1_1Random.html">Random</a> {</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <a class="code" href="classUtils_1_1Random.html#ab2e106214e6cc251cf130ce3b0d3f855">Random</a>() = <span class="keyword">delete</span>;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <a class="code" href="classUtils_1_1Random.html#ab2e106214e6cc251cf130ce3b0d3f855">Random</a>(std::uint64_t seed = 0);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classUtils_1_1Random.html#a8c7708e5134b2e1b96b99098e619f1b1">seedrandom</a>(std::uint64_t s);</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="comment">// Random numbers from [0, max - 1]</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">template</span>&lt;<span class="keywordtype">int</span> MAX&gt;</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html#a833d6c9fa0981359fdd7ff50b1ce5ca5"> 73</a></span>&#160; std::uint32_t <a class="code" href="classUtils_1_1Random.html#a833d6c9fa0981359fdd7ff50b1ce5ca5">randfix</a>() {</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; static_assert(0 &lt; MAX &amp;&amp; MAX &lt; std::numeric_limits&lt;std::uint32_t&gt;::max(),<span class="stringliteral">&quot;randfix out of range&quot;</span>);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="comment">// Last bit isn&#39;t random, so don&#39;t use it in isolation. We specialize</span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">// this case.</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; static_assert(MAX != 2, <span class="stringliteral">&quot;don&#39;t isolate the LSB with xoroshiro128+&quot;</span>);</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordflow">return</span> gen() % MAX;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; }</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; std::uint64_t <a class="code" href="classUtils_1_1Random.html#a5b70b55074f85821f54fead169c4fad2">randuint64</a>();</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="comment">// Random number from [0, max - 1]</span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;<span class="comment"></span> std::uint64_t <a class="code" href="classUtils_1_1Random.html#a5b70b55074f85821f54fead169c4fad2">randuint64</a>(<span class="keyword">const</span> std::uint64_t <a class="code" href="classUtils_1_1Random.html#aec7ce0b88412fd1d4ee9184c4905112a">max</a>);</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="comment">// return the thread local RNG</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="comment"></span> <span class="keyword">static</span> <a class="code" href="classUtils_1_1Random.html">Random</a>&amp; <a class="code" href="classUtils_1_1Random.html#a885267b8e35bfdd9d6342e5acb834a18">get_Rng</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="comment">// UniformRandomBitGenerator interface</span></div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c"> 108</a></span>&#160; <span class="keyword">using</span> <a class="code" href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c">result_type</a> = std::uint64_t;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html#a0ebc60d9e2ee8f5908b16f3285db8800"> 116</a></span>&#160; constexpr <span class="keyword">static</span> <a class="code" href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c">result_type</a> <a class="code" href="classUtils_1_1Random.html#a0ebc60d9e2ee8f5908b16f3285db8800">min</a>() {</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordflow">return</span> std::numeric_limits&lt;result_type&gt;::min();</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; }</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html#aec7ce0b88412fd1d4ee9184c4905112a"> 126</a></span>&#160; constexpr <span class="keyword">static</span> <a class="code" href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c">result_type</a> <a class="code" href="classUtils_1_1Random.html#aec7ce0b88412fd1d4ee9184c4905112a">max</a>() {</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordflow">return</span> std::numeric_limits&lt;result_type&gt;::max();</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; }</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="classUtils_1_1Random.html#aee6aa8e62561a37af49c8a75cf9faf81"> 136</a></span>&#160; <a class="code" href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c">result_type</a> <a class="code" href="classUtils_1_1Random.html#aee6aa8e62561a37af49c8a75cf9faf81">operator()</a>() {</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">return</span> gen();</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; }</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; std::uint64_t gen(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; std::uint64_t m_s[2]; </div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; };</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="comment">// Specialization for last bit: use sign test</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keyword">template</span>&lt;&gt;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keyword">inline</span> std::uint32_t Random::randfix&lt;2&gt;() {</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="keywordflow">return</span> (gen() &gt; (std::numeric_limits&lt;std::uint64_t&gt;::max() / 2));</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; }</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;}</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="classUtils_1_1Random_html_a5b70b55074f85821f54fead169c4fad2"><div class="ttname"><a href="classUtils_1_1Random.html#a5b70b55074f85821f54fead169c4fad2">Utils::Random::randuint64</a></div><div class="ttdeci">std::uint64_t randuint64()</div><div class="ttdoc">Generate raw random number.</div><div class="ttdef"><b>Definition:</b> Random.cpp:64</div></div>
<div class="ttc" id="classUtils_1_1Random_html_a81041c98f41a29ba6d28bf070d20217c"><div class="ttname"><a href="classUtils_1_1Random.html#a81041c98f41a29ba6d28bf070d20217c">Utils::Random::result_type</a></div><div class="ttdeci">std::uint64_t result_type</div><div class="ttdef"><b>Definition:</b> Random.h:108</div></div>
<div class="ttc" id="classUtils_1_1Random_html_a885267b8e35bfdd9d6342e5acb834a18"><div class="ttname"><a href="classUtils_1_1Random.html#a885267b8e35bfdd9d6342e5acb834a18">Utils::Random::get_Rng</a></div><div class="ttdeci">static Random &amp; get_Rng(void)</div><div class="ttdoc">Get a copy of the current thread.</div><div class="ttdef"><b>Definition:</b> Random.cpp:29</div></div>
<div class="ttc" id="classUtils_1_1Random_html"><div class="ttname"><a href="classUtils_1_1Random.html">Utils::Random</a></div><div class="ttdoc">RNG based on Xoroshiro128+.</div><div class="ttdef"><b>Definition:</b> Random.h:40</div></div>
......
......@@ -109,8 +109,10 @@ $(document).ready(function(){initNavTree('ThreadPool_8h.html','');});
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadPool.html">Utils::ThreadPool</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An implementation of Thread pool. <a href="classUtils_1_1ThreadPool.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadGroup.html">Utils::ThreadGroup</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An implementation of Thread group. <a href="classUtils_1_1ThreadGroup.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
......
This diff is collapsed.
......@@ -97,7 +97,7 @@ $(document).ready(function(){initNavTree('Utils_8hpp_source.html','');});
<div class="ttc" id="Utils_8hpp_html_a32f2ff6e608d35dee4b364e09323f606"><div class="ttname"><a href="Utils_8hpp.html#a32f2ff6e608d35dee4b364e09323f606">ALE</a></div><div class="ttdeci">ALEInterface ALE</div><div class="ttdef"><b>Definition:</b> Utils.cpp:102</div></div>
<div class="ttc" id="namespaceUtils_html_a309a855911c69614a5d3eb7c5f8252fa"><div class="ttname"><a href="namespaceUtils.html#a309a855911c69614a5d3eb7c5f8252fa">Utils::secam_to_range_index</a></div><div class="ttdeci">int secam_to_range_index(int i)</div><div class="ttdoc">Transform a secam color value to a power of two.</div><div class="ttdef"><b>Definition:</b> Utils.cpp:33</div></div>
<div class="ttc" id="namespaceUtils_html_a2cb4fe5036957672db516ed2bed571ed"><div class="ttname"><a href="namespaceUtils.html#a2cb4fe5036957672db516ed2bed571ed">Utils::read_Config</a></div><div class="ttdeci">vector&lt; vector&lt; string &gt; &gt; read_Config()</div><div class="ttdoc">Store values extracted from the config file to a vector.</div><div class="ttdef"><b>Definition:</b> Utils.cpp:77</div></div>
<div class="ttc" id="classUtils_1_1ThreadPool_html"><div class="ttname"><a href="classUtils_1_1ThreadPool.html">Utils::ThreadPool</a></div><div class="ttdef"><b>Definition:</b> ThreadPool.h:39</div></div>
<div class="ttc" id="classUtils_1_1ThreadPool_html"><div class="ttname"><a href="classUtils_1_1ThreadPool.html">Utils::ThreadPool</a></div><div class="ttdoc">An implementation of Thread pool.</div><div class="ttdef"><b>Definition:</b> ThreadPool.h:51</div></div>
<div class="ttc" id="Utils_8hpp_html_ae2862c5d8100c17747aa6aba73d2c151"><div class="ttname"><a href="Utils_8hpp.html#ae2862c5d8100c17747aa6aba73d2c151">thread_pool</a></div><div class="ttdeci">Utils::ThreadPool thread_pool</div><div class="ttdef"><b>Definition:</b> Utils.cpp:23</div></div>
<div class="ttc" id="namespaceUtils_html_aacc905eae78abff87c861223066399ee"><div class="ttname"><a href="namespaceUtils.html#aacc905eae78abff87c861223066399ee">Utils::secam210x160_to_42x32</a></div><div class="ttdeci">void secam210x160_to_42x32(const std::vector&lt; unsigned char &gt; &amp;screen, std::vector&lt; unsigned char &gt; &amp;screen42x32)</div><div class="ttdoc">Reduce the screen from 210x160 to 42x32.</div><div class="ttdef"><b>Definition:</b> Utils.cpp:56</div></div>
<div class="ttc" id="namespaceUtils_html_af45a0bd53042e510e4b7788e3786be02"><div class="ttname"><a href="namespaceUtils.html#af45a0bd53042e510e4b7788e3786be02">Utils::atomic_add</a></div><div class="ttdeci">void atomic_add(std::atomic&lt; T &gt; &amp;f, T d)</div><div class="ttdoc">Perform an atomic addition.</div><div class="ttdef"><b>Definition:</b> Utils.hpp:53</div></div>
......
......@@ -103,8 +103,8 @@ $(document).ready(function(){initNavTree('annotated.html','');});
<tr id="row_2_1_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classSMP_1_1Mutex.html" target="_self">Mutex</a></td><td class="desc"></td></tr>
<tr id="row_3_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_3_" class="arrow" onclick="toggleFolder('3_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespaceUtils.html" target="_self">Utils</a></td><td class="desc">A set of useful method and class </td></tr>
<tr id="row_3_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classUtils_1_1Random.html" target="_self">Random</a></td><td class="desc">RNG based on Xoroshiro128+ </td></tr>
<tr id="row_3_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classUtils_1_1ThreadGroup.html" target="_self">ThreadGroup</a></td><td class="desc"></td></tr>
<tr id="row_3_2_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classUtils_1_1ThreadPool.html" target="_self">ThreadPool</a></td><td class="desc"></td></tr>
<tr id="row_3_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classUtils_1_1ThreadGroup.html" target="_self">ThreadGroup</a></td><td class="desc">An implementation of Thread group </td></tr>
<tr id="row_3_2_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classUtils_1_1ThreadPool.html" target="_self">ThreadPool</a></td><td class="desc">An implementation of Thread pool </td></tr>
<tr id="row_4_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_4_" class="arrow" onclick="toggleFolder('4_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structagent.html" target="_self">agent</a></td><td class="desc"></td></tr>
<tr id="row_4_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structagent_1_1parameters.html" target="_self">parameters</a></td><td class="desc"></td></tr>
<tr id="row_5_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classconnection.html" target="_self">connection</a></td><td class="desc"></td></tr>
......
......@@ -145,6 +145,10 @@ Static Public Member Functions</h2></td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>RNG based on Xoroshiro128+. </p>
<dl class="section copyright"><dt>Copyright</dt><dd>GNU General Public License </dd>
<dd>
Part of Leela Zero software </dd></dl>
<dl class="section author"><dt>Author</dt><dd>Gian-Carlo Pascutto </dd></dl>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a81041c98f41a29ba6d28bf070d20217c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81041c98f41a29ba6d28bf070d20217c">&#9670;&nbsp;</a></span>result_type</h2>
......
......@@ -94,9 +94,9 @@ $(document).ready(function(){initNavTree('classUtils_1_1ThreadGroup.html','');})
<p>This is the complete list of members for <a class="el" href="classUtils_1_1ThreadGroup.html">Utils::ThreadGroup</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classUtils_1_1ThreadGroup.html#a42d5c52bddadeda9d4c7bc6292409fcd">add_task</a>(F &amp;&amp;f, Args &amp;&amp;... args)</td><td class="entry"><a class="el" href="classUtils_1_1ThreadGroup.html">Utils::ThreadGroup</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classUtils_1_1ThreadGroup.html#ac78653783eb2e65c388175149ed28891">add_task</a>(F &amp;&amp;f, Args &amp;&amp;... args)</td><td class="entry"><a class="el" href="classUtils_1_1ThreadGroup.html">Utils::ThreadGroup</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classUtils_1_1ThreadGroup.html#a1ad4ddc3dfd5dc36bd157f9c93597ded">ThreadGroup</a>(ThreadPool &amp;pool)</td><td class="entry"><a class="el" href="classUtils_1_1ThreadGroup.html">Utils::ThreadGroup</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classUtils_1_1ThreadGroup.html#a59a27c62932c3ca7d1ab084f4768ccb4">wait_all</a>()</td><td class="entry"><a class="el" href="classUtils_1_1ThreadGroup.html">Utils::ThreadGroup</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classUtils_1_1ThreadGroup.html#a2961f91bfa48f1e8115eedf72745b3eb">wait_all</a>()</td><td class="entry"><a class="el" href="classUtils_1_1ThreadGroup.html">Utils::ThreadGroup</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
......
......@@ -95,19 +95,28 @@ $(document).ready(function(){initNavTree('classUtils_1_1ThreadGroup.html','');})
</div><!--header-->
<div class="contents">
<p>An implementation of Thread group.
<a href="classUtils_1_1ThreadGroup.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="ThreadPool_8h_source.html">ThreadPool.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:a1ad4ddc3dfd5dc36bd157f9c93597ded"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadGroup.html#a1ad4ddc3dfd5dc36bd157f9c93597ded">ThreadGroup</a> (<a class="el" href="classUtils_1_1ThreadPool.html">ThreadPool</a> &amp;pool)</td></tr>
<tr class="memdesc:a1ad4ddc3dfd5dc36bd157f9c93597ded"><td class="mdescLeft">&#160;</td><td class="mdescRight">Build a <a class="el" href="classUtils_1_1ThreadGroup.html" title="An implementation of Thread group.">ThreadGroup</a> from a <a class="el" href="classUtils_1_1ThreadPool.html" title="An implementation of Thread pool.">ThreadPool</a>. <a href="#a1ad4ddc3dfd5dc36bd157f9c93597ded">More...</a><br /></td></tr>
<tr class="separator:a1ad4ddc3dfd5dc36bd157f9c93597ded"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42d5c52bddadeda9d4c7bc6292409fcd"><td class="memTemplParams" colspan="2">template&lt;class F , class... Args&gt; </td></tr>
<tr class="memitem:a42d5c52bddadeda9d4c7bc6292409fcd"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadGroup.html#a42d5c52bddadeda9d4c7bc6292409fcd">add_task</a> (F &amp;&amp;f, Args &amp;&amp;... args)</td></tr>
<tr class="separator:a42d5c52bddadeda9d4c7bc6292409fcd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59a27c62932c3ca7d1ab084f4768ccb4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadGroup.html#a59a27c62932c3ca7d1ab084f4768ccb4">wait_all</a> ()</td></tr>
<tr class="separator:a59a27c62932c3ca7d1ab084f4768ccb4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac78653783eb2e65c388175149ed28891"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadGroup.html#ac78653783eb2e65c388175149ed28891">add_task</a> (F &amp;&amp;f, Args &amp;&amp;... args)</td></tr>
<tr class="memdesc:ac78653783eb2e65c388175149ed28891"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a task to the thread. <a href="#ac78653783eb2e65c388175149ed28891">More...</a><br /></td></tr>
<tr class="separator:ac78653783eb2e65c388175149ed28891"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2961f91bfa48f1e8115eedf72745b3eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadGroup.html#a2961f91bfa48f1e8115eedf72745b3eb">wait_all</a> ()</td></tr>
<tr class="memdesc:a2961f91bfa48f1e8115eedf72745b3eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait until all task results have a valid value. <a href="#a2961f91bfa48f1e8115eedf72745b3eb">More...</a><br /></td></tr>
<tr class="separator:a2961f91bfa48f1e8115eedf72745b3eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An implementation of Thread group. </p>
<dl class="section copyright"><dt>Copyright</dt><dd>zlib license </dd></dl>
<dl class="section author"><dt>Authors</dt><dd>Jakob Progsch, Václav Zeman </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a1ad4ddc3dfd5dc36bd157f9c93597ded"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ad4ddc3dfd5dc36bd157f9c93597ded">&#9670;&nbsp;</a></span>ThreadGroup()</h2>
......@@ -132,22 +141,28 @@ Public Member Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Build a <a class="el" href="classUtils_1_1ThreadGroup.html" title="An implementation of Thread group.">ThreadGroup</a> from a <a class="el" href="classUtils_1_1ThreadPool.html" title="An implementation of Thread pool.">ThreadPool</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pool</td><td>Reference <a class="el" href="classUtils_1_1ThreadPool.html" title="An implementation of Thread pool.">ThreadPool</a> </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a42d5c52bddadeda9d4c7bc6292409fcd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a42d5c52bddadeda9d4c7bc6292409fcd">&#9670;&nbsp;</a></span>add_task()</h2>
<a id="ac78653783eb2e65c388175149ed28891"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac78653783eb2e65c388175149ed28891">&#9670;&nbsp;</a></span>add_task()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class F , class... Args&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void Utils::ThreadGroup::add_task </td>
<td class="memname">Utils::ThreadGroup::add_task </td>
<td>(</td>
<td class="paramtype">F &amp;&amp;&#160;</td>
<td class="paramname"><em>f</em>, </td>
......@@ -171,10 +186,19 @@ template&lt;class F , class... Args&gt; </div>
</table>
</div><div class="memdoc">
<p>Add a task to the thread. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">f</td><td>An object f </td></tr>
<tr><td class="paramname">args</td><td>A list of arguments </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a59a27c62932c3ca7d1ab084f4768ccb4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59a27c62932c3ca7d1ab084f4768ccb4">&#9670;&nbsp;</a></span>wait_all()</h2>
<a id="a2961f91bfa48f1e8115eedf72745b3eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2961f91bfa48f1e8115eedf72745b3eb">&#9670;&nbsp;</a></span>wait_all()</h2>
<div class="memitem">
<div class="memproto">
......@@ -183,7 +207,7 @@ template&lt;class F , class... Args&gt; </div>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void Utils::ThreadGroup::wait_all </td>
<td class="memname">Utils::ThreadGroup::wait_all </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
......@@ -196,6 +220,8 @@ template&lt;class F , class... Args&gt; </div>
</table>
</div><div class="memdoc">
<p>Wait until all task results have a valid value. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
......
var classUtils_1_1ThreadGroup =
[
[ "ThreadGroup", "classUtils_1_1ThreadGroup.html#a1ad4ddc3dfd5dc36bd157f9c93597ded", null ],
[ "add_task", "classUtils_1_1ThreadGroup.html#a42d5c52bddadeda9d4c7bc6292409fcd", null ],
[ "wait_all", "classUtils_1_1ThreadGroup.html#a59a27c62932c3ca7d1ab084f4768ccb4", null ]
[ "add_task", "classUtils_1_1ThreadGroup.html#ac78653783eb2e65c388175149ed28891", null ],
[ "wait_all", "classUtils_1_1ThreadGroup.html#a2961f91bfa48f1e8115eedf72745b3eb", null ]
];
\ No newline at end of file
......@@ -94,7 +94,7 @@ $(document).ready(function(){initNavTree('classUtils_1_1ThreadPool.html','');});
<p>This is the complete list of members for <a class="el" href="classUtils_1_1ThreadPool.html">Utils::ThreadPool</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classUtils_1_1ThreadPool.html#ab25c460e933c645d8f66260521053e45">add_task</a>(F &amp;&amp;f, Args &amp;&amp;... args) -&gt; std::future&lt; typename std::result_of&lt; F(Args...)&gt;::type &gt;</td><td class="entry"><a class="el" href="classUtils_1_1ThreadPool.html">Utils::ThreadPool</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classUtils_1_1ThreadPool.html#a5313af55df25fed6955806d60113e8b2">add_task</a>(F &amp;&amp;f, Args &amp;&amp;... args) -&gt; std::future&lt; typename std::result_of&lt; F(Args...)&gt;::type &gt;</td><td class="entry"><a class="el" href="classUtils_1_1ThreadPool.html">Utils::ThreadPool</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classUtils_1_1ThreadPool.html#a11f5cde32eadf00a7d5606c5de24fc70">add_thread</a>(std::function&lt; void()&gt; initializer)</td><td class="entry"><a class="el" href="classUtils_1_1ThreadPool.html">Utils::ThreadPool</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classUtils_1_1ThreadPool.html#af4415fd42e32a6b3146b12f086c52a48">initialize</a>(std::size_t)</td><td class="entry"><a class="el" href="classUtils_1_1ThreadPool.html">Utils::ThreadPool</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classUtils_1_1ThreadPool.html#ae9d4a2edc56f9d1bfdc5224ddcfc9c0b">ThreadPool</a>()=default</td><td class="entry"><a class="el" href="classUtils_1_1ThreadPool.html">Utils::ThreadPool</a></td><td class="entry"></td></tr>
......
......@@ -95,23 +95,34 @@ $(document).ready(function(){initNavTree('classUtils_1_1ThreadPool.html','');});
</div><!--header-->
<div class="contents">
<p>An implementation of Thread pool.
<a href="classUtils_1_1ThreadPool.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="ThreadPool_8h_source.html">ThreadPool.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:ae9d4a2edc56f9d1bfdc5224ddcfc9c0b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadPool.html#ae9d4a2edc56f9d1bfdc5224ddcfc9c0b">ThreadPool</a> ()=default</td></tr>
<tr class="memdesc:ae9d4a2edc56f9d1bfdc5224ddcfc9c0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="#ae9d4a2edc56f9d1bfdc5224ddcfc9c0b">More...</a><br /></td></tr>
<tr class="separator:ae9d4a2edc56f9d1bfdc5224ddcfc9c0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d1f0ba9d224454bd5ee0be2ae19dfa7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadPool.html#a8d1f0ba9d224454bd5ee0be2ae19dfa7">~ThreadPool</a> ()</td></tr>
<tr class="memdesc:a8d1f0ba9d224454bd5ee0be2ae19dfa7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default destructor. <a href="#a8d1f0ba9d224454bd5ee0be2ae19dfa7">More...</a><br /></td></tr>
<tr class="separator:a8d1f0ba9d224454bd5ee0be2ae19dfa7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4415fd42e32a6b3146b12f086c52a48"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadPool.html#af4415fd42e32a6b3146b12f086c52a48">initialize</a> (std::size_t)</td></tr>
<tr class="memdesc:af4415fd42e32a6b3146b12f086c52a48"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create worker threads. <a href="#af4415fd42e32a6b3146b12f086c52a48">More...</a><br /></td></tr>
<tr class="separator:af4415fd42e32a6b3146b12f086c52a48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11f5cde32eadf00a7d5606c5de24fc70"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadPool.html#a11f5cde32eadf00a7d5606c5de24fc70">add_thread</a> (std::function&lt; void()&gt; initializer)</td></tr>
<tr class="memdesc:a11f5cde32eadf00a7d5606c5de24fc70"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add an extra thread. <a href="#a11f5cde32eadf00a7d5606c5de24fc70">More...</a><br /></td></tr>
<tr class="separator:a11f5cde32eadf00a7d5606c5de24fc70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab25c460e933c645d8f66260521053e45"><td class="memTemplParams" colspan="2">template&lt;class F , class... Args&gt; </td></tr>
<tr class="memitem:ab25c460e933c645d8f66260521053e45"><td class="memTemplItemLeft" align="right" valign="top">auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadPool.html#ab25c460e933c645d8f66260521053e45">add_task</a> (F &amp;&amp;f, Args &amp;&amp;... args) -&gt; std::future&lt; typename std::result_of&lt; F(Args...)&gt;::type &gt;</td></tr>
<tr class="separator:ab25c460e933c645d8f66260521053e45"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5313af55df25fed6955806d60113e8b2"><td class="memItemLeft" align="right" valign="top">auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadPool.html#a5313af55df25fed6955806d60113e8b2">add_task</a> (F &amp;&amp;f, Args &amp;&amp;... args) -&gt; std::future&lt; typename std::result_of&lt; F(Args...)&gt;::type &gt;</td></tr>
<tr class="memdesc:a5313af55df25fed6955806d60113e8b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a task to the thread. <a href="#a5313af55df25fed6955806d60113e8b2">More...</a><br /></td></tr>
<tr class="separator:a5313af55df25fed6955806d60113e8b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An implementation of Thread pool. </p>
<dl class="section copyright"><dt>Copyright</dt><dd>zlib license </dd></dl>
<dl class="section author"><dt>Authors</dt><dd>Jakob Progsch, Václav Zeman </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ae9d4a2edc56f9d1bfdc5224ddcfc9c0b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae9d4a2edc56f9d1bfdc5224ddcfc9c0b">&#9670;&nbsp;</a></span>ThreadPool()</h2>
......@@ -135,6 +146,8 @@ Public Member Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
</div>
</div>
<a id="a8d1f0ba9d224454bd5ee0be2ae19dfa7"></a>
......@@ -160,16 +173,16 @@ Public Member Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Default destructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ab25c460e933c645d8f66260521053e45"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab25c460e933c645d8f66260521053e45">&#9670;&nbsp;</a></span>add_task()</h2>
<a id="a5313af55df25fed6955806d60113e8b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5313af55df25fed6955806d60113e8b2">&#9670;&nbsp;</a></span>add_task()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class F , class... Args&gt; </div>
<table class="memname">
<tr>
<td class="memname">auto Utils::ThreadPool::add_task </td>
......@@ -191,6 +204,16 @@ template&lt;class F , class... Args&gt; </div>
</table>
</div><div class="memdoc">
<p>Add a task to the thread. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">f</td><td>An object f </td></tr>
<tr><td class="paramname">args</td><td>A list of arguments </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A future object </dd></dl>
</div>
</div>
<a id="a11f5cde32eadf00a7d5606c5de24fc70"></a>
......@@ -217,6 +240,14 @@ template&lt;class F , class... Args&gt; </div>
</table>
</div><div class="memdoc">
<p>Add an extra thread. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">initializer</td><td>An initializer called before doing anything so that user can initialize per-thread data structures </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="af4415fd42e32a6b3146b12f086c52a48"></a>
......@@ -243,6 +274,14 @@ template&lt;class F , class... Args&gt; </div>
</table>
</div><div class="memdoc">
<p>Create worker threads. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">threads</td><td>(Optional) The number of threads </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
......
......@@ -2,7 +2,7 @@ var classUtils_1_1ThreadPool =
[
[ "ThreadPool", "classUtils_1_1ThreadPool.html#ae9d4a2edc56f9d1bfdc5224ddcfc9c0b", null ],
[ "~ThreadPool", "classUtils_1_1ThreadPool.html#a8d1f0ba9d224454bd5ee0be2ae19dfa7", null ],
[ "add_task", "classUtils_1_1ThreadPool.html#ab25c460e933c645d8f66260521053e45", null ],
[ "add_task", "classUtils_1_1ThreadPool.html#a5313af55df25fed6955806d60113e8b2", null ],
[ "add_thread", "classUtils_1_1ThreadPool.html#a11f5cde32eadf00a7d5606c5de24fc70", null ],
[ "initialize", "classUtils_1_1ThreadPool.html#af4415fd42e32a6b3146b12f086c52a48", null ]
];
\ No newline at end of file
......@@ -91,8 +91,8 @@ $(document).ready(function(){initNavTree('functions.html','');});
<h3><a id="index_a"></a>- a -</h3><ul>
<li>add_task()
: <a class="el" href="classUtils_1_1ThreadGroup.html#a42d5c52bddadeda9d4c7bc6292409fcd">Utils::ThreadGroup</a>
, <a class="el" href="classUtils_1_1ThreadPool.html#ab25c460e933c645d8f66260521053e45">Utils::ThreadPool</a>
: <a class="el" href="classUtils_1_1ThreadGroup.html#ac78653783eb2e65c388175149ed28891">Utils::ThreadGroup</a>
, <a class="el" href="classUtils_1_1ThreadPool.html#a5313af55df25fed6955806d60113e8b2">Utils::ThreadPool</a>
</li>
<li>add_thread()
: <a class="el" href="classUtils_1_1ThreadPool.html#a11f5cde32eadf00a7d5606c5de24fc70">Utils::ThreadPool</a>
......@@ -406,7 +406,7 @@ $(document).ready(function(){initNavTree('functions.html','');});
<h3><a id="index_w"></a>- w -</h3><ul>
<li>wait_all()
: <a class="el" href="classUtils_1_1ThreadGroup.html#a59a27c62932c3ca7d1ab084f4768ccb4">Utils::ThreadGroup</a>
: <a class="el" href="classUtils_1_1ThreadGroup.html#a2961f91bfa48f1e8115eedf72745b3eb">Utils::ThreadGroup</a>
</li>
</ul>
......
......@@ -91,8 +91,8 @@ $(document).ready(function(){initNavTree('functions_func.html','');});
<h3><a id="index_a"></a>- a -</h3><ul>
<li>add_task()
: <a class="el" href="classUtils_1_1ThreadGroup.html#a42d5c52bddadeda9d4c7bc6292409fcd">Utils::ThreadGroup</a>
, <a class="el" href="classUtils_1_1ThreadPool.html#ab25c460e933c645d8f66260521053e45">Utils::ThreadPool</a>
: <a class="el" href="classUtils_1_1ThreadGroup.html#ac78653783eb2e65c388175149ed28891">Utils::ThreadGroup</a>
, <a class="el" href="classUtils_1_1ThreadPool.html#a5313af55df25fed6955806d60113e8b2">Utils::ThreadPool</a>
</li>
<li>add_thread()
: <a class="el" href="classUtils_1_1ThreadPool.html#a11f5cde32eadf00a7d5606c5de24fc70">Utils::ThreadPool</a>
......@@ -294,7 +294,7 @@ $(document).ready(function(){initNavTree('functions_func.html','');});
<h3><a id="index_w"></a>- w -</h3><ul>
<li>wait_all()
: <a class="el" href="classUtils_1_1ThreadGroup.html#a59a27c62932c3ca7d1ab084f4768ccb4">Utils::ThreadGroup</a>
: <a class="el" href="classUtils_1_1ThreadGroup.html#a2961f91bfa48f1e8115eedf72745b3eb">Utils::ThreadGroup</a>
</li>
</ul>
......
......@@ -104,8 +104,10 @@ Classes</h2></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">RNG based on Xoroshiro128+. <a href="classUtils_1_1Random.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadGroup.html">ThreadGroup</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An implementation of Thread group. <a href="classUtils_1_1ThreadGroup.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1ThreadPool.html">ThreadPool</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An implementation of Thread pool. <a href="classUtils_1_1ThreadPool.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
......
......@@ -64,12 +64,12 @@ var NAVTREEINDEX0 =
"classUtils_1_1Random.html#aee6aa8e62561a37af49c8a75cf9faf81":[2,0,3,0,3],
"classUtils_1_1ThreadGroup.html":[2,0,3,1],
"classUtils_1_1ThreadGroup.html#a1ad4ddc3dfd5dc36bd157f9c93597ded":[2,0,3,1,0],
"classUtils_1_1ThreadGroup.html#a42d5c52bddadeda9d4c7bc6292409fcd":[2,0,3,1,1],
"classUtils_1_1ThreadGroup.html#a59a27c62932c3ca7d1ab084f4768ccb4":[2,0,3,1,2],
"classUtils_1_1ThreadGroup.html#a2961f91bfa48f1e8115eedf72745b3eb":[2,0,3,1,2],
"classUtils_1_1ThreadGroup.html#ac78653783eb2e65c388175149ed28891":[2,0,3,1,1],
"classUtils_1_1ThreadPool.html":[2,0,3,2],
"classUtils_1_1ThreadPool.html#a11f5cde32eadf00a7d5606c5de24fc70":[2,0,3,2,3],
"classUtils_1_1ThreadPool.html#a5313af55df25fed6955806d60113e8b2":[2,0,3,2,2],
"classUtils_1_1ThreadPool.html#a8d1f0ba9d224454bd5ee0be2ae19dfa7":[2,0,3,2,1],
"classUtils_1_1ThreadPool.html#ab25c460e933c645d8f66260521053e45":[2,0,3,2,2],
"classUtils_1_1ThreadPool.html#ae9d4a2edc56f9d1bfdc5224ddcfc9c0b":[2,0,3,2,0],
"classUtils_1_1ThreadPool.html#af4415fd42e32a6b3146b12f086c52a48":[2,0,3,2,4],
"classconnection.html":[2,0,5],
......
var searchData=
[
['add_5ftask',['add_task',['../classUtils_1_1ThreadPool.html#ab25c460e933c645d8f66260521053e45',1,'Utils::ThreadPool::add_task()'],['../classUtils_1_1ThreadGroup.html#a42d5c52bddadeda9d4c7bc6292409fcd',1,'Utils::ThreadGroup::add_task()']]],
['add_5ftask',['add_task',['../classUtils_1_1ThreadPool.html#a5313af55df25fed6955806d60113e8b2',1,'Utils::ThreadPool::add_task()'],['../classUtils_1_1ThreadGroup.html#ac78653783eb2e65c388175149ed28891',1,'Utils::ThreadGroup::add_task()']]],
['add_5fthread',['add_thread',['../classUtils_1_1ThreadPool.html#a11f5cde32eadf00a7d5606c5de24fc70',1,'Utils::ThreadPool']]],
['agent',['agent',['../structagent.html',1,'agent'],['../structagent.html#a64bb03238fa583e0f164c266d4172324',1,'agent::agent()=default'],['../structagent.html#ac184fa4d84197d46f01d80d3cdd83233',1,'agent::agent(const parameters &amp;params)']]],
['agent_2ecpp',['agent.cpp',['../agent_8cpp.html',1,'']]],
......
var searchData=
[
['wait_5fall',['wait_all',['../classUtils_1_1ThreadGroup.html#a59a27c62932c3ca7d1ab084f4768ccb4',1,'Utils::ThreadGroup']]]
['wait_5fall',['wait_all',['../classUtils_1_1ThreadGroup.html#a2961f91bfa48f1e8115eedf72745b3eb',1,'Utils::ThreadGroup']]]
];
var searchData=
[
['add_5ftask',['add_task',['../classUtils_1_1ThreadPool.html#ab25c460e933c645d8f66260521053e45',1,'Utils::ThreadPool::add_task()'],['../classUtils_1_1ThreadGroup.html#a42d5c52bddadeda9d4c7bc6292409fcd',1,'Utils::ThreadGroup::add_task()']]],
['add_5ftask',['add_task',['../classUtils_1_1ThreadPool.html#a5313af55df25fed6955806d60113e8b2',1,'Utils::ThreadPool::add_task()'],['../classUtils_1_1ThreadGroup.html#ac78653783eb2e65c388175149ed28891',1,'Utils::ThreadGroup::add_task()']]],
['add_5fthread',['add_thread',['../classUtils_1_1ThreadPool.html#a11f5cde32eadf00a7d5606c5de24fc70',1,'Utils::ThreadPool']]],
['agent',['agent',['../structagent.html#a64bb03238fa583e0f164c266d4172324',1,'agent::agent()=default'],['../structagent.html#ac184fa4d84197d46f01d80d3cdd83233',1,'agent::agent(const parameters &amp;params)']]],
['agent_5fworker',['agent_worker',['../agent__worker_8cpp.html#afe531a22028cc5400e79fe5315ef2ab2',1,'agent_worker(message::request&lt; agent &gt; request):&#160;agent_worker.cpp'],['../agent__worker_8hpp.html#afe531a22028cc5400e79fe5315ef2ab2',1,'agent_worker(message::request&lt; agent &gt; request):&#160;agent_worker.cpp']]],
......
var searchData=
[
['wait_5fall',['wait_all',['../classUtils_1_1ThreadGroup.html#a59a27c62932c3ca7d1ab084f4768ccb4',1,'Utils::ThreadGroup']]]
['wait_5fall',['wait_all',['../classUtils_1_1ThreadGroup.html#a2961f91bfa48f1e8115eedf72745b3eb',1,'Utils::ThreadGroup']]]
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment