20 #ifndef RIPPLE_SHAMAP_SHAMAPINNERNODE_H_INCLUDED
21 #define RIPPLE_SHAMAP_SHAMAPINNERNODE_H_INCLUDED
23 #include <ripple/basics/TaggedCache.h>
24 #include <ripple/beast/utility/Journal.h>
25 #include <ripple/shamap/SHAMapItem.h>
26 #include <ripple/shamap/SHAMapNodeID.h>
27 #include <ripple/shamap/SHAMapTreeNode.h>
115 invariants(
bool is_root =
false)
const override;
138 assert(m >= 0 && m < 16);
std::uint32_t cowid() const
Returns the SHAMap that owns this node.
void serializeWithPrefix(Serializer &) const override
Serialize the node in a format appropriate for hashing.
bool isInner() const override
Determines if this is an inner node.
void setChild(int m, std::shared_ptr< SHAMapTreeNode > const &child)
Tracks the number of instances of an object.
std::shared_ptr< SHAMapTreeNode > clone(std::uint32_t cowid) const override
Make a copy of this node, setting the owner.
std::array< SHAMapHash, 16 > mHashes
std::shared_ptr< SHAMapTreeNode > getChild(int branch)
An immutable linear range of bytes.
static std::shared_ptr< SHAMapTreeNode > makeFullInner(Slice data, SHAMapHash const &hash, bool hashValid)
virtual std::shared_ptr< SHAMapTreeNode > canonicalizeChild(int branch, std::shared_ptr< SHAMapTreeNode > node)
std::uint32_t mFullBelowGen
void updateHash() override
Recalculate the hash of this node.
void shareChild(int m, std::shared_ptr< SHAMapTreeNode > const &child)
Identifies a node inside a SHAMap.
SHAMapInnerNode(std::uint32_t cowid)
bool isEmptyBranch(int m) const
std::string getString(SHAMapNodeID const &) const override
SHAMapHash const & getChildHash(int m) const
bool isFullBelow(std::uint32_t generation) const
void updateHashDeep()
Recalculate the hash of all children and this node.
int getBranchCount() const
SHAMapNodeType getType() const override
Determines the type of node.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void serializeForWire(Serializer &) const override
Serialize the node in a format appropriate for sending over the wire.
static std::mutex childLock
bool isLeaf() const override
Determines if this is a leaf node.
static std::shared_ptr< SHAMapTreeNode > makeCompressedInner(Slice data)
SHAMapTreeNode * getChildPointer(int branch)
void setFullBelowGen(std::uint32_t gen)
void invariants(bool is_root=false) const override
std::shared_ptr< SHAMapTreeNode > mChildren[16]