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