-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.h
79 lines (70 loc) · 1.36 KB
/
base.h
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
#ifndef BASE_H
#define BASE_H
#include <iostream>
#include <string>
using std::cout;
using std::cin;
using std::endl;
using std::string;
#define first(L) L.first
#define last(L) L.last
#define next(P) P->next
#define prev(P) P->prev
#define info(P) P->info
#define relation(P) P->relation
#define nil NULL
// PARENT (DOCTOR)
typedef struct Doctor doctorInfo;
typedef struct ElmDoctor *doctorAddress;
// RELATION (TREATMENT)
typedef struct Treatment treatmentInfo;
typedef struct ElmTreatment *treatmentAddress;
// CHILD (PATIENT)
typedef struct Patient patientInfo;
typedef struct ElmPatient *patientAddress;
// PARENT (DOCTOR)
struct Doctor {
string name;
string speciality;
int age;
};
struct ElmDoctor {
doctorInfo info;
doctorAddress next;
treatmentAddress relation;
};
struct ListDoctor {
doctorAddress first;
};
// RELATION (TREATMENT)
struct Treatment {
string name;
float price;
int duration;
};
struct ElmTreatment {
treatmentInfo info;
treatmentAddress next;
doctorAddress doctor;
patientAddress patient;
};
struct ListTreatment {
treatmentAddress first;
};
// CHILD (PATIENT)
struct Patient {
string name;
string gender;
int age;
};
struct ElmPatient {
patientInfo info;
patientAddress prev;
patientAddress next;
treatmentAddress relation;
};
struct ListPatient {
patientAddress first;
patientAddress last;
};
#endif //BASE_H