|
xrpld
|
Identifies a node inside a SHAMap. More...
#include <SHAMapNodeID.h>


Public Member Functions | |
| SHAMapNodeID ()=default | |
| SHAMapNodeID (SHAMapNodeID const &other)=default | |
| SHAMapNodeID (unsigned int depth, UInt256 const &hash) | |
| SHAMapNodeID & | operator= (SHAMapNodeID const &other)=default |
| bool | isRoot () const |
| std::string | getRawString () const |
| unsigned int | getDepth () const |
| UInt256 const & | getNodeID () const |
| SHAMapNodeID | getChildNodeID (unsigned int branch) const |
| bool | isPrefixOf (UInt256 const &key) const |
| Test whether this node ID lies on the path to the given leaf key. | |
| std::strong_ordering | operator<=> (SHAMapNodeID const &n) const |
| Comparison operators. | |
| bool | operator== (SHAMapNodeID const &n) const |
| Equality, which the spaceship above does not provide. | |
Static Public Member Functions | |
| static SHAMapNodeID | createID (unsigned int depth, UInt256 const &key) |
| Create a SHAMapNodeID of a node with the depth of the node and the key of a leaf. | |
Public Attributes | |
| friend | Object |
Static Private Member Functions | |
| static auto & | getCounter () noexcept |
Private Attributes | |
| UInt256 | id_ |
| unsigned int | depth_ = 0 |
Identifies a node inside a SHAMap.
Definition at line 19 of file SHAMapNodeID.h.
|
default |
|
default |
| xrpl::SHAMapNodeID::SHAMapNodeID | ( | unsigned int | depth, |
| UInt256 const & | hash ) |
Definition at line 62 of file libxrpl/shamap/SHAMapNodeID.cpp.
|
default |
|
nodiscard |
Definition at line 34 of file SHAMapNodeID.h.
|
nodiscard |
Definition at line 85 of file libxrpl/shamap/SHAMapNodeID.cpp.
|
nodiscard |
Definition at line 44 of file SHAMapNodeID.h.
|
nodiscard |
Definition at line 50 of file SHAMapNodeID.h.
|
nodiscard |
Definition at line 94 of file libxrpl/shamap/SHAMapNodeID.cpp.
|
nodiscard |
Test whether this node ID lies on the path to the given leaf key.
A node at depth d identifies the tree path spelled by the first d nibbles of its key, so any leaf beneath it must agree on that prefix. A node ID that fails this test names a different subtree than the one it was built for.
| key | the key of a leaf below this node |
Definition at line 122 of file libxrpl/shamap/SHAMapNodeID.cpp.
|
static |
Create a SHAMapNodeID of a node with the depth of the node and the key of a leaf.
| depth | the depth of the node |
| key | the key of a leaf |
Definition at line 171 of file libxrpl/shamap/SHAMapNodeID.cpp.
| std::strong_ordering xrpl::SHAMapNodeID::operator<=> | ( | SHAMapNodeID const & | n | ) | const |
Comparison operators.
<, >, <= and >= are synthesized from the spaceship. It is written out rather than defaulted because the ordering is by depth first, and the members are not declared in that order.
Definition at line 90 of file SHAMapNodeID.h.
| bool xrpl::SHAMapNodeID::operator== | ( | SHAMapNodeID const & | n | ) | const |
Equality, which the spaceship above does not provide.
Only a defaulted operator<=> implicitly declares a defaulted operator==; the one above is user-provided, so == has to be written. It cannot be defaulted either, because a defaulted == would also compare the CountedObject base, which is not equality comparable.
Definition at line 105 of file SHAMapNodeID.h.
|
staticprivatenoexceptinherited |
Definition at line 113 of file CountedObject.h.
|
private |
Definition at line 22 of file SHAMapNodeID.h.
|
private |
Definition at line 23 of file SHAMapNodeID.h.
|
inherited |
Definition at line 138 of file CountedObject.h.