mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-05 16:57:56 +00:00
Track counts of SHAMap-related objects
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#define RIPPLE_SHAMAP_SHAMAPITEM_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/Blob.h>
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
#include <ripple/basics/Slice.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <ripple/beast/utility/Journal.h>
|
||||
@@ -31,7 +32,7 @@
|
||||
namespace ripple {
|
||||
|
||||
// an item stored in a SHAMap
|
||||
class SHAMapItem
|
||||
class SHAMapItem : public CountedObject<SHAMapItem>
|
||||
{
|
||||
private:
|
||||
uint256 tag_;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef RIPPLE_SHAMAP_SHAMAPNODEID_H_INCLUDED
|
||||
#define RIPPLE_SHAMAP_SHAMAPNODEID_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
#include <ripple/basics/base_uint.h>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
@@ -29,7 +30,7 @@
|
||||
namespace ripple {
|
||||
|
||||
/** Identifies a node inside a SHAMap */
|
||||
class SHAMapNodeID
|
||||
class SHAMapNodeID : public CountedObject<SHAMapNodeID>
|
||||
{
|
||||
private:
|
||||
uint256 id_;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef RIPPLE_SHAMAP_SHAMAPTREENODE_H_INCLUDED
|
||||
#define RIPPLE_SHAMAP_SHAMAPTREENODE_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/CountedObject.h>
|
||||
#include <ripple/basics/TaggedCache.h>
|
||||
#include <ripple/beast/utility/Journal.h>
|
||||
#include <ripple/shamap/SHAMapItem.h>
|
||||
@@ -202,7 +203,8 @@ private:
|
||||
bool hashValid);
|
||||
};
|
||||
|
||||
class SHAMapInnerNode : public SHAMapAbstractNode
|
||||
class SHAMapInnerNode : public SHAMapAbstractNode,
|
||||
public CountedObject<SHAMapInnerNode>
|
||||
{
|
||||
std::array<SHAMapHash, 16> mHashes;
|
||||
std::shared_ptr<SHAMapAbstractNode> mChildren[16];
|
||||
@@ -273,7 +275,8 @@ public:
|
||||
|
||||
// SHAMapTreeNode represents a leaf, and may eventually be renamed to reflect
|
||||
// that.
|
||||
class SHAMapTreeNode : public SHAMapAbstractNode
|
||||
class SHAMapTreeNode : public SHAMapAbstractNode,
|
||||
public CountedObject<SHAMapTreeNode>
|
||||
{
|
||||
private:
|
||||
std::shared_ptr<SHAMapItem const> mItem;
|
||||
|
||||
Reference in New Issue
Block a user