-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrderBookEntry.cpp
More file actions
32 lines (26 loc) · 805 Bytes
/
OrderBookEntry.cpp
File metadata and controls
32 lines (26 loc) · 805 Bytes
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
#include "OrderBookEntry.h"
/**Constructor*/
OrderBookEntry::OrderBookEntry( double _price,
double _amount,
std::string _timeStamp,
std::string _product,
OrderBookType _orderType,
std::string _username)
: price(_price),
amount(_amount),
timeStamp(_timeStamp),
product(_product),
orderType(_orderType),
username(_username)
{
}
/**Converts a string to an order book type.
*
* Assumes proper input, unknowns are not dealt with.
*/
OrderBookType OrderBookEntry::strToOBT(std::string s)
{
if (s=="ask") return OrderBookType::ask;
if (s=="bid") return OrderBookType::bid;
return OrderBookType::unknown;
}