GENIE
io.cc
Go to the documentation of this file.
3 
4 #include "io.h"
5 
6 using namespace std;
7 using namespace genie;
8 using namespace genie::utility;
9 
10 TableData genie::LoadTableDataFromCsv(const string& filename)
11 {
12  TableData table_data;
13  read_file(table_data, filename.c_str(), -1);
14 
15  return table_data;
16 }
17 
18 shared_ptr<genie::table::inv_table> genie::LoadTableFromBinary(const string& filename)
19 {
20  return LoadTable(filename);;
21 }
22 
23 void genie::SaveTableToBinary(const string& filename, const shared_ptr<const genie::table::inv_table> &table)
24 {
25  SaveTable(filename, table);
26 }
27 
28 QueryData genie::LoadQueryDataFromCsv(const string& filename, const shared_ptr<const ExecutionPolicy>& policy)
29 {
30  QueryData query_data;
31  read_file(query_data, filename.c_str(), policy->GetNumOfQueries());
32 
33  return query_data;
34 }
35 
36 
QueryData LoadQueryDataFromCsv(const std::string &filename, const std::shared_ptr< const ExecutionPolicy > &policy)
Reads query from a CSV file and returns in QueryData format.
This is the top-level namespace of the project.
std::vector< std::vector< int > > QueryData
Raw query data format used for building the queries.
Definition: types.h:16
std::shared_ptr< genie::table::inv_table > LoadTableFromBinary(const std::string &filename)
Reads data from a binary file and returns pre-built table.
void SaveTableToBinary(const std::string &filename, const std::shared_ptr< const genie::table::inv_table > &table)
Save inverted table to a binary file.
std::vector< std::vector< int > > TableData
Raw table data format used for building the table.
Definition: types.h:12
std::shared_ptr< genie::table::inv_table > LoadTable(const std::string &filename)
TableData LoadTableDataFromCsv(const std::string &filename)
Reads data from a CSV file and returns in TableData format.
void read_file(std::vector< std::vector< int > > &dest, const char *fname, int num)
void SaveTable(const std::string &filename, const std::shared_ptr< const genie::table::inv_table > &table)