rippled
Loading...
Searching...
No Matches
SHAMapLeafNode.h
1#pragma once
2
3#include <xrpl/shamap/SHAMapItem.h>
4#include <xrpl/shamap/SHAMapTreeNode.h>
5
6#include <cstdint>
7
8namespace xrpl {
9
11{
12protected:
13 boost::intrusive_ptr<SHAMapItem const> item_;
14
15 SHAMapLeafNode(boost::intrusive_ptr<SHAMapItem const> item, std::uint32_t cowid);
16
18 boost::intrusive_ptr<SHAMapItem const> item,
20 SHAMapHash const& hash);
21
22public:
25 operator=(SHAMapLeafNode const&) = delete;
26
27 bool
28 isLeaf() const final override
29 {
30 return true;
31 }
32
33 bool
34 isInner() const final override
35 {
36 return false;
37 }
38
39 void
40 invariants(bool is_root = false) const final override;
41
42public:
43 boost::intrusive_ptr<SHAMapItem const> const&
44 peekItem() const;
45
52 bool
53 setItem(boost::intrusive_ptr<SHAMapItem const> i);
54
55 std::string
56 getString(SHAMapNodeID const&) const final override;
57};
58
59} // namespace xrpl
boost::intrusive_ptr< SHAMapItem const > item_
void invariants(bool is_root=false) const final override
bool isLeaf() const final override
Determines if this is a leaf node.
SHAMapLeafNode(SHAMapLeafNode const &)=delete
bool setItem(boost::intrusive_ptr< SHAMapItem const > i)
Set the item that this node points to and update the node's hash.
SHAMapLeafNode & operator=(SHAMapLeafNode const &)=delete
boost::intrusive_ptr< SHAMapItem const > const & peekItem() const
std::string getString(SHAMapNodeID const &) const final override
bool isInner() const final override
Determines if this is an inner node.
Identifies a node inside a SHAMap.
std::uint32_t cowid() const
Returns the SHAMap that owns this node.
STL namespace.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5