From e8c910e52d1807e2fcca3b43d80a9df6acac5387 Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Wed, 12 Jan 2022 06:26:46 +0000
Subject: [PATCH] write price level to each book
---
test.cpp | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/test.cpp b/test.cpp
index 20d1aa9..b8df66a 100644
--- a/test.cpp
+++ b/test.cpp
@@ -1,15 +1,29 @@
+#include "bom.hpp"
#include "book.hpp"
#include "json.hpp"
#include "protocol.hpp"
#include <chrono>
+#include <iostream>
+#include <unistd.h>
+#include <unordered_map>
int main(void)
{
- book::Book b = book::testBook(10, true);
- auto bs = protocol::recoverBook();
- std::cout << bs.size() << std::endl;
- for (auto i : bs) {
- std::cout << i.first << std::endl;
- i.second.printBook();
- }
+ // book::Book b = book::testBook(10, true);
+ auto bs = protocol::recoverBook();
+ // protocol::catchUp(bs);
+ // std::cout << bs.size() << std::endl;
+ // for (auto i : bs) {
+ // std::cout << i.first << std::endl;
+ // i.second.printBook();
+ // }
+ bom::initialise();
+ bom::updateBom(bs);
+ bom::destroy();
+ protocol::catchUp(bs);
+ std::cout << bs.size() << std::endl;
+ for (auto& i : bs) {
+ std::cout << i.first << ", " << i.second.bomPrice << std::endl;
+ i.second.printBook();
+ }
}
--
Gitblit v1.10.0