Files
rippled/classripple_1_1LedgerHolder.html
2025-01-21 19:58:08 +00:00

317 lines
20 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<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.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rippled: ripple::LedgerHolder Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceripple.html">ripple</a></li><li class="navelem"><a class="el" href="classripple_1_1LedgerHolder.html">LedgerHolder</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-static-methods">Static Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classripple_1_1LedgerHolder-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">ripple::LedgerHolder Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Hold a ledger in a thread-safe way.
<a href="classripple_1_1LedgerHolder.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="LedgerHolder_8h_source.html">LedgerHolder.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ripple::LedgerHolder:</div>
<div class="dyncontent">
<div class="center"><img src="classripple_1_1LedgerHolder__inherit__graph.png" border="0" usemap="#aripple_1_1LedgerHolder_inherit__map" alt="Inheritance graph"/></div>
<map name="aripple_1_1LedgerHolder_inherit__map" id="aripple_1_1LedgerHolder_inherit__map">
<area shape="rect" title="Hold a ledger in a thread&#45;safe way." alt="" coords="9,93,164,119"/>
<area shape="rect" href="classripple_1_1CountedObject.html" title=" " alt="" coords="5,5,168,45"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for ripple::LedgerHolder:</div>
<div class="dyncontent">
<div class="center"><img src="classripple_1_1LedgerHolder__coll__graph.png" border="0" usemap="#aripple_1_1LedgerHolder_coll__map" alt="Collaboration graph"/></div>
<map name="aripple_1_1LedgerHolder_coll__map" id="aripple_1_1LedgerHolder_coll__map">
<area shape="rect" title="Hold a ledger in a thread&#45;safe way." alt="" coords="2769,99,2924,124"/>
<area shape="rect" href="classripple_1_1CountedObject.html" title=" " alt="" coords="2457,34,2620,74"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/thread/mutex.html" title=" " alt="" coords="1877,99,1969,124"/>
<area shape="rect" href="classripple_1_1Ledger.html" title="Holds a ledger." alt="" coords="2197,320,2308,345"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html" title=" " alt="" coords="2453,190,2624,230"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/memory/enable_shared_from_this.html" title=" " alt="" coords="1841,198,2006,238"/>
<area shape="rect" href="classripple_1_1DigestAwareReadView.html" title="ReadView that associates keys with digests." alt="" coords="1816,603,2031,628"/>
<area shape="rect" href="classripple_1_1ReadView.html" title="A view into a ledger." alt="" coords="1559,719,1691,744"/>
<area shape="rect" href="classripple_1_1detail_1_1ReadViewFwdRange.html" title=" " alt="" coords="1830,653,2017,693"/>
<area shape="rect" href="classripple_1_1detail_1_1ReadViewFwdRange.html" title=" " alt="" coords="1835,779,2012,819"/>
<area shape="rect" href="structripple_1_1ReadView_1_1sles__type.html" title=" " alt="" coords="2152,689,2353,715"/>
<area shape="rect" href="structripple_1_1ReadView_1_1txs__type.html" title=" " alt="" coords="2155,823,2350,848"/>
<area shape="rect" href="classripple_1_1TxsRawView.html" title="Interface for changing ledger entries with transactions." alt="" coords="1848,553,1999,579"/>
<area shape="rect" href="classripple_1_1RawView.html" title="Interface for ledger entry changes." alt="" coords="1562,564,1689,589"/>
<area shape="rect" href="classripple_1_1CountedObject.html" title=" " alt="" coords="1842,313,2005,353"/>
<area shape="rect" href="classripple_1_1SHAMap.html" title="A SHAMap is both a radix tree with a fan&#45;out of 16 and a Merkle tree." alt="" coords="1862,148,1985,173"/>
<area shape="rect" href="classripple_1_1Family.html" title=" " alt="" coords="1570,5,1681,31"/>
<area shape="rect" href="classbeast_1_1Journal.html" title="A generic endpoint for log messages." alt="" coords="1570,371,1681,396"/>
<area shape="rect" href="classbeast_1_1Journal_1_1Sink.html" title="Abstraction for the underlying message destination." alt="" coords="1275,371,1422,396"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/types/integer.html" title=" " alt="" coords="5,149,108,175"/>
<area shape="rect" href="classripple_1_1SHAMapTreeNode.html" title=" " alt="" coords="1257,148,1440,173"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/container/array.html" title=" " alt="" coords="250,233,418,273"/>
<area shape="rect" href="structripple_1_1LedgerHeader.html" title="Information about the notional ledger backing the view." alt="" coords="929,597,1088,623"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html" title=" " alt="" coords="1540,141,1711,181"/>
<area shape="rect" href="classripple_1_1SHAMapHash.html" title=" " alt="" coords="931,168,1086,193"/>
<area shape="rect" href="classripple_1_1base__uint.html" title=" " alt="" coords="559,325,701,365"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/types/size_t.html" title=" " alt="" coords="290,183,378,208"/>
<area shape="rect" href="classripple_1_1base__uint.html" title="Integers of any length that is a multiple of 32&#45;bits." alt="" coords="559,221,701,261"/>
<area shape="rect" href="structripple_1_1Fees.html" title="Reflects the fee settings for a particular ledger." alt="" coords="1136,440,1233,465"/>
<area shape="rect" href="classripple_1_1XRPAmount.html" title=" " alt="" coords="559,497,701,523"/>
<area shape="rect" title=" " alt="" coords="251,490,417,530"/>
<area shape="rect" title=" " alt="" coords="221,619,447,644"/>
<area shape="rect" title=" " alt="" coords="229,426,439,466"/>
<area shape="rect" title=" " alt="" coords="227,554,441,594"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/types/integer.html" title=" " alt="" coords="287,376,381,401"/>
<area shape="rect" href="classripple_1_1Rules.html" title="Rules controlling protocol behavior." alt="" coords="1872,263,1975,288"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html" title=" " alt="" coords="1540,277,1711,317"/>
<area shape="rect" href="classripple_1_1Rules_1_1Impl.html" title=" " alt="" coords="1279,296,1419,321"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/container/unordered_set.html" title=" " alt="" coords="905,217,1112,272"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/container/unordered_set.html" title=" " alt="" coords="934,296,1083,351"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/utility/optional.html" title=" " alt="" coords="931,375,1086,415"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/chrono/time_point.html" title=" " alt="" coords="544,719,716,759"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/chrono/duration.html" title=" " alt="" coords="552,605,708,645"/>
</map>
<center><span class="legend">[<a 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>
<tr class="memitem:aa824811e930ab1ebf8e6449355c541b1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1LedgerHolder.html#aa824811e930ab1ebf8e6449355c541b1">set</a> (<a class="elRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a>&lt; <a class="el" href="classripple_1_1Ledger.html">Ledger</a> const &gt; ledger)</td></tr>
<tr class="separator:aa824811e930ab1ebf8e6449355c541b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90d10586ab8c130bd491c7ad8fdce856"><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a>&lt; <a class="el" href="classripple_1_1Ledger.html">Ledger</a> const &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1LedgerHolder.html#a90d10586ab8c130bd491c7ad8fdce856">get</a> ()</td></tr>
<tr class="separator:a90d10586ab8c130bd491c7ad8fdce856"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87cfd83ef66929c86ce7a0cf6050c02c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1LedgerHolder.html#a87cfd83ef66929c86ce7a0cf6050c02c">empty</a> ()</td></tr>
<tr class="separator:a87cfd83ef66929c86ce7a0cf6050c02c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-static-methods" name="pri-static-methods"></a>
Static Private Member Functions</h2></td></tr>
<tr class="memitem:ae60d6cae0e97e9f17c93945feca09fb5"><td class="memItemLeft" align="right" valign="top">static auto &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1CountedObject.html#ae60d6cae0e97e9f17c93945feca09fb5">getCounter</a> () noexcept</td></tr>
<tr class="separator:ae60d6cae0e97e9f17c93945feca09fb5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a8ecb79804c3e902dd324cbb1cd6b0a7b"><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="http://en.cppreference.com/w/cpp/thread/mutex.html">std::mutex</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1LedgerHolder.html#a8ecb79804c3e902dd324cbb1cd6b0a7b">m_lock</a></td></tr>
<tr class="separator:a8ecb79804c3e902dd324cbb1cd6b0a7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1b0d556cfdf69766990a195a745ae50"><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a>&lt; <a class="el" href="classripple_1_1Ledger.html">Ledger</a> const &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1LedgerHolder.html#ad1b0d556cfdf69766990a195a745ae50">m_heldLedger</a></td></tr>
<tr class="separator:ad1b0d556cfdf69766990a195a745ae50"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Hold a ledger in a thread-safe way. </p>
<p >VFALCO TODO The constructor should require a valid ledger, this way the object always holds a value. We can use the genesis ledger in all cases. </p>
<p class="definition">Definition at line <a class="el" href="LedgerHolder_8h_source.html#l00039">39</a> of file <a class="el" href="LedgerHolder_8h_source.html">LedgerHolder.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="aa824811e930ab1ebf8e6449355c541b1" name="aa824811e930ab1ebf8e6449355c541b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa824811e930ab1ebf8e6449355c541b1">&#9670;&#160;</a></span>set()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ripple::LedgerHolder::set </td>
<td>(</td>
<td class="paramtype"><a class="elRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a>&lt; <a class="el" href="classripple_1_1Ledger.html">Ledger</a> const &gt;&#160;</td>
<td class="paramname"><em>ledger</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="LedgerHolder_8h_source.html#l00044">44</a> of file <a class="el" href="LedgerHolder_8h_source.html">LedgerHolder.h</a>.</p>
</div>
</div>
<a id="a90d10586ab8c130bd491c7ad8fdce856" name="a90d10586ab8c130bd491c7ad8fdce856"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90d10586ab8c130bd491c7ad8fdce856">&#9670;&#160;</a></span>get()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a>&lt; <a class="el" href="classripple_1_1Ledger.html">Ledger</a> const &gt; ripple::LedgerHolder::get </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="LedgerHolder_8h_source.html#l00056">56</a> of file <a class="el" href="LedgerHolder_8h_source.html">LedgerHolder.h</a>.</p>
</div>
</div>
<a id="a87cfd83ef66929c86ce7a0cf6050c02c" name="a87cfd83ef66929c86ce7a0cf6050c02c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a87cfd83ef66929c86ce7a0cf6050c02c">&#9670;&#160;</a></span>empty()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ripple::LedgerHolder::empty </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="LedgerHolder_8h_source.html#l00063">63</a> of file <a class="el" href="LedgerHolder_8h_source.html">LedgerHolder.h</a>.</p>
</div>
</div>
<a id="ae60d6cae0e97e9f17c93945feca09fb5" name="ae60d6cae0e97e9f17c93945feca09fb5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae60d6cae0e97e9f17c93945feca09fb5">&#9670;&#160;</a></span>getCounter()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static auto &amp; <a class="el" href="classripple_1_1CountedObject.html">ripple::CountedObject</a>&lt; <a class="el" href="classripple_1_1LedgerHolder.html">LedgerHolder</a> &gt;::getCounter </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">private</span><span class="mlabel">noexcept</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="CountedObject_8h_source.html#l00128">128</a> of file <a class="el" href="CountedObject_8h_source.html">CountedObject.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a8ecb79804c3e902dd324cbb1cd6b0a7b" name="a8ecb79804c3e902dd324cbb1cd6b0a7b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ecb79804c3e902dd324cbb1cd6b0a7b">&#9670;&#160;</a></span>m_lock</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" href="http://en.cppreference.com/w/cpp/thread/mutex.html">std::mutex</a> ripple::LedgerHolder::m_lock</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="LedgerHolder_8h_source.html#l00070">70</a> of file <a class="el" href="LedgerHolder_8h_source.html">LedgerHolder.h</a>.</p>
</div>
</div>
<a id="ad1b0d556cfdf69766990a195a745ae50" name="ad1b0d556cfdf69766990a195a745ae50"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad1b0d556cfdf69766990a195a745ae50">&#9670;&#160;</a></span>m_heldLedger</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a>&lt;<a class="el" href="classripple_1_1Ledger.html">Ledger</a> const&gt; ripple::LedgerHolder::m_heldLedger</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="LedgerHolder_8h_source.html#l00071">71</a> of file <a class="el" href="LedgerHolder_8h_source.html">LedgerHolder.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>