1#ifndef XRPL_SHAMAP_SHAMAPINNERNODE_H_INCLUDED 
    2#define XRPL_SHAMAP_SHAMAPINNERNODE_H_INCLUDED 
    4#include <xrpl/basics/IntrusivePointer.h> 
    5#include <xrpl/shamap/SHAMapNodeID.h> 
    6#include <xrpl/shamap/detail/TaggedPointer.h> 
  166    invariants(
bool is_root = 
false) 
const override;
 
 
Tracks the number of instances of an object.
 
std::uint32_t fullBelowGen_
 
bool isInner() const override
Determines if this is an inner node.
 
std::optional< int > getChildIndex(int i) const
Get the child's index inside the hashes or children array (stored in hashesAndChildren_.
 
void setChild(int m, intr_ptr::SharedPtr< SHAMapTreeNode > child)
 
static intr_ptr::SharedPtr< SHAMapTreeNode > makeCompressedInner(Slice data)
 
intr_ptr::SharedPtr< SHAMapTreeNode > clone(std::uint32_t cowid) const override
Make a copy of this node, setting the owner.
 
static constexpr unsigned int branchFactor
Each inner node has 16 children (the 'radix tree' part of the map)
 
bool isFullBelow(std::uint32_t generation) const
 
bool isEmptyBranch(int m) const
 
void iterNonEmptyChildIndexes(F &&f) const
Call the f callback for all non-empty branches.
 
void serializeWithPrefix(Serializer &) const override
Serialize the node in a format appropriate for hashing.
 
void iterChildren(F &&f) const
Call the f callback for all 16 (branchFactor) branches - even if the branch is empty.
 
void resizeChildArrays(std::uint8_t toAllocate)
Convert arrays stored in hashesAndChildren_ so they can store the requested number of children.
 
bool isLeaf() const override
Determines if this is a leaf node.
 
void updateHash() override
Recalculate the hash of this node.
 
intr_ptr::SharedPtr< SHAMapTreeNode > getChild(int branch)
 
void partialDestructor() override
 
void shareChild(int m, intr_ptr::SharedPtr< SHAMapTreeNode > const &child)
 
SHAMapHash const & getChildHash(int m) const
 
void invariants(bool is_root=false) const override
 
std::string getString(SHAMapNodeID const &) const override
 
intr_ptr::SharedPtr< SHAMapTreeNode > canonicalizeChild(int branch, intr_ptr::SharedPtr< SHAMapTreeNode > node)
 
SHAMapInnerNode & operator=(SHAMapInnerNode const &)=delete
 
SHAMapInnerNode(SHAMapInnerNode const &)=delete
 
TaggedPointer hashesAndChildren_
Opaque type that contains the hashes array (array of type SHAMapHash) and the children array (array o...
 
void setFullBelowGen(std::uint32_t gen)
 
void serializeForWire(Serializer &) const override
Serialize the node in a format appropriate for sending over the wire.
 
SHAMapNodeType getType() const override
Determines the type of node.
 
void updateHashDeep()
Recalculate the hash of all children and this node.
 
int getBranchCount() const
 
SHAMapTreeNode * getChildPointer(int branch)
 
std::atomic< std::uint16_t > lock_
A bitlock for the children of this node, with one bit per child.
 
static intr_ptr::SharedPtr< SHAMapTreeNode > makeFullInner(Slice data, SHAMapHash const &hash, bool hashValid)
 
Identifies a node inside a SHAMap.
 
A shared intrusive pointer class that supports weak pointers.
 
An immutable linear range of bytes.
 
TaggedPointer is a combination of a pointer and a mask stored in the lowest two bits.
 
std::uint32_t cowid() const
Returns the SHAMap that owns this node.
 
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
 
int popcnt16(std::uint16_t a)