rippled
Loading...
Searching...
No Matches
ServiceRegistry.h
1#pragma once
2
3#include <xrpl/basics/Blob.h>
4#include <xrpl/basics/SHAMapHash.h>
5#include <xrpl/basics/TaggedCache.h>
6
7#include <boost/asio.hpp>
8
9namespace xrpl {
10
11// Forward declarations
12namespace NodeStore {
13class Database;
14} // namespace NodeStore
15namespace Resource {
16class Manager;
17} // namespace Resource
18namespace perf {
19class PerfLog;
20} // namespace perf
21
22// This is temporary until we migrate all code to use ServiceRegistry.
23class Application;
24
25template <
26 class Key,
27 class T,
28 bool IsKeyCache,
29 class SharedWeakUnionPointer,
30 class SharedPointerType,
31 class Hash,
32 class KeyEqual,
33 class Mutex>
34class TaggedCache;
35class STLedgerEntry;
38
39// Forward declarations
40class AcceptedLedger;
41class AmendmentTable;
42class Cluster;
44class DatabaseCon;
45class Family;
46class HashRouter;
47class InboundLedgers;
49class JobQueue;
50class LedgerCleaner;
51class LedgerMaster;
52class LedgerReplayer;
53class LoadFeeTrack;
54class LoadManager;
55class ManifestCache;
56class NetworkOPs;
58class OpenLedger;
59class OrderBookDB;
60class Overlay;
63class PendingSaves;
65class ServerHandler;
66class SHAMapStore;
67class TimeKeeper;
69class TxQ;
70class ValidatorList;
71class ValidatorSite;
72
73template <class Adaptor>
74class Validations;
77
79
92{
93public:
94 ServiceRegistry() = default;
95 virtual ~ServiceRegistry() = default;
96
97 // Core infrastructure services
98 virtual CollectorManager&
100
101 virtual Family&
103
104 virtual TimeKeeper&
106
107 virtual JobQueue&
109
110 virtual NodeCache&
112
113 virtual CachedSLEs&
115
116 virtual NetworkIDService&
118
119 // Protocol and validation services
120 virtual AmendmentTable&
122
123 virtual HashRouter&
125
126 virtual LoadFeeTrack&
128
129 virtual LoadManager&
131
132 virtual RCLValidations&
134
135 virtual ValidatorList&
137
138 virtual ValidatorSite&
140
141 virtual ManifestCache&
143
144 virtual ManifestCache&
146
147 // Network services
148 virtual Overlay&
150
151 virtual Cluster&
153
154 virtual PeerReservationTable&
156
157 virtual Resource::Manager&
159
160 // Storage services
161 virtual NodeStore::Database&
163
164 virtual SHAMapStore&
166
167 virtual RelationalDatabase&
169
170 // Ledger services
171 virtual InboundLedgers&
173
174 virtual InboundTransactions&
176
179
180 virtual LedgerMaster&
182
183 virtual LedgerCleaner&
185
186 virtual LedgerReplayer&
188
189 virtual PendingSaves&
191
192 virtual OpenLedger&
194
195 virtual OpenLedger const&
196 getOpenLedger() const = 0;
197
198 // Transaction and operation services
199 virtual NetworkOPs&
200 getOPs() = 0;
201
202 virtual OrderBookDB&
204
205 virtual TransactionMaster&
207
208 virtual TxQ&
209 getTxQ() = 0;
210
211 virtual PathRequestManager&
213
214 // Server services
215 virtual ServerHandler&
217
218 virtual perf::PerfLog&
220
221 // Configuration and state
222 virtual bool
223 isStopping() const = 0;
224
225 virtual beast::Journal
226 getJournal(std::string const& name) = 0;
227
228 virtual boost::asio::io_context&
230
231 virtual Logs&
232 getLogs() = 0;
233
234 virtual std::optional<uint256> const&
235 getTrapTxID() const = 0;
236
238 virtual DatabaseCon&
240
241 // Temporary: Get the underlying Application for functions that haven't
242 // been migrated yet. This should be removed once all code is migrated.
243 virtual Application&
244 getApp() = 0;
245};
246
247} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
A ledger that has become irrevocable.
The amendment table stores the list of enabled and potential amendments.
Provides the beast::insight::Collector service.
Routing table for objects identified by hash.
Definition HashRouter.h:77
Manages the lifetime of inbound ledgers.
Manages the acquisition and lifetime of transaction sets.
A pool of threads to perform work.
Definition JobQueue.h:38
Check the ledger/transaction databases to make sure they have continuity.
Manages the lifetime of ledger replay tasks.
Manages the current fee schedule.
Manages load sources.
Definition LoadManager.h:26
Manages partitions for logging.
Definition Log.h:32
Remembers manifests with the highest sequence number.
Definition Manifest.h:235
Service that provides access to the network ID.
Provides server functionality for clients.
Definition NetworkOPs.h:71
Persistency layer for NodeObject.
Definition Database.h:31
Represents the open ledger.
Definition OpenLedger.h:32
Tracks order books in the ledger.
Definition OrderBookDB.h:29
Manages the set of connected peers.
Definition Overlay.h:29
Keeps track of which ledgers haven't been fully saved.
Generic validations adaptor class for RCL.
Tracks load and resource consumption.
class to create database, launch online delete thread, and related SQLite database
Definition SHAMapStore.h:17
Service registry for dependency injection.
virtual NodeCache & getTempNodeCache()=0
virtual PendingSaves & getPendingSaves()=0
virtual perf::PerfLog & getPerfLog()=0
virtual JobQueue & getJobQueue()=0
virtual RelationalDatabase & getRelationalDatabase()=0
virtual PeerReservationTable & getPeerReservations()=0
virtual AmendmentTable & getAmendmentTable()=0
virtual TxQ & getTxQ()=0
virtual CollectorManager & getCollectorManager()=0
virtual beast::Journal getJournal(std::string const &name)=0
virtual NetworkOPs & getOPs()=0
virtual TransactionMaster & getMasterTransaction()=0
virtual SHAMapStore & getSHAMapStore()=0
virtual NodeStore::Database & getNodeStore()=0
virtual OpenLedger & getOpenLedger()=0
virtual ManifestCache & getPublisherManifests()=0
virtual Resource::Manager & getResourceManager()=0
virtual ValidatorList & getValidators()=0
virtual LoadManager & getLoadManager()=0
virtual NetworkIDService & getNetworkIDService()=0
virtual PathRequestManager & getPathRequestManager()=0
virtual ValidatorSite & getValidatorSites()=0
virtual RCLValidations & getValidations()=0
virtual LoadFeeTrack & getFeeTrack()=0
virtual ServerHandler & getServerHandler()=0
virtual InboundLedgers & getInboundLedgers()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual HashRouter & getHashRouter()=0
virtual bool isStopping() const =0
virtual boost::asio::io_context & getIOContext()=0
virtual Cluster & getCluster()=0
virtual Family & getNodeFamily()=0
virtual Application & getApp()=0
virtual DatabaseCon & getWalletDB()=0
Retrieve the "wallet database".
virtual LedgerReplayer & getLedgerReplayer()=0
virtual OpenLedger const & getOpenLedger() const =0
virtual OrderBookDB & getOrderBookDB()=0
virtual TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache()=0
virtual Overlay & getOverlay()=0
virtual Logs & getLogs()=0
virtual TimeKeeper & getTimeKeeper()=0
virtual LedgerCleaner & getLedgerCleaner()=0
virtual InboundTransactions & getInboundTransactions()=0
virtual CachedSLEs & getCachedSLEs()=0
virtual ManifestCache & getValidatorManifests()=0
virtual ~ServiceRegistry()=default
virtual std::optional< uint256 > const & getTrapTxID() const =0
Map/cache combination.
Definition TaggedCache.h:42
Manages various times used by the server.
Definition TimeKeeper.h:12
Transaction Queue.
Definition TxQ.h:40
Maintains current and recent ledger validations.
Singleton class that maintains performance counters and optionally writes Json-formatted data to a di...
Definition PerfLog.h:31
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5