-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOrderBookEntry.h
30 lines (24 loc) · 1006 Bytes
/
OrderBookEntry.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include <string>
enum class OrderBookType{bid, ask, sale, unknown, asksale, bidsale};
class OrderBookEntry
{
public:
/** Create a new OrderBookEntry with passed parameters */
OrderBookEntry( double _price,
double _amount,
std::string _timestamp,
std::string _product,
OrderBookType _orderType,
std::string username = "dataset");
static OrderBookType stringToOrderBookType(std::string s);
static bool compareByTimestamp(const OrderBookEntry& o1, const OrderBookEntry& o2);
static bool compareByPriceAsc(const OrderBookEntry& o1, const OrderBookEntry& o2);
static bool compareByPriceDesc(const OrderBookEntry& o1, const OrderBookEntry& o2);
double price;
double amount;
std::string timestamp;
std::string product;
OrderBookType orderType;
std::string username;
};