OoOJoin  0.0.1
The next generation of out-of-order join operator
FileDataLoader.h
Go to the documentation of this file.
1 
2 //
3 // Created by tony on 29/12/22.
4 //
5 
6 #ifndef _INCLUDE_TESTBENCH_FileDataLoader_H_
7 #define _INCLUDE_TESTBENCH_FileDataLoader_H_
8 #include <Utils/ConfigMap.hpp>
9 #include <Common/Tuples.h>
10 #include <assert.h>
12 using namespace INTELLI;
13 
14 namespace OoOJoin {
15 
41  protected:
42 
43  void spilt(const std::string s, const std::string &c, vector<std::string> &v) {
44  std::string::size_type pos1, pos2;
45  pos2 = s.find(c);
46  pos1 = 0;
47  while (std::string::npos != pos2) {
48  v.push_back(s.substr(pos1, pos2 - pos1));
49 
50  pos1 = pos2 + c.size();
51  pos2 = s.find(c, pos1);
52  }
53  if (pos1 != s.length())
54  v.push_back(s.substr(pos1));
55  }
63  std::vector<TrackTuplePtr> loadDataFromCsv(std::string fname,
64  std::string separator = ",",
65  std::string newLine = "\n");
66  public:
67  ConfigMapPtr cfgGlobal;
68  vector<TrackTuplePtr> sTuple, rTuple;
69  FileDataLoader() {}
70  ~FileDataLoader() {}
76  virtual bool setConfig(ConfigMapPtr cfg);
77 
83  virtual bool setModConfig(ConfigMapPtr cfg) {
84  assert(cfg);
85  return true;
86  }
91  virtual vector<TrackTuplePtr> getTupleVectorS();
92 
97  virtual vector<TrackTuplePtr> getTupleVectorR();
98 
99 };
100 
107 typedef std::shared_ptr<class FileDataLoader> FileDataLoaderPtr;
113 #define newFileDataLoader std::make_shared<OoOJoin::FileDataLoader>
120 }
121 #endif //INTELLISTREAM_INCLUDE_TESTBENCH_FileDataLoader_H_
The abstract class of dataloader.
Definition: AbstractDataLoader.h:39
The dataloader which loads data from external csv file.
Definition: FileDataLoader.h:40
virtual bool setModConfig(ConfigMapPtr cfg)
Set the modification config map related to this loader.
Definition: FileDataLoader.h:83
std::shared_ptr< class FileDataLoader > FileDataLoaderPtr
The class to describe a shared pointer to FileDataLoader.
Definition: FileDataLoader.h:107
std::shared_ptr< ConfigMap > ConfigMapPtr
The class to describe a shared pointer to ConfigMap.
Definition: ConfigMap.hpp:356
Definition: OperatorTable.cpp:7