-
Notifications
You must be signed in to change notification settings - Fork 0
/
structure.hpp
84 lines (59 loc) · 1.48 KB
/
structure.hpp
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
RIGHT TO USE, DISTRIBUTE AND MODIFY
===================================
Copyright (C) 2015 Ganesh Prasad Sahoo - All Rights Reserved
You may use, distribute and modify this code under the Terms
of GNU GPL V3 License. You should have received a copy of the
GNU GPL v3 License with this file. If not please write to
sir.gnsp@gmail.com
or visit
http://www.gnu.org/licenses/gpl.txt
*****************************************************************************
*/
#ifndef ER_MARKUP_STRUCTURE_HPP_
#define ER_MARKUP_STRUCTURE_HPP_
#include "includes.hpp"
using namespace std;
enum AttrType { _NONE_ = 5543, _MULTI, _COMPOSITE, _KEY, _DERIVED};
struct Attribute{
char name_[100];
vector<AttrType> type_;
vector<Attribute> attr_;
int node_no_;
void printDot(ofstream &fout, int parent);
Attribute():node_no_(nodeCounter++){}
void destruct(){
vector<AttrType>().swap(type_);
vector<Attribute>().swap(attr_);
}
};
struct Entity{
char name_[100];
bool weak_;
vector<Attribute> attr_;
int node_no_;
void printDot(ofstream &fout);
Entity():node_no_(nodeCounter++){}
};
struct Edge{
char ent_[100];
bool weak_;
bool complete_;
bool normal_;
bool many_;
void printDot(ofstream &fout, int parent);
};
struct Relation{
char name_[100];
bool weak_;
vector<Edge> from_;
vector<Edge> to_;
int node_no_;
void printDot(ofstream &fout);
Relation():node_no_(nodeCounter++){weak_=false;}
};
struct ER_Diagram{
char name_[100];
vector<Relation> graph_;
};
#endif