?? glob_var.h
字號:
//Glob_Var.h
#ifndef GLOB_VAR_H
#define GLOB_VAR_H
#include "Buffer.h"
#include <iostream>
using namespace std;
extern char CurLocation[256];
extern char CurRelationName[33];
extern char* ErrorMessage[];
enum MSG {CREATE,SELECT,INSERT,UPDATE,DELETE,DROP,QUIT,
SHOWDB,SHOWTABLE,USE,HELP,UNORMAL,NEW,DEFAULT,DROPDB};
//I---int C---char F---float
enum Column_Type {I,C,F};
// > >= < <= = != between…and…;
enum Operator_Type {B, BE, L, LE, E, NE,BETWEEN,ALL};
typedef struct TKey_Location* pKey_Location;
typedef struct TKey_Location
{
_F_FileAddr ptr ; //節點指針
int offset; //所在節點的第幾個key
bool operator==(TKey_Location key)
{
return (this->ptr == key.ptr && this->offset == key.offset);
}
bool operator!=(TKey_Location key)
{
if(this->ptr == key.ptr && this->offset == key.offset)
return false;
return true;
}
}Key_Location;
//-----------------------------------------------------------------------------------------
//支持int,char和float類型
union Column_Value
{
int IntValue; //整形值
char* pCharValue; //字符串指針
float FloatValue; //浮點型值
};
//---------------------------------------------------------------------------------------------
//catalog給index的關于選擇范圍的信息
//使用者:index
typedef struct TKey_Attr* pKey_Attr;
typedef struct TKey_Attr
{
Column_Value value;
pKey_Attr next;
TKey_Attr(){next = NULL;}
}Key_Attr;
typedef struct TCondtion_Info
{ //查找的范圍信息
Operator_Type OperType; //關系運算符
pKey_Attr min; //按照順序鏈接的屬性的范圍下限
pKey_Attr max; //按照順序鏈接的屬性的范圍上限
TCondtion_Info(){
min = NULL;
max = NULL;
OperType = B;
}
}Condition_Info;
//------------------------------------------------------------------------------------------------
//Catalog得出的關于選擇需要的字段信息
//使用者:Record
typedef struct TSelect_Cell
{
char ColumnName[32]; //字段名――方便打印
Column_Type ColType; //字段類型――方便打印
int PriorLength; //記錄頭到此字段之間的長度
int ColLength; //字段類型的長度
TSelect_Cell* next; //下一個字段信息
TSelect_Cell():PriorLength(0),ColLength(0),ColType(I)
{
this->next = NULL;
strcpy(this->ColumnName,"");
}
}Select_Cell;
class Select_Rec_Info
{
public:
Select_Cell* head;
int ColumnNum;
int RecordLength;
Select_Rec_Info():ColumnNum(0) {this->head=NULL;}
~Select_Rec_Info(){};
};
//Catalog將待插入記錄的缺省值(如果有)填完整后形成的完整的記錄信息
//使用者:Record
typedef struct TCell_Info //記錄單個屬性上的信息
{
Column_Type ColType; //屬性類型
Column_Value value;
int PriorLength; //記錄頭到當前字段之間的長度
int ColLength; //當前字段的長度
TCell_Info* next;
TCell_Info(){
next = NULL;
ColType = I;
PriorLength = 0;
ColLength = 0;
}
}Cell_Info;
class Rec_Info
{
public:
Cell_Info* head;
int ColNum;
int RecordLength;
Rec_Info(){
head = NULL;
ColNum = 0;
}
~Rec_Info(){};
};
#endif //GLOB_BAR_H
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -