|
rippled
|
#include <OrderBookDBImpl.h>


Public Member Functions | |
| OrderBookDBImpl (ServiceRegistry ®istry, OrderBookDBConfig const &config) | |
| void | setup (std::shared_ptr< ReadView const > const &ledger) override |
| Initialize or update the order book database with a new ledger. | |
| void | addOrderBook (Book const &book) override |
| Add an order book to track. | |
| std::vector< Book > | getBooksByTakerPays (Issue const &issue, std::optional< Domain > const &domain=std::nullopt) override |
| Get all order books that want a specific issue. | |
| int | getBookSize (Issue const &issue, std::optional< Domain > const &domain=std::nullopt) override |
| Get the count of order books that want a specific issue. | |
| bool | isBookToXRP (Issue const &issue, std::optional< Domain > domain=std::nullopt) override |
| Check if an order book to XRP exists for the given issue. | |
| void | update (std::shared_ptr< ReadView const > const &ledger) |
| void | processTxn (std::shared_ptr< ReadView const > const &ledger, AcceptedLedgerTx const &alTx, MultiApiJson const &jvObj) override |
| BookListeners::pointer | getBookListeners (Book const &) override |
| BookListeners::pointer | makeBookListeners (Book const &) override |
Private Types | |
| using | BookToListenersMap = hash_map< Book, BookListeners::pointer > |
Private Attributes | |
| ServiceRegistry & | registry_ |
| int const | pathSearchMax_ |
| bool const | standalone_ |
| hardened_hash_map< Issue, hardened_hash_set< Issue > > | allBooks_ |
| hardened_hash_map< std::pair< Issue, Domain >, hardened_hash_set< Issue > > | domainBooks_ |
| hash_set< Issue > | xrpBooks_ |
| hash_set< std::pair< Issue, Domain > > | xrpDomainBooks_ |
| std::recursive_mutex | mLock |
| BookToListenersMap | mListeners |
| std::atomic< std::uint32_t > | seq_ |
| beast::Journal const | j_ |
Definition at line 31 of file OrderBookDBImpl.h.
|
private |
Definition at line 84 of file OrderBookDBImpl.h.
| xrpl::OrderBookDBImpl::OrderBookDBImpl | ( | ServiceRegistry & | registry, |
| OrderBookDBConfig const & | config | ||
| ) |
Definition at line 13 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Initialize or update the order book database with a new ledger.
This method should be called when a new ledger is accepted to update the order book database with the current state of all order books.
| ledger | The ledger to scan for order books |
Implements xrpl::OrderBookDB.
Definition at line 29 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Add an order book to track.
| book | The order book to add |
Implements xrpl::OrderBookDB.
Definition at line 161 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Get all order books that want a specific issue.
Returns a list of all order books where the taker pays the specified issue. This is useful for pathfinding to find all possible next hops from a given currency.
| issue | The issue to search for |
| domain | Optional domain restriction for the order book |
Implements xrpl::OrderBookDB.
Definition at line 180 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Get the count of order books that want a specific issue.
| issue | The issue to search for |
| domain | Optional domain restriction for the order book |
Implements xrpl::OrderBookDB.
Definition at line 208 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Check if an order book to XRP exists for the given issue.
| issue | The issue to check |
| domain | Optional domain restriction for the order book |
Implements xrpl::OrderBookDB.
Definition at line 227 of file OrderBookDBImpl.cpp.
| void xrpl::OrderBookDBImpl::update | ( | std::shared_ptr< ReadView const > const & | ledger | ) |
Definition at line 64 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Implements xrpl::OrderBookDB.
Definition at line 271 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Implements xrpl::OrderBookDB.
Definition at line 256 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Implements xrpl::OrderBookDB.
Definition at line 236 of file OrderBookDBImpl.cpp.
|
private |
Definition at line 67 of file OrderBookDBImpl.h.
|
private |
Definition at line 68 of file OrderBookDBImpl.h.
|
private |
Definition at line 69 of file OrderBookDBImpl.h.
|
private |
Definition at line 72 of file OrderBookDBImpl.h.
|
private |
Definition at line 74 of file OrderBookDBImpl.h.
Definition at line 77 of file OrderBookDBImpl.h.
Definition at line 80 of file OrderBookDBImpl.h.
|
private |
Definition at line 82 of file OrderBookDBImpl.h.
|
private |
Definition at line 86 of file OrderBookDBImpl.h.
|
private |
Definition at line 88 of file OrderBookDBImpl.h.
|
private |
Definition at line 90 of file OrderBookDBImpl.h.