1#include <xrpl/shamap/SHAMapLeafNode.h>
10 "xrpl::SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr<"
11 "SHAMapItem const>, std::uint32_t) : minimum input size");
15 boost::intrusive_ptr<SHAMapItem const> item,
22 "xrpl::SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr<"
23 "SHAMapItem const>, std::uint32_t, SHAMapHash const&) : minimum input "
27boost::intrusive_ptr<SHAMapItem const>
const&
36 XRPL_ASSERT(
cowid_,
"xrpl::SHAMapLeafNode::setItem : nonzero cowid");
37 item_ = std::move(item);
39 auto const oldHash =
hash_;
43 return (oldHash !=
hash_);
74 XRPL_ASSERT(
hash_.
isNonZero(),
"xrpl::SHAMapLeafNode::invariants : nonzero hash");
75 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)