From 0bef191acd5a77544852e6a3daae2df05bd34a31 Mon Sep 17 00:00:00 2001 From: Joel Grunbaum <joelgrun@gmail.com> Date: Wed, 19 Jan 2022 11:20:45 +0000 Subject: [PATCH] Reformat and change send to x-www-form-urlencoded --- protocol.hpp | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/protocol.hpp b/protocol.hpp index 94f6476..a1a371d 100644 --- a/protocol.hpp +++ b/protocol.hpp @@ -3,6 +3,7 @@ #include "book.hpp" #include "json.hpp" +#include <deque> #include <string> #include <unordered_map> @@ -10,12 +11,15 @@ { enum OrderEnum { ADD, DELETE, BROKER_REQUEST, BROKER_CONFIRM }; - // Catchup utilities +// Catchup utilities std::unordered_map<std::string, book::Book> recoverBook(); +void createWebSocket(); +std::deque<json::Message*> +catchUp(std::unordered_map<std::string, book::Book>& bs); - // Outgoing messages - void addOrder(json::AddMessage& order); - void deleteOrder(json::DeleteMessage& order); +// Outgoing messages +json::Message* addOrder(json::AddMessage& order); +json::Message* deleteOrder(json::DeleteMessage& order); // Incoming messages void handleMessage(std::unordered_map<std::string, book::Book>& bs, @@ -25,13 +29,13 @@ void settle(std::unordered_map<std::string, book::Book>& bs, json::SettleMessage* message); void addedOrder(std::unordered_map<std::string, book::Book>& bs, - json::AddedMessage* message); + json::AddedMessage* message); void deletedOrder(std::unordered_map<std::string, book::Book>& bs, - json::DeletedMessage* message); + json::DeletedMessage* message); void tradeOrder(std::unordered_map<std::string, book::Book>& bs, json::TradeMessage* message); void broker(std::unordered_map<std::string, book::Book>& bs, json::Broker* message); - void send(std::string& message); +json::Message* send(std::string& message); } // namespace protocol -- Gitblit v1.9.3