[go: up one dir, main page]

Menu

[r23]: / sql / table.h  Maximize  Restore  History

Download this file

32 lines (23 with data), 634 Bytes

 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
#ifndef __CB_TABLE_H__
#define __CB_TABLE_H__
#include <data.h>
#include <fstream>
#include <sql.h>
using namespace std;
class Table
{
public:
int loadDataFile(const string& filename);
int loadSemantics(const string& semfile);
void close();
int readTuple(char* tuple, int& len);
DataItem readItem(const char* tuple, const string& attr);
bool select(const char* tuple, EvalTree* tree);
int project(const char* src, char* dst, const vector<string>& attr);
private:
int evaluate(const char* tuple, EvalTree* tree, DataItem& res);
private:
ifstream m_DataFile;
vector<DataAttr> m_AttrList;
};
#endif