-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAdSupply.h
35 lines (28 loc) · 999 Bytes
/
AdSupply.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
//
// Created by linpingta.
//
#ifndef SHALE__ADSUPPLY_H_
#define SHALE__ADSUPPLY_H_
#include <iostream>
#include <unordered_map>
#include <fstream>
#include <vector>
class AdSupply {
public:
AdSupply() {
}
void loadInventory(const std::string& file); // load inventory from file
int getSupply(const std::string& supplyID); // get inventory with supplyID
std::vector<std::string> getSupplyKeys(); // get all supply IDs
std::unordered_map<std::string, std::vector<std::string>> getSatisfyDemandList() {
return this->satisfyDemandList;
}
void setSatisfyDemandList(const std::unordered_map<std::string, std::vector<std::string>>& inputDemandList) {
this->satisfyDemandList = inputDemandList;
}
void print();
private:
std::unordered_map<std::string, int> supplyPair; // key as supplyId, value as inventoryValue
std::unordered_map<std::string, std::vector<std::string>> satisfyDemandList; // key as supplyId, value as demandId list
};
#endif //SHALE__ADSUPPLY_H_