Files
rippled/classripple_1_1NetworkValidatedLedgers.html
2021-12-17 19:04:33 +00:00

354 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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rippled: ripple::NetworkValidatedLedgers Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div 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_1NetworkValidatedLedgers.html">NetworkValidatedLedgers</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classripple_1_1NetworkValidatedLedgers-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">ripple::NetworkValidatedLedgers Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>This datastructure is used to keep track of the sequence of the most recent ledger validated by the network.
<a href="classripple_1_1NetworkValidatedLedgers.html#details">More...</a></p>
<div class="dynheader">
Collaboration diagram for ripple::NetworkValidatedLedgers:</div>
<div class="dyncontent">
<div class="center"><img src="classripple_1_1NetworkValidatedLedgers__coll__graph.png" border="0" usemap="#ripple_1_1NetworkValidatedLedgers_coll__map" alt="Collaboration graph"/></div>
<map name="ripple_1_1NetworkValidatedLedgers_coll__map" id="ripple_1_1NetworkValidatedLedgers_coll__map">
<area shape="rect" title="This datastructure is used to keep track of the sequence of the most recent ledger validated by the n..." alt="" coords="202,95,385,136"/>
<area shape="rect" href="http://en.cppreference.com/w/cpp/thread/condition_variable.html" title=" " alt="" coords="5,5,176,32"/>
<area shape="rect" href="http://en.cppreference.com/w/cpp/utility/optional.html" title=" " alt="" coords="200,5,387,32"/>
<area shape="rect" href="http://en.cppreference.com/w/cpp/thread/mutex.html" title="STL class." alt="" coords="411,5,503,32"/>
</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 name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:abe15bf08a473b19240bec14ca04733be"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1NetworkValidatedLedgers.html#abe15bf08a473b19240bec14ca04733be">push</a> (uint32_t idx)</td></tr>
<tr class="memdesc:abe15bf08a473b19240bec14ca04733be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Notify the datastructure that idx has been validated by the network. <a href="classripple_1_1NetworkValidatedLedgers.html#abe15bf08a473b19240bec14ca04733be">More...</a><br /></td></tr>
<tr class="separator:abe15bf08a473b19240bec14ca04733be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae43bbc96bf99fd723a14627c67d8ec6b"><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a>&lt; uint32_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1NetworkValidatedLedgers.html#ae43bbc96bf99fd723a14627c67d8ec6b">getMostRecent</a> () const</td></tr>
<tr class="memdesc:ae43bbc96bf99fd723a14627c67d8ec6b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get most recently validated sequence. <a href="classripple_1_1NetworkValidatedLedgers.html#ae43bbc96bf99fd723a14627c67d8ec6b">More...</a><br /></td></tr>
<tr class="separator:ae43bbc96bf99fd723a14627c67d8ec6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c3eaeed333efcaeb7dcb193aed71c73"><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a>&lt; uint32_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1NetworkValidatedLedgers.html#a0c3eaeed333efcaeb7dcb193aed71c73">tryGetMostRecent</a> () const</td></tr>
<tr class="memdesc:a0c3eaeed333efcaeb7dcb193aed71c73"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get most recently validated sequence. <a href="classripple_1_1NetworkValidatedLedgers.html#a0c3eaeed333efcaeb7dcb193aed71c73">More...</a><br /></td></tr>
<tr class="separator:a0c3eaeed333efcaeb7dcb193aed71c73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d66290bf2455b1a4841a48d65941dc0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1NetworkValidatedLedgers.html#a9d66290bf2455b1a4841a48d65941dc0">waitUntilValidatedByNetwork</a> (uint32_t sequence)</td></tr>
<tr class="memdesc:a9d66290bf2455b1a4841a48d65941dc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits for the sequence to be validated by the network. <a href="classripple_1_1NetworkValidatedLedgers.html#a9d66290bf2455b1a4841a48d65941dc0">More...</a><br /></td></tr>
<tr class="separator:a9d66290bf2455b1a4841a48d65941dc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0bf84fe65c8346735831b368de59c49d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1NetworkValidatedLedgers.html#a0bf84fe65c8346735831b368de59c49d">stop</a> ()</td></tr>
<tr class="memdesc:a0bf84fe65c8346735831b368de59c49d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Puts the datastructure in the stopped state Future calls to this datastructure will not block This operation cannot be reversed. <a href="classripple_1_1NetworkValidatedLedgers.html#a0bf84fe65c8346735831b368de59c49d">More...</a><br /></td></tr>
<tr class="separator:a0bf84fe65c8346735831b368de59c49d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a11905def4cc9fe3bcc8e536883822ffc"><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a>&lt; uint32_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1NetworkValidatedLedgers.html#a11905def4cc9fe3bcc8e536883822ffc">max_</a></td></tr>
<tr class="separator:a11905def4cc9fe3bcc8e536883822ffc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bcf72d742ececff2e24b30803f81d06"><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_1NetworkValidatedLedgers.html#a8bcf72d742ececff2e24b30803f81d06">m_</a></td></tr>
<tr class="separator:a8bcf72d742ececff2e24b30803f81d06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade49aaf017e5ba618d19839647640b47"><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="http://en.cppreference.com/w/cpp/thread/condition_variable.html">std::condition_variable</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1NetworkValidatedLedgers.html#ade49aaf017e5ba618d19839647640b47">cv_</a></td></tr>
<tr class="separator:ade49aaf017e5ba618d19839647640b47"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae43515be8207571c2f9460e38cea3bcf"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1NetworkValidatedLedgers.html#ae43515be8207571c2f9460e38cea3bcf">stopping_</a> = false</td></tr>
<tr class="separator:ae43515be8207571c2f9460e38cea3bcf"><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>This datastructure is used to keep track of the sequence of the most recent ledger validated by the network. </p>
<p>There are two methods that will wait until certain conditions are met. This datastructure is able to be "stopped". When the datastructure is stopped, any threads currently waiting are unblocked. Any later calls to methods of this datastructure will not wait. Once the datastructure is stopped, the datastructure remains stopped for the rest of its lifetime. </p>
<p class="definition">Definition at line <a class="el" href="ETLHelpers_8h_source.html#l00039">39</a> of file <a class="el" href="ETLHelpers_8h_source.html">ETLHelpers.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="abe15bf08a473b19240bec14ca04733be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe15bf08a473b19240bec14ca04733be">&#9670;&nbsp;</a></span>push()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ripple::NetworkValidatedLedgers::push </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>idx</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Notify the datastructure that idx has been validated by the network. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">idx</td><td>sequence validated by network </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="ETLHelpers_8h_source.html#l00054">54</a> of file <a class="el" href="ETLHelpers_8h_source.html">ETLHelpers.h</a>.</p>
</div>
</div>
<a id="ae43bbc96bf99fd723a14627c67d8ec6b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae43bbc96bf99fd723a14627c67d8ec6b">&#9670;&nbsp;</a></span>getMostRecent()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a>&lt;uint32_t&gt; ripple::NetworkValidatedLedgers::getMostRecent </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get most recently validated sequence. </p>
<p>If no ledgers are known to have been validated, this function waits until the next ledger is validated </p><dl class="section return"><dt>Returns</dt><dd>sequence of most recently validated ledger. empty optional if the datastructure has been stopped </dd></dl>
<p class="definition">Definition at line <a class="el" href="ETLHelpers_8h_source.html#l00067">67</a> of file <a class="el" href="ETLHelpers_8h_source.html">ETLHelpers.h</a>.</p>
</div>
</div>
<a id="a0c3eaeed333efcaeb7dcb193aed71c73"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c3eaeed333efcaeb7dcb193aed71c73">&#9670;&nbsp;</a></span>tryGetMostRecent()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a>&lt;uint32_t&gt; ripple::NetworkValidatedLedgers::tryGetMostRecent </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get most recently validated sequence. </p>
<dl class="section return"><dt>Returns</dt><dd>sequence of most recently validated ledger, or empty optional if no ledgers are known to have been validated. </dd></dl>
<p class="definition">Definition at line <a class="el" href="ETLHelpers_8h_source.html#l00078">78</a> of file <a class="el" href="ETLHelpers_8h_source.html">ETLHelpers.h</a>.</p>
</div>
</div>
<a id="a9d66290bf2455b1a4841a48d65941dc0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d66290bf2455b1a4841a48d65941dc0">&#9670;&nbsp;</a></span>waitUntilValidatedByNetwork()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ripple::NetworkValidatedLedgers::waitUntilValidatedByNetwork </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>sequence</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Waits for the sequence to be validated by the network. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">sequence</td><td>to wait for </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if sequence was validated, false otherwise a return value of false means the datastructure has been stopped </dd></dl>
<p class="definition">Definition at line <a class="el" href="ETLHelpers_8h_source.html#l00089">89</a> of file <a class="el" href="ETLHelpers_8h_source.html">ETLHelpers.h</a>.</p>
</div>
</div>
<a id="a0bf84fe65c8346735831b368de59c49d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0bf84fe65c8346735831b368de59c49d">&#9670;&nbsp;</a></span>stop()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ripple::NetworkValidatedLedgers::stop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Puts the datastructure in the stopped state Future calls to this datastructure will not block This operation cannot be reversed. </p>
<p class="definition">Definition at line <a class="el" href="ETLHelpers_8h_source.html#l00102">102</a> of file <a class="el" href="ETLHelpers_8h_source.html">ETLHelpers.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a11905def4cc9fe3bcc8e536883822ffc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a11905def4cc9fe3bcc8e536883822ffc">&#9670;&nbsp;</a></span>max_</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/utility/optional.html">std::optional</a>&lt;uint32_t&gt; ripple::NetworkValidatedLedgers::max_</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="ETLHelpers_8h_source.html#l00042">42</a> of file <a class="el" href="ETLHelpers_8h_source.html">ETLHelpers.h</a>.</p>
</div>
</div>
<a id="a8bcf72d742ececff2e24b30803f81d06"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8bcf72d742ececff2e24b30803f81d06">&#9670;&nbsp;</a></span>m_</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::NetworkValidatedLedgers::m_</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">mutable</span><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="ETLHelpers_8h_source.html#l00044">44</a> of file <a class="el" href="ETLHelpers_8h_source.html">ETLHelpers.h</a>.</p>
</div>
</div>
<a id="ade49aaf017e5ba618d19839647640b47"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade49aaf017e5ba618d19839647640b47">&#9670;&nbsp;</a></span>cv_</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/condition_variable.html">std::condition_variable</a> ripple::NetworkValidatedLedgers::cv_</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">mutable</span><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="ETLHelpers_8h_source.html#l00046">46</a> of file <a class="el" href="ETLHelpers_8h_source.html">ETLHelpers.h</a>.</p>
</div>
</div>
<a id="ae43515be8207571c2f9460e38cea3bcf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae43515be8207571c2f9460e38cea3bcf">&#9670;&nbsp;</a></span>stopping_</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ripple::NetworkValidatedLedgers::stopping_ = false</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="ETLHelpers_8h_source.html#l00048">48</a> of file <a class="el" href="ETLHelpers_8h_source.html">ETLHelpers.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>