3#include <xrpl/core/ServiceRegistry.h>
4#include <xrpl/ledger/OrderBookDB.h>
5#include <xrpl/protocol/UintTypes.h>
A generic endpoint for log messages.
hardened_hash_map< std::pair< Asset, Domain >, hardened_hash_set< Asset > > domainBooks_
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.
hash_set< Asset > xrpBooks_
void setup(std::shared_ptr< ReadView const > const &ledger) override
Initialize or update the order book database with a new ledger.
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.
OrderBookDBImpl(ServiceRegistry ®istry, OrderBookDBConfig const &config)
hardened_hash_map< Asset, hardened_hash_set< Asset > > allBooks_
std::atomic< std::uint32_t > seq_
int getBookSize(Asset const &asset, std::optional< Domain > const &domain=std::nullopt) override
Get the count of order books that want a specific issue.
hash_set< std::pair< Asset, Domain > > xrpDomainBooks_
void update(std::shared_ptr< ReadView const > const &ledger)
std::recursive_mutex lock_
std::reference_wrapper< ServiceRegistry > registry_
Tracks order books in the ledger.
Service registry for dependency injection.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::unordered_set< Value, Hash, Pred, Allocator > hash_set
std::unordered_set< Value, Hash, Pred, Allocator > hardened_hash_set
std::unordered_map< Key, Value, Hash, Pred, Allocator > hardened_hash_map
std::unique_ptr< OrderBookDB > makeOrderBookDb(ServiceRegistry ®istry, OrderBookDBConfig const &config)
Create an OrderBookDB instance.
Configuration for OrderBookDB.