#include "Ledger.h" #include "OrderBook.h" /* we can eventually make this cached and just update it as transactions come in. But for now it is probably faster to just generate it each time */ class OrderBookDB { std::vector mEmptyVector; std::vector mXRPOrders; std::map > mIssuerMap; std::map mKnownMap; public: OrderBookDB(Ledger::pointer ledger); // return list of all orderbooks that want XRP std::vector& getXRPInBooks(){ return mXRPOrders; } // return list of all orderbooks that want IssuerID std::vector& getBooks(const uint160& issuerID); // return list of all orderbooks that want this issuerID and currencyID void getBooks(const uint160& issuerID, const uint160& currencyID, std::vector& bookRet); // returns the best rate we can find float getPrice(uint160& currencyIn,uint160& currencyOut); };