rippled
|
Public Member Functions | |
virtual | ~SHAMapTreeNode () noexcept=default |
std::uint32_t | cowid () const |
Returns the SHAMap that owns this node. More... | |
void | unshare () |
If this node is shared with another map, mark it as no longer shared. More... | |
virtual std::shared_ptr< SHAMapTreeNode > | clone (std::uint32_t cowid) const =0 |
Make a copy of this node, setting the owner. More... | |
virtual void | updateHash ()=0 |
Recalculate the hash of this node. More... | |
SHAMapHash const & | getHash () const |
Return the hash of this node. More... | |
virtual SHAMapNodeType | getType () const =0 |
Determines the type of node. More... | |
virtual bool | isLeaf () const =0 |
Determines if this is a leaf node. More... | |
virtual bool | isInner () const =0 |
Determines if this is an inner node. More... | |
virtual void | serializeForWire (Serializer &) const =0 |
Serialize the node in a format appropriate for sending over the wire. More... | |
virtual void | serializeWithPrefix (Serializer &) const =0 |
Serialize the node in a format appropriate for hashing. More... | |
virtual std::string | getString (SHAMapNodeID const &) const |
virtual void | invariants (bool is_root=false) const =0 |
Static Public Member Functions | |
static std::shared_ptr< SHAMapTreeNode > | makeFromPrefix (Slice rawNode, SHAMapHash const &hash) |
static std::shared_ptr< SHAMapTreeNode > | makeFromWire (Slice rawNode) |
Protected Member Functions | |
SHAMapTreeNode (SHAMapTreeNode const &)=delete | |
SHAMapTreeNode & | operator= (SHAMapTreeNode const &)=delete |
SHAMapTreeNode (std::uint32_t cowid) noexcept | |
Construct a node. More... | |
SHAMapTreeNode (std::uint32_t cowid, SHAMapHash const &hash) noexcept | |
Protected Attributes | |
SHAMapHash | hash_ |
std::uint32_t | cowid_ |
Determines the owning SHAMap, if any. More... | |
Static Private Member Functions | |
static std::shared_ptr< SHAMapTreeNode > | makeTransaction (Slice data, SHAMapHash const &hash, bool hashValid) |
static std::shared_ptr< SHAMapTreeNode > | makeAccountState (Slice data, SHAMapHash const &hash, bool hashValid) |
static std::shared_ptr< SHAMapTreeNode > | makeTransactionWithMeta (Slice data, SHAMapHash const &hash, bool hashValid) |
Definition at line 53 of file SHAMapTreeNode.h.
|
protecteddelete |
|
explicitprotectednoexcept |
Construct a node.
cowid | The identifier of a SHAMap. For more, see cowid_ |
hash | The hash associated with this node, if any. |
Definition at line 77 of file SHAMapTreeNode.h.
|
explicitprotectednoexcept |
Definition at line 81 of file SHAMapTreeNode.h.
|
virtualdefaultnoexcept |
|
protecteddelete |
|
pure virtual |
Recalculate the hash of this node.
Implemented in ripple::SHAMapInnerNode, ripple::SHAMapAccountStateLeafNode, ripple::SHAMapTxPlusMetaLeafNode, and ripple::SHAMapTxLeafNode.
SHAMapHash const& ripple::SHAMapTreeNode::getHash | ( | ) | const |
Return the hash of this node.
Definition at line 143 of file SHAMapTreeNode.h.
|
pure virtual |
Determines the type of node.
Implemented in ripple::SHAMapInnerNode, ripple::SHAMapTxPlusMetaLeafNode, ripple::SHAMapAccountStateLeafNode, and ripple::SHAMapTxLeafNode.
|
pure virtual |
Determines if this is a leaf node.
Implemented in ripple::SHAMapInnerNode, and ripple::SHAMapLeafNode.
|
pure virtual |
Determines if this is an inner node.
Implemented in ripple::SHAMapInnerNode, and ripple::SHAMapLeafNode.
|
pure virtual |
Serialize the node in a format appropriate for sending over the wire.
Implemented in ripple::SHAMapAccountStateLeafNode, ripple::SHAMapTxPlusMetaLeafNode, ripple::SHAMapTxLeafNode, and ripple::SHAMapInnerNode.
|
pure virtual |
Serialize the node in a format appropriate for hashing.
Implemented in ripple::SHAMapAccountStateLeafNode, ripple::SHAMapTxPlusMetaLeafNode, ripple::SHAMapTxLeafNode, and ripple::SHAMapInnerNode.
|
virtual |
Reimplemented in ripple::SHAMapInnerNode, and ripple::SHAMapLeafNode.
Definition at line 184 of file SHAMapTreeNode.cpp.
|
pure virtual |
Implemented in ripple::SHAMapInnerNode, and ripple::SHAMapLeafNode.
|
static |
Definition at line 148 of file SHAMapTreeNode.cpp.
|
static |
Definition at line 116 of file SHAMapTreeNode.cpp.
|
staticprivate |
Definition at line 40 of file SHAMapTreeNode.cpp.
|
staticprivate |
Definition at line 84 of file SHAMapTreeNode.cpp.
|
staticprivate |
Definition at line 55 of file SHAMapTreeNode.cpp.
|
protected |
Definition at line 56 of file SHAMapTreeNode.h.
|
protected |
Determines the owning SHAMap, if any.
Used for copy-on-write semantics.
If this value is 0, the node is not dirty and does not need to be flushed. It is eligible for sharing and may be included multiple SHAMap instances.
Definition at line 64 of file SHAMapTreeNode.h.