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
17 SHAMapLeafNode(boost::intrusive_ptr<SHAMapItem const> item, std::uint32_t cowid, SHAMapHash const& hash);
18
19public:
22 operator=(SHAMapLeafNode const&) = delete;
23
24 bool
25 isLeaf() const final override
26 {
27 return true;
28 }
29
30 bool
31 isInner() const final override
32 {
33 return false;
34 }
35
36 void
37 invariants(bool is_root = false) const final override;
38
39public:
40 boost::intrusive_ptr<SHAMapItem const> const&
41 peekItem() const;
42
49 bool
50 setItem(boost::intrusive_ptr<SHAMapItem const> i);
51
52 std::string
53 getString(SHAMapNodeID const&) const final override;
54};
55
56} // 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