-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathline_item_parser.h
55 lines (41 loc) · 1.19 KB
/
line_item_parser.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
53
54
55
#ifndef AGGREGATION_LINE_ITEM_PARSER_H
#define AGGREGATION_LINE_ITEM_PARSER_H
#include <iostream>
#include <fstream>
#include <algorithm>
#include <sys/time.h>
#include <vector>
#include <string.h>
struct LineItem {
int order_key;
int part_key;
int supp_key;
int line_number;
double quantity;
double extended_price;
double discount;
double tax;
char return_flag;
char line_status;
tm ship_date;
tm commit_date;
tm receipt_date;
char ship_instruct[25];
char ship_mode[10];
char comment[44];
friend std::ostream &operator<<(std::ostream &output, const LineItem &item) {
output << item.order_key << "|" << item.quantity << "|";
return output;
}
};
std::vector<LineItem> &ReadAndParseLineItems(const std::string &file_path);
void ReadAndProjAllLineItems(const std::string &file_path);
struct ProjLineItem {
int order_key = 0;
int quantity = 0;
bool operator==(const ProjLineItem b) const {
return (this->order_key == b.order_key) && (this->quantity == b.quantity);
}
};
std::vector<ProjLineItem *> *ReadAndParseProjLineItems(const std::string &file_path);
#endif //AGGREGATION_LINE_ITEM_PARSER_H