|
xrpld
|
#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 (Asset const &asset, std::optional< Domain > const &domain=std::nullopt) override |
| Get all order books that want a specific issue. | |
| int | getBookSize (Asset const &asset, std::optional< Domain > const &domain=std::nullopt) override |
| Get the count of order books that want a specific issue. | |
| bool | isBookToXRP (Asset const &asset, std::optional< Domain > const &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) |
Private Attributes | |
| std::reference_wrapper< ServiceRegistry > | registry_ |
| int const | pathSearchMax_ |
| bool const | standalone_ |
| hardened_hash_map< Asset, hardened_hash_set< Asset > > | allBooks_ |
| hardened_hash_map< std::pair< Asset, Domain >, hardened_hash_set< Asset > > | domainBooks_ |
| hash_set< Asset > | xrpBooks_ |
| hash_set< std::pair< Asset, Domain > > | xrpDomainBooks_ |
| std::recursive_mutex | lock_ |
| std::atomic< std::uint32_t > | seq_ |
| beast::Journal const | j_ |
Definition at line 28 of file OrderBookDBImpl.h.
| xrpl::OrderBookDBImpl::OrderBookDBImpl | ( | ServiceRegistry & | registry, |
| OrderBookDBConfig const & | config ) |
Definition at line 33 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 49 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Add an order book to track.
| book | The order book to add |
Implements xrpl::OrderBookDB.
Definition at line 222 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.
| asset | The asset to search for |
| domain | Optional domain restriction for the order book |
Implements xrpl::OrderBookDB.
Definition at line 249 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Get the count of order books that want a specific issue.
| asset | The asset to search for |
| domain | Optional domain restriction for the order book |
Implements xrpl::OrderBookDB.
Definition at line 281 of file OrderBookDBImpl.cpp.
|
overridevirtual |
Check if an order book to XRP exists for the given issue.
| asset | The asset to check |
| domain | Optional domain restriction for the order book |
Implements xrpl::OrderBookDB.
Definition at line 300 of file OrderBookDBImpl.cpp.
| void xrpl::OrderBookDBImpl::update | ( | std::shared_ptr< ReadView const > const & | ledger | ) |
Definition at line 92 of file OrderBookDBImpl.cpp.
|
private |
Definition at line 55 of file OrderBookDBImpl.h.
|
private |
Definition at line 56 of file OrderBookDBImpl.h.
|
private |
Definition at line 57 of file OrderBookDBImpl.h.
|
private |
Definition at line 60 of file OrderBookDBImpl.h.
|
private |
Definition at line 62 of file OrderBookDBImpl.h.
Definition at line 65 of file OrderBookDBImpl.h.
Definition at line 68 of file OrderBookDBImpl.h.
|
private |
Definition at line 70 of file OrderBookDBImpl.h.
|
private |
Definition at line 72 of file OrderBookDBImpl.h.
|
private |
Definition at line 74 of file OrderBookDBImpl.h.