mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
119 lines
5.5 KiB
HTML
119 lines
5.5 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: Basics</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&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&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><!-- top -->
|
|
<div class="PageDoc"><div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">Basics </div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><p>Utility functions and classes.</p>
|
|
<p>ripple/basic should contain no dependencies on other modules.</p>
|
|
<h1><a class="anchor" id="autotoc_md151"></a>
|
|
Choosing a rippled container.</h1>
|
|
<ul>
|
|
<li><code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/vector.html" title="STL class.">std::vector</a></code><ul>
|
|
<li>For ordered containers with most insertions or erases at the end.</li>
|
|
</ul>
|
|
</li>
|
|
<li><code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/deque.html" title="STL class.">std::deque</a></code><ul>
|
|
<li>For ordered containers with most insertions or erases at the start or end.</li>
|
|
</ul>
|
|
</li>
|
|
<li><code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/list.html" title="STL class.">std::list</a></code><ul>
|
|
<li>For ordered containers with inserts and erases to the middle.</li>
|
|
<li>For containers with iterators stable over insert and erase.</li>
|
|
<li>Generally slower and bigger than <code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/vector.html" title="STL class.">std::vector</a></code> or <code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/deque.html" title="STL class.">std::deque</a></code> except for those cases.</li>
|
|
</ul>
|
|
</li>
|
|
<li><code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/set.html" title="STL class.">std::set</a></code><ul>
|
|
<li>For sorted containers.</li>
|
|
</ul>
|
|
</li>
|
|
<li><code><a class="el" href="namespaceripple.html#a7750eec5e079354285f1d60cfd0247ca">ripple::hash_set</a></code><ul>
|
|
<li>Where inserts and contains need to be O(1).</li>
|
|
<li>For "small" sets, <code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/set.html" title="STL class.">std::set</a></code> might be faster and smaller.</li>
|
|
</ul>
|
|
</li>
|
|
<li><code><a class="el" href="namespaceripple.html#a3fd083ce42b38018aa59306a4660a52e">ripple::hardened_hash_set</a></code><ul>
|
|
<li>For data sets where the key could be manipulated by an attacker in an attempt to mount an algorithmic complexity attack: see <a href="http://en.wikipedia.org/wiki/Algorithmic_complexity_attack">http://en.wikipedia.org/wiki/Algorithmic_complexity_attack</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<p>The following container is deprecated</p>
|
|
<ul>
|
|
<li><code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/unordered_set.html" title="STL class.">std::unordered_set</a></code><ul>
|
|
<li>Use <code><a class="el" href="namespaceripple.html#a7750eec5e079354285f1d60cfd0247ca">ripple::hash_set</a></code> instead, which uses a better hashing algorithm.</li>
|
|
<li>Or use <code><a class="el" href="namespaceripple.html#a3fd083ce42b38018aa59306a4660a52e">ripple::hardened_hash_set</a></code> to prevent algorithmic complexity attacks. </li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div></div><!-- contents -->
|
|
</div><!-- PageDoc -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.17
|
|
</small></address>
|
|
</body>
|
|
</html>
|