mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-12 19:47:53 +08:00
Documentation for 53a6c16730
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: others::lru_cache::LRUCache Class Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -100,6 +100,12 @@ $(document).ready(function(){initNavTree('d6/dae/classothers_1_1lru__cache_1_1_l
|
||||
|
||||
<p>LRU cache class.
|
||||
<a href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#details">More...</a></p>
|
||||
<div class="dynheader">
|
||||
Collaboration diagram for others::lru_cache::LRUCache:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d8/da6/classothers_1_1lru__cache_1_1_l_r_u_cache__coll__graph.svg" width="100%" height="376"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
|
||||
Public Member Functions</h2></td></tr>
|
||||
@@ -173,7 +179,7 @@ uint64_t </td><td class="memItemRight" valign="bottom"><b>pageFrame</b></td
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="fragment"><div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span>{ <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a1aafd0444b410e0fcb66287e9954c893">pageFrame</a> = pf; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 84</span>{ <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a1aafd0444b410e0fcb66287e9954c893">pageFrame</a> = pf; }</div>
|
||||
<div class="ttc" id="aclassothers_1_1lru__cache_1_1_l_r_u_cache_html_a1aafd0444b410e0fcb66287e9954c893"><div class="ttname"><a href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a1aafd0444b410e0fcb66287e9954c893">others::lru_cache::LRUCache::pageFrame</a></div><div class="ttdeci">uint64_t pageFrame</div><div class="ttdoc">Page frame, or total size of the cache.</div><div class="ttdef"><b>Definition:</b> lru_cache.cpp:68</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -204,12 +210,12 @@ uint64_t </td><td class="memItemRight" valign="bottom"><b>pageFrame</b></td
|
||||
|
||||
<p>A function to display the current cache. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> {</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">for</span> (uint64_t &it : <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>) {</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << it << <span class="stringliteral">" "</span>;</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> }</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <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"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 120</span> {</div>
|
||||
<div class="line"><span class="lineno"> 121</span> <span class="keywordflow">for</span> (uint64_t &it : <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 122</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << it << <span class="stringliteral">" "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 123</span> }</div>
|
||||
<div class="line"><span class="lineno"> 124</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <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"> 125</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="aclassothers_1_1lru__cache_1_1_l_r_u_cache_html_a3ee3560a6b90e6f50f6e063d690ba8e8"><div class="ttname"><a href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">others::lru_cache::LRUCache::cache</a></div><div class="ttdeci">std::list< uint64_t > cache</div><div class="ttdoc">Cache linked list (using the STL)</div><div class="ttdef"><b>Definition:</b> lru_cache.cpp:69</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>
|
||||
@@ -247,7 +253,7 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>A function to get page hits. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a5f33913e7ddfbb38062362e7bd859154">hits</a>; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 130</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a5f33913e7ddfbb38062362e7bd859154">hits</a>; }</div>
|
||||
<div class="ttc" id="aclassothers_1_1lru__cache_1_1_l_r_u_cache_html_a5f33913e7ddfbb38062362e7bd859154"><div class="ttname"><a href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a5f33913e7ddfbb38062362e7bd859154">others::lru_cache::LRUCache::hits</a></div><div class="ttdeci">uint64_t hits</div><div class="ttdoc">was found in cache.</div><div class="ttdef"><b>Definition:</b> lru_cache.cpp:73</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -277,7 +283,7 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>A function to get page fault. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>
|
||||
<div class="fragment"><div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a09cbe562b0c396329607f5d388d57c9c">pageFault</a>; }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 135</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a09cbe562b0c396329607f5d388d57c9c">pageFault</a>; }</div>
|
||||
<div class="ttc" id="aclassothers_1_1lru__cache_1_1_l_r_u_cache_html_a09cbe562b0c396329607f5d388d57c9c"><div class="ttname"><a href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a09cbe562b0c396329607f5d388d57c9c">others::lru_cache::LRUCache::pageFault</a></div><div class="ttdeci">uint64_t pageFault</div><div class="ttdef"><b>Definition:</b> lru_cache.cpp:76</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -315,32 +321,46 @@ Here is the call graph for this function:</div>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<p >< Increase the page fault by one.</p>
|
||||
<div class="fragment"><div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> {</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="comment">// If the page requested not in cache.</span></div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">pageMap</a>.find(page) == <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">pageMap</a>.end()) {</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a09cbe562b0c396329607f5d388d57c9c">pageFault</a>++; <span class="comment">///< Increase the page fault by one.</span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="comment">// Check if the cache is full</span></div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.size() == <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a1aafd0444b410e0fcb66287e9954c893">pageFrame</a>) {</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="comment">// delete the last page from cache</span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> uint64_t lastPage = <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.back();</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.pop_back();</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">pageMap</a>.erase(lastPage);</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> }</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="comment">// The requested page is in the cache</span></div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a5f33913e7ddfbb38062362e7bd859154">hits</a>++;</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="comment">// present in cache, erase from current position to bring in front</span></div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.erase(<a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">pageMap</a>[page]);</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> }</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="comment">// Push it in the front of the cache and update the page reference in</span></div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="comment">// page map.</span></div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.push_front(page);</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">pageMap</a>[page] = <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.begin();</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 91</span> {</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="comment">// If the page requested not in cache.</span></div>
|
||||
<div class="line"><span class="lineno"> 93</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">pageMap</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map/find.html">find</a>(page) == <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">pageMap</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map/end.html">end</a>()) {</div>
|
||||
<div class="line"><span class="lineno"> 94</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a09cbe562b0c396329607f5d388d57c9c">pageFault</a>++; <span class="comment">///< Increase the page fault by one.</span></div>
|
||||
<div class="line"><span class="lineno"> 95</span> </div>
|
||||
<div class="line"><span class="lineno"> 96</span> <span class="comment">// Check if the cache is full</span></div>
|
||||
<div class="line"><span class="lineno"> 97</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/size.html">size</a>() == <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a1aafd0444b410e0fcb66287e9954c893">pageFrame</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 98</span> <span class="comment">// delete the last page from cache</span></div>
|
||||
<div class="line"><span class="lineno"> 99</span> uint64_t lastPage = <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/back.html">back</a>();</div>
|
||||
<div class="line"><span class="lineno"> 100</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/pop_back.html">pop_back</a>();</div>
|
||||
<div class="line"><span class="lineno"> 101</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">pageMap</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_map/erase.html">erase</a>(lastPage);</div>
|
||||
<div class="line"><span class="lineno"> 102</span> }</div>
|
||||
<div class="line"><span class="lineno"> 103</span> }</div>
|
||||
<div class="line"><span class="lineno"> 104</span> <span class="comment">// The requested page is in the cache</span></div>
|
||||
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 106</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a5f33913e7ddfbb38062362e7bd859154">hits</a>++;</div>
|
||||
<div class="line"><span class="lineno"> 107</span> <span class="comment">// present in cache, erase from current position to bring in front</span></div>
|
||||
<div class="line"><span class="lineno"> 108</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/erase.html">erase</a>(<a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">pageMap</a>[page]);</div>
|
||||
<div class="line"><span class="lineno"> 109</span> }</div>
|
||||
<div class="line"><span class="lineno"> 110</span> <span class="comment">// Push it in the front of the cache and update the page reference in</span></div>
|
||||
<div class="line"><span class="lineno"> 111</span> <span class="comment">// page map.</span></div>
|
||||
<div class="line"><span class="lineno"> 112</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/push_front.html">push_front</a>(page);</div>
|
||||
<div class="line"><span class="lineno"> 113</span> <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">pageMap</a>[page] = <a class="code hl_variable" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#a3ee3560a6b90e6f50f6e063d690ba8e8">cache</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/list/begin.html">begin</a>();</div>
|
||||
<div class="line"><span class="lineno"> 114</span> }</div>
|
||||
<div class="ttc" id="aback_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/back.html">std::list::back</a></div><div class="ttdeci">T back(T... args)</div></div>
|
||||
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/begin.html">std::list::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
||||
<div class="ttc" id="aclassothers_1_1lru__cache_1_1_l_r_u_cache_html_aa4d6db56109af196ffc7e5f72bc9907c"><div class="ttname"><a href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa4d6db56109af196ffc7e5f72bc9907c">others::lru_cache::LRUCache::pageMap</a></div><div class="ttdeci">std::unordered_map< uint64_t, std::list< uint64_t >::iterator > pageMap</div><div class="ttdoc">Hash map containing pages and their addresses.</div><div class="ttdef"><b>Definition:</b> lru_cache.cpp:71</div></div>
|
||||
</div><!-- fragment -->
|
||||
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/unordered_map/end.html">std::unordered_map::end</a></div><div class="ttdeci">T end(T... args)</div></div>
|
||||
<div class="ttc" id="aerase_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/unordered_map/erase.html">std::unordered_map::erase</a></div><div class="ttdeci">T erase(T... args)</div></div>
|
||||
<div class="ttc" id="afind_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/unordered_map/find.html">std::unordered_map::find</a></div><div class="ttdeci">T find(T... args)</div></div>
|
||||
<div class="ttc" id="apop_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/pop_back.html">std::list::pop_back</a></div><div class="ttdeci">T pop_back(T... args)</div></div>
|
||||
<div class="ttc" id="apush_front_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/push_front.html">std::list::push_front</a></div><div class="ttdeci">T push_front(T... args)</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/list/size.html">std::list::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache_a7dbf04bf7e1472c48639694f0b110602_cgraph.svg" width="356" height="475"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="groupheader">Member Data Documentation</h2>
|
||||
@@ -403,7 +423,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d0/d6f/namespaceothers.html">others</a></li><li class="navelem"><b>lru_cache</b></li><li class="navelem"><a class="el" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">LRUCache</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<map id="others::lru_cache::LRUCache::refer" name="others::lru_cache::LRUCache::refer">
|
||||
<area shape="rect" id="node1" title="Refer to a page, or request a page from memory." alt="" coords="5,217,136,258"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/back#" title=" " alt="" coords="217,5,318,32"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/begin#" title=" " alt="" coords="215,56,319,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_map/end#" title=" " alt="" coords="184,107,351,133"/>
|
||||
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_map/erase#" title=" " alt="" coords="199,158,336,199"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/erase#" title=" " alt="" coords="215,224,320,251"/>
|
||||
<area shape="rect" id="node7" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_map/find#" title=" " alt="" coords="199,275,336,317"/>
|
||||
<area shape="rect" id="node8" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/pop_back#" title=" " alt="" coords="203,341,332,368"/>
|
||||
<area shape="rect" id="node9" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/push_front#" title=" " alt="" coords="200,392,335,419"/>
|
||||
<area shape="rect" id="node10" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/list/size#" title=" " alt="" coords="219,443,316,469"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
a4fc4dbbc68686559c420c73641ac138
|
||||
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.50.0 (20211204.2007)
|
||||
-->
|
||||
<!-- Title: others::lru_cache::LRUCache::refer Pages: 1 -->
|
||||
<svg width="267pt" height="356pt"
|
||||
viewBox="0.00 0.00 267.00 356.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 352)">
|
||||
<title>others::lru_cache::LRUCache::refer</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-352 263,-352 263,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Refer to a page, or request a page from memory.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-159 0,-189 98,-189 98,-159 0,-159"/>
|
||||
<text text-anchor="start" x="8" y="-177" font-family="Helvetica,sans-Serif" font-size="10.00">others::lru_cache::</text>
|
||||
<text text-anchor="middle" x="49" y="-166" font-family="Helvetica,sans-Serif" font-size="10.00">LRUCache::refer</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="158.5,-328.5 158.5,-347.5 234.5,-347.5 234.5,-328.5 158.5,-328.5"/>
|
||||
<text text-anchor="middle" x="196.5" y="-335.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::back</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M54.63,-189.21C64.38,-218.7 89.86,-283.83 134,-319 138.42,-322.53 143.5,-325.4 148.81,-327.74"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="147.91,-331.14 158.5,-331.41 150.39,-324.6 147.91,-331.14"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/begin#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="157.5,-290.5 157.5,-309.5 235.5,-309.5 235.5,-290.5 157.5,-290.5"/>
|
||||
<text text-anchor="middle" x="196.5" y="-297.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::begin</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M57.91,-189.17C70.77,-212.36 98.39,-256.51 134,-281 138.26,-283.93 143,-286.43 147.89,-288.54"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="146.83,-291.88 157.42,-292.17 149.32,-285.34 146.83,-291.88"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_map/end#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="134,-252.5 134,-271.5 259,-271.5 259,-252.5 134,-252.5"/>
|
||||
<text text-anchor="middle" x="196.5" y="-259.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map::end</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M64.77,-189.22C80.59,-204.73 107.08,-228.51 134,-243 138.04,-245.17 142.36,-247.14 146.78,-248.91"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="145.92,-252.32 156.51,-252.46 148.32,-245.74 145.92,-252.32"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_map/erase#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="145,-203 145,-233 248,-233 248,-203 145,-203"/>
|
||||
<text text-anchor="start" x="153" y="-221" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
|
||||
<text text-anchor="middle" x="196.5" y="-210" font-family="Helvetica,sans-Serif" font-size="10.00">::erase</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M98.05,-188.53C110.06,-192.16 123.1,-196.11 135.62,-199.89"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="134.92,-203.34 145.51,-202.88 136.95,-196.64 134.92,-203.34"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/erase#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="157,-164.5 157,-183.5 236,-183.5 236,-164.5 157,-164.5"/>
|
||||
<text text-anchor="middle" x="196.5" y="-171.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::erase</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node6 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M98.05,-174C113.66,-174 131,-174 146.68,-174"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="146.7,-177.5 156.7,-174 146.7,-170.5 146.7,-177.5"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_map/find#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="145,-115 145,-145 248,-145 248,-115 145,-115"/>
|
||||
<text text-anchor="start" x="153" y="-133" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_map</text>
|
||||
<text text-anchor="middle" x="196.5" y="-122" font-family="Helvetica,sans-Serif" font-size="10.00">::find</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node7 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M98.05,-159.47C110.06,-155.84 123.1,-151.89 135.62,-148.11"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="136.95,-151.36 145.51,-145.12 134.92,-144.66 136.95,-151.36"/>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/pop_back#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="148,-76.5 148,-95.5 245,-95.5 245,-76.5 148,-76.5"/>
|
||||
<text text-anchor="middle" x="196.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::pop_back</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node8 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node1->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M65.15,-158.81C81.07,-143.59 107.45,-120.42 134,-106 138.81,-103.39 144.02,-101.05 149.3,-98.96"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="150.61,-102.21 158.81,-95.5 148.22,-95.63 150.61,-102.21"/>
|
||||
</g>
|
||||
<!-- Node9 -->
|
||||
<g id="node9" class="node">
|
||||
<title>Node9</title>
|
||||
<g id="a_node9"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/push_front#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="146,-38.5 146,-57.5 247,-57.5 247,-38.5 146,-38.5"/>
|
||||
<text text-anchor="middle" x="196.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::push_front</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node9 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node1->Node9</title>
|
||||
<path fill="none" stroke="midnightblue" d="M57.91,-158.83C70.77,-135.64 98.39,-91.49 134,-67 136.9,-65.01 140.01,-63.22 143.24,-61.61"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="144.81,-64.75 152.59,-57.55 142.02,-58.33 144.81,-64.75"/>
|
||||
</g>
|
||||
<!-- Node10 -->
|
||||
<g id="node10" class="node">
|
||||
<title>Node10</title>
|
||||
<g id="a_node10"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/list/size#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="160,-0.5 160,-19.5 233,-19.5 233,-0.5 160,-0.5"/>
|
||||
<text text-anchor="middle" x="196.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::list::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node10 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node1->Node10</title>
|
||||
<path fill="none" stroke="midnightblue" d="M54.63,-158.79C64.38,-129.3 89.86,-64.17 134,-29 138.76,-25.21 144.28,-22.17 150.01,-19.74"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="151.58,-22.89 159.78,-16.18 149.19,-16.31 151.58,-22.89"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.1 KiB |
@@ -1,4 +1,4 @@
|
||||
<map id="others::lru_cache::LRUCache::display" name="others::lru_cache::LRUCache::display">
|
||||
<area shape="rect" id="node1" title="A function to display the current cache." alt="" coords="5,5,141,47"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="189,13,261,39"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl#" title=" " alt="" coords="189,13,261,39"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
765608dc03f088ee3097a6d35c7027c4
|
||||
22e7f54aa76914e04f36d05a44d3e472
|
||||
@@ -22,7 +22,7 @@
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="138,-6 138,-25 192,-25 192,-6 138,-6"/>
|
||||
<text text-anchor="middle" x="165" y="-13" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Reference in New Issue
Block a user