-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrderBookEntry.h
More file actions
48 lines (42 loc) · 1.01 KB
/
OrderBookEntry.h
File metadata and controls
48 lines (42 loc) · 1.01 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <string>
using namespace std;
enum class OrderBookType
{
ask,
bid,
asksale,
bidsale,
unknown
};
class OrderBookEntry
{
public:
OrderBookEntry(
double price,
double amount,
string timestamp,
string product,
OrderBookType orderType,
string username = "dataset");
double getPrice() const;
double getAmount() const;
void setAmount(double amount);
string getTimestamp() const;
string getProduct() const;
OrderBookType getOrderType() const;
void setOrderType(OrderBookType orderType);
string getUsername() const;
void setUsername(string username);
static OrderBookType stringToOrderBookType(string s);
static bool compareByTimestamp(OrderBookEntry &a, OrderBookEntry &b);
static bool compareByPriceAsc(OrderBookEntry &a, OrderBookEntry &b);
static bool compareByPriceDesc(OrderBookEntry &a, OrderBookEntry &b);
private:
double price;
double amount;
string timestamp;
string product;
OrderBookType orderType;
string username;
};