Repository navigation
Expand file tree
/
Copy pathRecord_Manager.h
More file actions
36 lines (31 loc) · 1.64 KB
/
Copy pathRecord_Manager.h
File metadata and controls
36 lines (31 loc) · 1.64 KB
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
#ifndef __RECORD_MANAGER_H__
#define __RECORD_MANAGER_H__
#include "MiniSQL.h"
class RecordManager
{
public:
AttributeValuesMap attributeValuesMap;
RecordManager(){};
~RecordManager(){};
string toString(const char * source, int length, TYPE type);
bool satisfy(const vector<Attribute> & attributes, const vector<Condition> & conditions, const string * allAttrValues);
bool satisfy(const Condition & cond, const string & value); // 需要维护condition里的attribute的所有信息
bool satisfy(const Condition & cond, const string & value, const TYPE type);
bool contains(const vector<Attribute> & attributes, const Attribute & attr);
bool ConstraintCheck(char * tempData, const Table & table);
bool isExist(char * data, int currentPos, int length, TYPE type, const Table & table);
int hasCondition(const vector<Condition> & conditions, const string & attrName);
int findIndexOf(const vector<Attribute> & attributes, const Condition & condition);
Condition indexAvailable(const Table & table, const vector<Condition> & conditions);
bool hasIndex(const Table & table, const string & attrName);
int copyinto(char * buffer, const char * from, int start, int length);
bool createTable(Table & table);
bool insertValue(Table & table, const string & values);
bool dropTable(string & tableName);
int selectWithwhere(Table & table, const vector<Attribute> & attributes, const vector<Condition> & conditions);
int selectWithoutwhere(Table & table, const vector<Attribute> & attributes);
int deleteWithwhere(Table & table, vector<Condition> & conditions);
int deleteWithoutwhere(Table & table);
void outputMap(int tupleCount, const Table & table);
};
#endif