📄 api.h
字号:
// API.h: interface for the API class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_API_H__E8ACB069_AE71_42B2_B21C_50DBC39236B2__INCLUDED_)
#define AFX_API_H__E8ACB069_AE71_42B2_B21C_50DBC39236B2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "BufferManager.h"
#include "CatalogManager.h"
#include "api_inte_struct.h"
class API
{
public:
void free_a_empty_block(int blockNo);
void set_CatalogManger(CatalogManager* Catalog_Manager);
opn_res* end_transaction();
opn_res* delete_tuples(char* table_name, struct st_where* where_conditions);
opn_res* update(char* table_name, char* attribute_name, char* new_value, struct st_where* where_conditions);
opn_res* insert( char* table, char values[10][20]);
char* where(char* table_name, struct st_where* where_conditions);
char* join(char* table1,char* table2);
opn_res* select_result(char* table_name,int is_projection, char projection[10][20]);
// select * 时, is_projection = 0 , 否则 is_projection = 选择出来的数目
//返回表结果
opn_res* drop_index( char* index_name);
opn_res* drop_table( char* table_name);
opn_res * create_index(char* table_name, char* index_attribute, char* index_name);
void set_BufferManager(BufferManager* Buffer_Manager);
opn_res * create_table(struct table_info * table);
opn_res* select_sum(char* table_name, char* attribute);
opn_res* select_count(char* table_name, char* attribute);
opn_res* select_avg(char* table_name, char* attribute);
opn_res* select_min(char* table_name, char* attribute);
opn_res* select_max(char* table_name, char* attribute);
API();
virtual ~API();
private:
int check_projection(char attri_name[20] , int is_projection, char projection[10][20]);
char temp_table_names[10][20];
CatalogManager* CM;
int temp_table_count;
BufferManager* BM;
};
#endif // !defined(AFX_API_H__E8ACB069_AE71_42B2_B21C_50DBC39236B2__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -