-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_exporter.h
40 lines (29 loc) · 927 Bytes
/
data_exporter.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
// Copyright (c) Conni Bilham & Lucy Coward 2022, All Rights Reserved.
#include "Star.h"
#include "includes/logging.h"
#include "includes/json.h"
using json = nlohmann::json;
#ifndef GALAXYSIMULATION_DATA_EXPORTER_H
#define GALAXYSIMULATION_DATA_EXPORTER_H
class data_exporter {
private:
std::vector<Star*> *star_list;
std::string file_path;
std::ofstream fileDump;
void dump_csv();
public:
data_exporter(std::vector<Star*> *star_list, std::string file_path = "2Stars.test.dump.txt") {
this->star_list = star_list;
this->file_path = file_path;
}
void full_dump();
void setup_live_dump();
void csv_full_dump_Star(Star star);
void start_dumping(std::string path) {
file_path = path;
logging::info("\n\nStarting to dump data");
dump_csv();
logging::info("Finished dumping data");
}
};
#endif //GALAXYSIMULATION_DATA_EXPORTER_H