-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtable.h
53 lines (44 loc) · 1.04 KB
/
table.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
#ifndef TABLE
#define TABLE
#include <string>
#include <vector>
#include <map>
#include <iostream>
#include "parser.h"
#include <boost/serialization/vector.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/string.hpp>
#define ATTR_NUM_LIMITS 8
class Table
{
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & numOfRec;
ar & numOfAttrs;
ar & numOfIndex;
ar & name;
ar & index_pos;
ar & index_name;
ar & attributes;
ar & insertPos;
}
public:
Table();
Table(const char * table_name, const id_list_t * attrlist);
~Table();
void print_table();
int setAttrName(const char * oldstr, const char * newstr);
int getAttrsIndex(const char *);
unsigned int numOfRec;
unsigned short numOfAttrs;
unsigned short numOfIndex;
std::string name;
//std::map<std::string,std::string> index;
std::map<std::string,int> index_pos;
std::map<std::string,std::string> index_name;
std::vector<std::string> attributes;
int insertPos;
};
#endif