-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAttribute.h
More file actions
36 lines (30 loc) · 942 Bytes
/
Attribute.h
File metadata and controls
36 lines (30 loc) · 942 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
32
33
34
35
36
//
// Attribute.h
// minisql
//
// Created by 邓永辉 on 14/11/4.
// Copyright (c) 2014年 邓永辉. All rights reserved.
//
#ifndef minisql_Attribute_h
#define minisql_Attribute_h
#include <string>
#include <iostream>
using namespace std;
class Attribute
{
public:
string name;
int type; //the type of the attribute,-1 represents float, 0 represents int, other positive integer represents char and the value is the number of char)
bool ifUnique;
string index; // default value is "", representing no index
Attribute(string n, int t, bool i);//构造函数,name=n,type=t,ifUnique=i
public:
int static const TYPE_FLOAT = -1;
int static const TYPE_INT = 0;
string indexNameGet(){return index;}//判断是否有索引
void print()
{
cout << "name: " << name << ";type: " << type << ";ifUnique: " << ifUnique << ";index: " << index << endl;
}
};
#endif