xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
shamap
NodeFamily.h
1
#pragma once
2
3
#include <xrpld/app/main/CollectorManager.h>
4
5
#include <xrpl/basics/base_uint.h>
6
#include <xrpl/beast/utility/Journal.h>
7
#include <xrpl/nodestore/Database.h>
8
#include <xrpl/protocol/Protocol.h>
9
#include <xrpl/shamap/Family.h>
10
#include <xrpl/shamap/FullBelowCache.h>
11
#include <xrpl/shamap/TreeNodeCache.h>
12
13
#include <
cstdint
>
14
#include <
memory
>
15
#include <
mutex
>
16
17
namespace
xrpl
{
18
19
class
Application
;
20
21
class
NodeFamily
:
public
Family
22
{
23
public
:
24
NodeFamily
() =
delete
;
25
NodeFamily
(
NodeFamily
const
&) =
delete
;
26
NodeFamily
(
NodeFamily
&&) =
delete
;
27
28
NodeFamily
&
29
operator=
(
NodeFamily
const
&) =
delete
;
30
31
NodeFamily
&
32
operator=
(
NodeFamily
&&) =
delete
;
33
34
NodeFamily
(
Application
& app,
CollectorManager
& cm);
35
36
node_store::Database
&
37
db
()
override
38
{
39
return
db_
;
40
}
41
42
[[nodiscard]]
node_store::Database
const
&
43
db
()
const override
44
{
45
return
db_
;
46
}
47
48
beast::Journal
const
&
49
journal
()
override
50
{
51
return
j_
;
52
}
53
54
std::shared_ptr<FullBelowCache>
55
getFullBelowCache
()
override
56
{
57
return
fbCache_
;
58
}
59
60
std::shared_ptr<TreeNodeCache>
61
getTreeNodeCache
()
override
62
{
63
return
tnCache_
;
64
}
65
66
void
67
sweep
()
override
;
68
69
void
70
reset
()
override
;
71
72
void
73
missingNodeAcquireBySeq
(
std::uint32_t
seq,
UInt256
const
& hash)
override
;
74
75
void
76
missingNodeAcquireByHash
(
UInt256
const
& hash,
std::uint32_t
seq)
override
77
{
78
acquire
(hash, seq);
79
}
80
81
private
:
82
Application
&
app_
;
83
node_store::Database
&
db_
;
84
beast::Journal
const
j_
;
85
86
std::shared_ptr<FullBelowCache>
fbCache_
;
87
std::shared_ptr<TreeNodeCache>
tnCache_
;
88
89
// Missing node handler
90
LedgerIndex
maxSeq_
{0};
91
std::mutex
maxSeqMutex_
;
92
93
void
94
acquire
(
UInt256
const
& hash,
std::uint32_t
seq);
95
};
96
97
}
// namespace xrpl
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:44
xrpl::Application
Definition
Application.h:94
xrpl::CollectorManager
Provides the beast::insight::Collector service.
Definition
CollectorManager.h:17
xrpl::Family::Family
Family(Family const &)=delete
xrpl::NodeFamily::acquire
void acquire(UInt256 const &hash, std::uint32_t seq)
Definition
NodeFamily.cpp:95
xrpl::NodeFamily::journal
beast::Journal const & journal() override
Definition
NodeFamily.h:49
xrpl::NodeFamily::missingNodeAcquireBySeq
void missingNodeAcquireBySeq(std::uint32_t seq, UInt256 const &hash) override
Acquire ledger that has a missing node by ledger sequence.
Definition
NodeFamily.cpp:66
xrpl::NodeFamily::getFullBelowCache
std::shared_ptr< FullBelowCache > getFullBelowCache() override
Return a pointer to the Family Full Below Cache.
Definition
NodeFamily.h:55
xrpl::NodeFamily::operator=
NodeFamily & operator=(NodeFamily &&)=delete
xrpl::NodeFamily::reset
void reset() override
Definition
NodeFamily.cpp:54
xrpl::NodeFamily::tnCache_
std::shared_ptr< TreeNodeCache > tnCache_
Definition
NodeFamily.h:87
xrpl::NodeFamily::missingNodeAcquireByHash
void missingNodeAcquireByHash(UInt256 const &hash, std::uint32_t seq) override
Acquire ledger that has a missing node by ledger hash.
Definition
NodeFamily.h:76
xrpl::NodeFamily::app_
Application & app_
Definition
NodeFamily.h:82
xrpl::NodeFamily::NodeFamily
NodeFamily(NodeFamily const &)=delete
xrpl::NodeFamily::NodeFamily
NodeFamily(NodeFamily &&)=delete
xrpl::NodeFamily::getTreeNodeCache
std::shared_ptr< TreeNodeCache > getTreeNodeCache() override
Return a pointer to the Family Tree Node Cache.
Definition
NodeFamily.h:61
xrpl::NodeFamily::db
node_store::Database & db() override
Definition
NodeFamily.h:37
xrpl::NodeFamily::operator=
NodeFamily & operator=(NodeFamily const &)=delete
xrpl::NodeFamily::db
node_store::Database const & db() const override
Definition
NodeFamily.h:43
xrpl::NodeFamily::sweep
void sweep() override
Definition
NodeFamily.cpp:47
xrpl::NodeFamily::maxSeqMutex_
std::mutex maxSeqMutex_
Definition
NodeFamily.h:91
xrpl::NodeFamily::NodeFamily
NodeFamily()=delete
xrpl::NodeFamily::fbCache_
std::shared_ptr< FullBelowCache > fbCache_
Definition
NodeFamily.h:86
xrpl::NodeFamily::db_
node_store::Database & db_
Definition
NodeFamily.h:83
xrpl::NodeFamily::j_
beast::Journal const j_
Definition
NodeFamily.h:84
xrpl::NodeFamily::maxSeq_
LedgerIndex maxSeq_
Definition
NodeFamily.h:90
xrpl::node_store::Database
Persistency layer for NodeObject.
Definition
Database.h:45
cstdint
std::uint32_t
memory
mutex
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::LedgerIndex
std::uint32_t LedgerIndex
A ledger index.
Definition
Protocol.h:382
xrpl::UInt256
BaseUInt< 256 > UInt256
Definition
base_uint.h:580
std::shared_ptr
Generated by
1.17.0