#pragma once #include "OrderBookEntry.h" #include "CSVReader.h" #include #include class OrderBook { public: /** construct, reading a csv data file */ OrderBook(std::string filename); /** return vector of all know products in the dataset*/ std::vector getKnownProducts(); /** return vector of Orders according to the sent filters*/ std::vector getOrders(OrderBookType type, std::string product, std::string timestamp); /** returns the earliest time in the orderbook*/ std::string getEarliestTime(); /** returns the next time after the * sent time in the orderbook * If there is no next timestamp, wraps around to the start * */ std::string getNextTime(std::string timestamp); void insertOrder(OrderBookEntry& order); // Remove order from the order book void removeOrder(OrderBookEntry& order); std::vector matchAsksToBids(std::string product, std::string timestamp); static double getHighPrice(std::vector &orders); static double getLowPrice(std::vector &orders); private: std::vector orders; // private variable which holds all loaded orders from the file std::vector knownProducts; };