20#include <xrpld/shamap/SHAMapLeafNode.h>
25 boost::intrusive_ptr<SHAMapItem const> item,
31 "ripple::SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr<"
32 "SHAMapItem const>, std::uint32_t) : minimum input size");
36 boost::intrusive_ptr<SHAMapItem const> item,
43 "ripple::SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr<"
44 "SHAMapItem const>, std::uint32_t, SHAMapHash const&) : minimum input "
48boost::intrusive_ptr<SHAMapItem const>
const&
57 XRPL_ASSERT(
cowid_,
"ripple::SHAMapLeafNode::setItem : nonzero cowid");
58 item_ = std::move(item);
60 auto const oldHash =
hash_;
64 return (oldHash !=
hash_);
96 hash_.
isNonZero(),
"ripple::SHAMapLeafNode::invariants : nonzero hash");
97 XRPL_ASSERT(
item_,
"ripple::SHAMapLeafNode::invariants : non-null item");
std::string getString(SHAMapNodeID const &) const final override
boost::intrusive_ptr< SHAMapItem const > item_
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.
void invariants(bool is_root=false) const final override
boost::intrusive_ptr< SHAMapItem const > const & peekItem() const
Identifies a node inside a SHAMap.
virtual std::string getString(SHAMapNodeID const &) const
virtual void updateHash()=0
Recalculate the hash of this node.
std::uint32_t cowid_
Determines the owning SHAMap, if any.
virtual SHAMapNodeType getType() const =0
Determines the type of 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)