Documentation for c6af943508

This commit is contained in:
realstealthninja
2024-11-04 12:10:37 +00:00
parent e97327bf4f
commit fb1d00ead7
518 changed files with 13882 additions and 10974 deletions

View File

@@ -115,13 +115,14 @@ $(function(){initNavTree('d3/db3/lru__cache_8cpp.html','../../'); initResizable(
<p>An implementation of <a href="https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)" target="_blank">LRU Cache</a>. Lru is a part of cache algorithms (also frequently called cache replacement algorithms or cache replacement policies).
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;cassert&gt;</code><br />
<code>#include &lt;cstdint&gt;</code><br />
<code>#include &lt;iostream&gt;</code><br />
<code>#include &lt;list&gt;</code><br />
<code>#include &lt;unordered_map&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for lru_cache.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d6d/lru__cache_8cpp__incl.svg" width="368" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/d6d/lru__cache_8cpp__incl.svg" width="452" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
@@ -219,10 +220,10 @@ template&lt;typename T &gt; </div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 148</span> {</div>
<div class="line"><span class="lineno"> 149</span> <span class="comment">// It&#39;s just to avoid writing cout and endl</span></div>
<div class="line"><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;[TESTS] : ---&gt; &quot;</span> &lt;&lt; msg &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 151</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 149</span> {</div>
<div class="line"><span class="lineno"> 150</span> <span class="comment">// It&#39;s just to avoid writing cout and endl</span></div>
<div class="line"><span class="lineno"> 151</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;[TESTS] : ---&gt; &quot;</span> &lt;&lt; msg &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 152</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
@@ -250,26 +251,26 @@ Here is the call graph for this function:</div>
<p>Main function. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 251</span> {</div>
<div class="line"><span class="lineno"> 252</span> <a class="code hl_function" href="#a6a3be6d8871b1f5dc03688da8f3ee9e6">lru_tests::run_tests</a>();</div>
<div class="line"><span class="lineno"> 253</span> </div>
<div class="line"><span class="lineno"> 254</span> <span class="comment">// Usage</span></div>
<div class="line"><span class="lineno"> 255</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
<div class="line"><span class="lineno"> 256</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 257</span> cache.refer(2);</div>
<div class="line"><span class="lineno"> 258</span> cache.refer(3);</div>
<div class="line"><span class="lineno"> 259</span> cache.refer(4);</div>
<div class="line"><span class="lineno"> 260</span> cache.refer(5);</div>
<div class="fragment"><div class="line"><span class="lineno"> 252</span> {</div>
<div class="line"><span class="lineno"> 253</span> <a class="code hl_function" href="#a6a3be6d8871b1f5dc03688da8f3ee9e6">lru_tests::run_tests</a>();</div>
<div class="line"><span class="lineno"> 254</span> </div>
<div class="line"><span class="lineno"> 255</span> <span class="comment">// Usage</span></div>
<div class="line"><span class="lineno"> 256</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
<div class="line"><span class="lineno"> 257</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 258</span> cache.refer(2);</div>
<div class="line"><span class="lineno"> 259</span> cache.refer(3);</div>
<div class="line"><span class="lineno"> 260</span> cache.refer(4);</div>
<div class="line"><span class="lineno"> 261</span> cache.refer(5);</div>
<div class="line"><span class="lineno"> 262</span> </div>
<div class="line"><span class="lineno"> 263</span> cache.display();</div>
<div class="line"><span class="lineno"> 264</span> </div>
<div class="line"><span class="lineno"> 265</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Hits: &quot;</span> &lt;&lt; cache.getHits()</div>
<div class="line"><span class="lineno"> 266</span> &lt;&lt; <span class="stringliteral">&quot; Miss: &quot;</span> &lt;&lt; cache.getPageFault() &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 267</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 268</span>}</div>
<div class="ttc" id="aclassothers_1_1lru__cache_1_1_l_r_u_cache_html"><div class="ttname"><a href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a></div><div class="ttdoc">LRU cache class.</div><div class="ttdef"><b>Definition</b> lru_cache.cpp:67</div></div>
<div class="ttc" id="alru__cache_8cpp_html_a6a3be6d8871b1f5dc03688da8f3ee9e6"><div class="ttname"><a href="#a6a3be6d8871b1f5dc03688da8f3ee9e6">lru_tests::run_tests</a></div><div class="ttdeci">static void run_tests()</div><div class="ttdoc">A function to invoke all test cases.</div><div class="ttdef"><b>Definition</b> lru_cache.cpp:238</div></div>
<div class="line"><span class="lineno"> 262</span> cache.refer(5);</div>
<div class="line"><span class="lineno"> 263</span> </div>
<div class="line"><span class="lineno"> 264</span> cache.display();</div>
<div class="line"><span class="lineno"> 265</span> </div>
<div class="line"><span class="lineno"> 266</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Hits: &quot;</span> &lt;&lt; cache.getHits()</div>
<div class="line"><span class="lineno"> 267</span> &lt;&lt; <span class="stringliteral">&quot; Miss: &quot;</span> &lt;&lt; cache.getPageFault() &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 268</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 269</span>}</div>
<div class="ttc" id="aclassothers_1_1lru__cache_1_1_l_r_u_cache_html"><div class="ttname"><a href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a></div><div class="ttdoc">LRU cache class.</div><div class="ttdef"><b>Definition</b> lru_cache.cpp:68</div></div>
<div class="ttc" id="alru__cache_8cpp_html_a6a3be6d8871b1f5dc03688da8f3ee9e6"><div class="ttname"><a href="#a6a3be6d8871b1f5dc03688da8f3ee9e6">lru_tests::run_tests</a></div><div class="ttdeci">static void run_tests()</div><div class="ttdoc">A function to invoke all test cases.</div><div class="ttdef"><b>Definition</b> lru_cache.cpp:239</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -303,13 +304,13 @@ Here is the call graph for this function:</div>
<p>A function to invoke all test cases. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 238</span> {</div>
<div class="line"><span class="lineno"> 239</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#a34b8683a2b429de5cce57e6d733ec817">test_1</a>();</div>
<div class="line"><span class="lineno"> 240</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#a458410412185a5f09199deaff7157a8d">test_2</a>();</div>
<div class="line"><span class="lineno"> 241</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#af31ec5409537703d9c8a47350386b32a">test_3</a>();</div>
<div class="line"><span class="lineno"> 242</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><span class="lineno"> 243</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;TESTS COMPLETED!&quot;</span>);</div>
<div class="line"><span class="lineno"> 244</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 239</span> {</div>
<div class="line"><span class="lineno"> 240</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#a34b8683a2b429de5cce57e6d733ec817">test_1</a>();</div>
<div class="line"><span class="lineno"> 241</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#a458410412185a5f09199deaff7157a8d">test_2</a>();</div>
<div class="line"><span class="lineno"> 242</span> <a class="code hl_function" href="../../d2/de9/heavy__light__decomposition_8cpp.html#af31ec5409537703d9c8a47350386b32a">test_3</a>();</div>
<div class="line"><span class="lineno"> 243</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><span class="lineno"> 244</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;TESTS COMPLETED!&quot;</span>);</div>
<div class="line"><span class="lineno"> 245</span>}</div>
<div class="ttc" id="aheavy__light__decomposition_8cpp_html_a34b8683a2b429de5cce57e6d733ec817"><div class="ttname"><a href="../../d2/de9/heavy__light__decomposition_8cpp.html#a34b8683a2b429de5cce57e6d733ec817">test_1</a></div><div class="ttdeci">static void test_1()</div><div class="ttdef"><b>Definition</b> heavy_light_decomposition.cpp:505</div></div>
<div class="ttc" id="aheavy__light__decomposition_8cpp_html_a458410412185a5f09199deaff7157a8d"><div class="ttname"><a href="../../d2/de9/heavy__light__decomposition_8cpp.html#a458410412185a5f09199deaff7157a8d">test_2</a></div><div class="ttdeci">static void test_2()</div><div class="ttdef"><b>Definition</b> heavy_light_decomposition.cpp:549</div></div>
<div class="ttc" id="aheavy__light__decomposition_8cpp_html_af31ec5409537703d9c8a47350386b32a"><div class="ttname"><a href="../../d2/de9/heavy__light__decomposition_8cpp.html#af31ec5409537703d9c8a47350386b32a">test_3</a></div><div class="ttdeci">static void test_3()</div><div class="ttdef"><b>Definition</b> heavy_light_decomposition.cpp:592</div></div>
@@ -347,26 +348,26 @@ Here is the call graph for this function:</div>
<p>A simple test case The assert statement will check expected hist and miss to resultant hits and miss. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 159</span> {</div>
<div class="line"><span class="lineno"> 160</span> uint64_t expected_hits = 2;</div>
<div class="line"><span class="lineno"> 161</span> uint64_t expected_pageFault = 4;</div>
<div class="line"><span class="lineno"> 162</span> </div>
<div class="line"><span class="lineno"> 163</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Running Test-1...&quot;</span>);</div>
<div class="line"><span class="lineno"> 164</span> </div>
<div class="line"><span class="lineno"> 165</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
<div class="line"><span class="lineno"> 166</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 167</span> cache.refer(2);</div>
<div class="line"><span class="lineno"> 168</span> cache.refer(5);</div>
<div class="line"><span class="lineno"> 169</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 170</span> cache.refer(4);</div>
<div class="line"><span class="lineno"> 171</span> cache.refer(5);</div>
<div class="line"><span class="lineno"> 172</span> </div>
<div class="line"><span class="lineno"> 173</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Checking assert statement...&quot;</span>);</div>
<div class="line"><span class="lineno"> 174</span> assert(cache.getHits() == expected_hits &amp;&amp;</div>
<div class="line"><span class="lineno"> 175</span> cache.getPageFault() == expected_pageFault);</div>
<div class="line"><span class="lineno"> 176</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Assert successful!&quot;</span>);</div>
<div class="line"><span class="lineno"> 177</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Test-1 complete!&quot;</span>);</div>
<div class="line"><span class="lineno"> 178</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 160</span> {</div>
<div class="line"><span class="lineno"> 161</span> uint64_t expected_hits = 2;</div>
<div class="line"><span class="lineno"> 162</span> uint64_t expected_pageFault = 4;</div>
<div class="line"><span class="lineno"> 163</span> </div>
<div class="line"><span class="lineno"> 164</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Running Test-1...&quot;</span>);</div>
<div class="line"><span class="lineno"> 165</span> </div>
<div class="line"><span class="lineno"> 166</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
<div class="line"><span class="lineno"> 167</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 168</span> cache.refer(2);</div>
<div class="line"><span class="lineno"> 169</span> cache.refer(5);</div>
<div class="line"><span class="lineno"> 170</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 171</span> cache.refer(4);</div>
<div class="line"><span class="lineno"> 172</span> cache.refer(5);</div>
<div class="line"><span class="lineno"> 173</span> </div>
<div class="line"><span class="lineno"> 174</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Checking assert statement...&quot;</span>);</div>
<div class="line"><span class="lineno"> 175</span> assert(cache.getHits() == expected_hits &amp;&amp;</div>
<div class="line"><span class="lineno"> 176</span> cache.getPageFault() == expected_pageFault);</div>
<div class="line"><span class="lineno"> 177</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Assert successful!&quot;</span>);</div>
<div class="line"><span class="lineno"> 178</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Test-1 complete!&quot;</span>);</div>
<div class="line"><span class="lineno"> 179</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -400,26 +401,26 @@ Here is the call graph for this function:</div>
<p>A test case contains hits more than cache size The assert statement will check expected hist and miss to resultant hits and miss. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 186</span> {</div>
<div class="line"><span class="lineno"> 187</span> uint64_t expected_hits = 4;</div>
<div class="line"><span class="lineno"> 188</span> uint64_t expected_pageFault = 2;</div>
<div class="line"><span class="lineno"> 189</span> </div>
<div class="line"><span class="lineno"> 190</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Running Test-2...&quot;</span>);</div>
<div class="line"><span class="lineno"> 191</span> </div>
<div class="line"><span class="lineno"> 192</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
<div class="line"><span class="lineno"> 193</span> cache.refer(1);</div>
<div class="fragment"><div class="line"><span class="lineno"> 187</span> {</div>
<div class="line"><span class="lineno"> 188</span> uint64_t expected_hits = 4;</div>
<div class="line"><span class="lineno"> 189</span> uint64_t expected_pageFault = 2;</div>
<div class="line"><span class="lineno"> 190</span> </div>
<div class="line"><span class="lineno"> 191</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Running Test-2...&quot;</span>);</div>
<div class="line"><span class="lineno"> 192</span> </div>
<div class="line"><span class="lineno"> 193</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
<div class="line"><span class="lineno"> 194</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 195</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 196</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 197</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 198</span> cache.refer(5);</div>
<div class="line"><span class="lineno"> 199</span> </div>
<div class="line"><span class="lineno"> 200</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Checking assert statement...&quot;</span>);</div>
<div class="line"><span class="lineno"> 201</span> assert(cache.getHits() == expected_hits &amp;&amp;</div>
<div class="line"><span class="lineno"> 202</span> cache.getPageFault() == expected_pageFault);</div>
<div class="line"><span class="lineno"> 203</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Assert successful!&quot;</span>);</div>
<div class="line"><span class="lineno"> 204</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Test-2 complete!&quot;</span>);</div>
<div class="line"><span class="lineno"> 205</span>}</div>
<div class="line"><span class="lineno"> 198</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 199</span> cache.refer(5);</div>
<div class="line"><span class="lineno"> 200</span> </div>
<div class="line"><span class="lineno"> 201</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Checking assert statement...&quot;</span>);</div>
<div class="line"><span class="lineno"> 202</span> assert(cache.getHits() == expected_hits &amp;&amp;</div>
<div class="line"><span class="lineno"> 203</span> cache.getPageFault() == expected_pageFault);</div>
<div class="line"><span class="lineno"> 204</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Assert successful!&quot;</span>);</div>
<div class="line"><span class="lineno"> 205</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Test-2 complete!&quot;</span>);</div>
<div class="line"><span class="lineno"> 206</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -453,26 +454,26 @@ Here is the call graph for this function:</div>
<p>A simple test case The assert statement will check expected hist and miss to resultant hits and miss. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 213</span> {</div>
<div class="line"><span class="lineno"> 214</span> uint64_t expected_hits = 1;</div>
<div class="line"><span class="lineno"> 215</span> uint64_t expected_pageFault = 5;</div>
<div class="line"><span class="lineno"> 216</span> </div>
<div class="line"><span class="lineno"> 217</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Running Test-3...&quot;</span>);</div>
<div class="line"><span class="lineno"> 218</span> </div>
<div class="line"><span class="lineno"> 219</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
<div class="line"><span class="lineno"> 220</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 221</span> cache.refer(2);</div>
<div class="line"><span class="lineno"> 222</span> cache.refer(3);</div>
<div class="line"><span class="lineno"> 223</span> cache.refer(4);</div>
<div class="line"><span class="lineno"> 224</span> cache.refer(5);</div>
<div class="fragment"><div class="line"><span class="lineno"> 214</span> {</div>
<div class="line"><span class="lineno"> 215</span> uint64_t expected_hits = 1;</div>
<div class="line"><span class="lineno"> 216</span> uint64_t expected_pageFault = 5;</div>
<div class="line"><span class="lineno"> 217</span> </div>
<div class="line"><span class="lineno"> 218</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Running Test-3...&quot;</span>);</div>
<div class="line"><span class="lineno"> 219</span> </div>
<div class="line"><span class="lineno"> 220</span> <a class="code hl_class" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">others::lru_cache::LRUCache</a> cache(4);</div>
<div class="line"><span class="lineno"> 221</span> cache.refer(1);</div>
<div class="line"><span class="lineno"> 222</span> cache.refer(2);</div>
<div class="line"><span class="lineno"> 223</span> cache.refer(3);</div>
<div class="line"><span class="lineno"> 224</span> cache.refer(4);</div>
<div class="line"><span class="lineno"> 225</span> cache.refer(5);</div>
<div class="line"><span class="lineno"> 226</span> </div>
<div class="line"><span class="lineno"> 227</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Checking assert statement...&quot;</span>);</div>
<div class="line"><span class="lineno"> 228</span> assert(cache.getHits() == expected_hits &amp;&amp;</div>
<div class="line"><span class="lineno"> 229</span> cache.getPageFault() == expected_pageFault);</div>
<div class="line"><span class="lineno"> 230</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Assert successful!&quot;</span>);</div>
<div class="line"><span class="lineno"> 231</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Test-3 complete!&quot;</span>);</div>
<div class="line"><span class="lineno"> 232</span>}</div>
<div class="line"><span class="lineno"> 226</span> cache.refer(5);</div>
<div class="line"><span class="lineno"> 227</span> </div>
<div class="line"><span class="lineno"> 228</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Checking assert statement...&quot;</span>);</div>
<div class="line"><span class="lineno"> 229</span> assert(cache.getHits() == expected_hits &amp;&amp;</div>
<div class="line"><span class="lineno"> 230</span> cache.getPageFault() == expected_pageFault);</div>
<div class="line"><span class="lineno"> 231</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Assert successful!&quot;</span>);</div>
<div class="line"><span class="lineno"> 232</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/log.html">log</a>(<span class="stringliteral">&quot;Test-3 complete!&quot;</span>);</div>
<div class="line"><span class="lineno"> 233</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">