1#include <xrpl/shamap/SHAMapLeafNode.h>
10 "xrpl::SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr<"
11 "SHAMapItem const>, std::uint32_t) : minimum input size");
19 "xrpl::SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr<"
20 "SHAMapItem const>, std::uint32_t, SHAMapHash const&) : minimum input "
24boost::intrusive_ptr<SHAMapItem const>
const&
33 XRPL_ASSERT(
cowid_,
"xrpl::SHAMapLeafNode::setItem : nonzero cowid");
34 item_ = std::move(item);
36 auto const oldHash =
hash_;
40 return (oldHash !=
hash_);
71 XRPL_ASSERT(
hash_.
isNonZero(),
"xrpl::SHAMapLeafNode::invariants : nonzero hash");
72 XRPL_ASSERT(
item_,
"xrpl::SHAMapLeafNode::invariants : non-null item");
boost::intrusive_ptr< SHAMapItem const > item_
void invariants(bool is_root=false) const final override
SHAMapLeafNode(boost::intrusive_ptr< SHAMapItem const > item, std::uint32_t cowid)
bool setItem(boost::intrusive_ptr< SHAMapItem const > i)
Set the item that this node points to and update the node's hash.
boost::intrusive_ptr< SHAMapItem const > const & peekItem() const
std::string getString(SHAMapNodeID const &) const final override
Identifies a node inside a SHAMap.
std::uint32_t cowid_
Determines the owning SHAMap, if any.
virtual SHAMapNodeType getType() const =0
Determines the type of node.
virtual std::string getString(SHAMapNodeID const &) const
virtual void updateHash()=0
Recalculate the hash of this node.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::string to_string(base_uint< Bits, Tag > const &a)