generated from Manchas2k4/tc1030-project-market
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarket.h
52 lines (43 loc) · 1.24 KB
/
market.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// =========================================================
// File: market.h
// Author:
// Date:
// Description:
// =========================================================
#ifndef MARKET_H
#define MARKET_H
#include <sstream>
#include <string>
#include <iomanip>
#include <vector>
#include <list>
#include <queue>
#include "order.h"
#include "selling.h"
#include "buying.h"
#include "wallet.h"
#include "trader.h"
#include "transaction.h"
class Market {
private:
std::priority_queue<Order*> sellingOrders;
std::priority_queue<Order*> buyingOrders;
std::list<Transaction*> transactions;
int fee, noOfSuccessfulTransactions;
public:
Market(int);
int getFee() const;
std::priority_queue<Order*> getSellingOrders() const;
std::priority_queue<Order*> getBuyingOrders() const;
int getNoOfSuccessfulTransactions() const;
void addSellingOrder(SellingOrder*);
void addBuyingOrder(BuyingOrder*);
double topBuyingPrice() const;
double topSellingPrice() const;
void makeOpenMarketOperation(double, std::vector<Trader*>&);
void checkTransactions(std::vector<Trader*>&);
std::string marketInfo() const;
std::string currentPriceInfo() const;
std::string transactionInfo() const;
};
#endif