xrpld
Loading...
Searching...
No Matches
xrpl::SHAMapNodeID Class Reference

Identifies a node inside a SHAMap. More...

#include <SHAMapNodeID.h>

Inheritance diagram for xrpl::SHAMapNodeID:
Collaboration diagram for xrpl::SHAMapNodeID:

Public Member Functions

 SHAMapNodeID ()=default
 SHAMapNodeID (SHAMapNodeID const &other)=default
 SHAMapNodeID (unsigned int depth, uint256 const &hash)
SHAMapNodeIDoperator= (SHAMapNodeID const &other)=default
bool isRoot () const
std::string getRawString () const
unsigned int getDepth () const
uint256 const & getNodeID () const
SHAMapNodeID getChildNodeID (unsigned int m) const
bool operator< (SHAMapNodeID const &n) const
 Comparison operators.
bool operator> (SHAMapNodeID const &n) const
bool operator<= (SHAMapNodeID const &n) const
bool operator>= (SHAMapNodeID const &n) const
bool operator== (SHAMapNodeID const &n) const
bool operator!= (SHAMapNodeID const &n) const

Static Public Member Functions

static SHAMapNodeID createID (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

Detailed Description

Identifies a node inside a SHAMap.

Definition at line 14 of file SHAMapNodeID.h.

Constructor & Destructor Documentation

◆ SHAMapNodeID() [1/3]

xrpl::SHAMapNodeID::SHAMapNodeID ( )
default

◆ SHAMapNodeID() [2/3]

xrpl::SHAMapNodeID::SHAMapNodeID ( SHAMapNodeID const & other)
default

◆ SHAMapNodeID() [3/3]

xrpl::SHAMapNodeID::SHAMapNodeID ( unsigned int depth,
uint256 const & hash )

Definition at line 44 of file SHAMapNodeID.cpp.

Member Function Documentation

◆ operator=()

SHAMapNodeID & xrpl::SHAMapNodeID::operator= ( SHAMapNodeID const & other)
default

◆ isRoot()

bool xrpl::SHAMapNodeID::isRoot ( ) const
nodiscard

Definition at line 29 of file SHAMapNodeID.h.

◆ getRawString()

std::string xrpl::SHAMapNodeID::getRawString ( ) const
nodiscard

Definition at line 54 of file SHAMapNodeID.cpp.

◆ getDepth()

unsigned int xrpl::SHAMapNodeID::getDepth ( ) const
nodiscard

Definition at line 39 of file SHAMapNodeID.h.

◆ getNodeID()

uint256 const & xrpl::SHAMapNodeID::getNodeID ( ) const
nodiscard

Definition at line 45 of file SHAMapNodeID.h.

◆ getChildNodeID()

SHAMapNodeID xrpl::SHAMapNodeID::getChildNodeID ( unsigned int m) const
nodiscard

Definition at line 63 of file SHAMapNodeID.cpp.

◆ createID()

SHAMapNodeID xrpl::SHAMapNodeID::createID ( int depth,
uint256 const & key )
static

Create a SHAMapNodeID of a node with the depth of the node and the key of a leaf.

Parameters
depththe depth of the node
keythe key of a leaf
Returns
SHAMapNodeID of the node

Definition at line 130 of file SHAMapNodeID.cpp.

◆ operator<()

bool xrpl::SHAMapNodeID::operator< ( SHAMapNodeID const & n) const

Comparison operators.

Definition at line 66 of file SHAMapNodeID.h.

◆ operator>()

bool xrpl::SHAMapNodeID::operator> ( SHAMapNodeID const & n) const

Definition at line 73 of file SHAMapNodeID.h.

◆ operator<=()

bool xrpl::SHAMapNodeID::operator<= ( SHAMapNodeID const & n) const

Definition at line 78 of file SHAMapNodeID.h.

◆ operator>=()

bool xrpl::SHAMapNodeID::operator>= ( SHAMapNodeID const & n) const

Definition at line 85 of file SHAMapNodeID.h.

◆ operator==()

bool xrpl::SHAMapNodeID::operator== ( SHAMapNodeID const & n) const

Definition at line 91 of file SHAMapNodeID.h.

◆ operator!=()

bool xrpl::SHAMapNodeID::operator!= ( SHAMapNodeID const & n) const

Definition at line 97 of file SHAMapNodeID.h.

◆ getCounter()

auto & xrpl::CountedObject< SHAMapNodeID >::getCounter ( )
staticprivatenoexceptinherited

Definition at line 109 of file CountedObject.h.

Member Data Documentation

◆ id_

uint256 xrpl::SHAMapNodeID::id_
private

Definition at line 17 of file SHAMapNodeID.h.

◆ depth_

unsigned int xrpl::SHAMapNodeID::depth_ = 0
private

Definition at line 18 of file SHAMapNodeID.h.

◆ Object

Definition at line 134 of file CountedObject.h.