/
USTHClass.cpp
94 lines (87 loc) · 2.14 KB
/
USTHClass.cpp
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
85
86
87
88
89
90
91
92
93
94
#include "USTHClass.h"
USTHClass::USTHClass() {
id = 0;
subjectID = 0;
lecturerID = 0;
time_t rawtime;
//time(&rawtime);
begin_time = *localtime(&rawtime);
end_time = *localtime(&rawtime);
class_room = "";
semester = 0;
}
USTHClass::~USTHClass() {
id = 0;
subjectID = 0;
lecturerID = 0;
time_t rawtime;
//time(&rawtime);
begin_time = *localtime(&rawtime);
end_time = *localtime(&rawtime);
class_room = "";
semester = 0;
}
USTHClass::USTHClass(int id, int subjectID, int lecturerID,
Date begin_time, Date end_time,
Room class_room, int semester) {
this->id = id;
this->subjectID = subjectID;
this->lecturerID = lecturerID;
this->begin_time = begin_time;
this->end_time = end_time;
this->class_room = class_room;
this->semester = semester;
}
void USTHClass::Print() {
cout << "classID: " << id << endl;
cout << "subjectID: " << subjectID << endl;
cout << "lecturerID: " << lecturerID << endl;
cout << "start time: " << asctime(&begin_time);
cout << "end time: " << asctime(&end_time);
cout << "class room: " << class_room;
//cout << endl << &begin_time << &end_time;
}
void USTHClass::ShortPrint() {
cout << id << endl;
cout << "subjectID: " << subjectID << endl;
cout << "lecturerID: " << lecturerID << endl;
cout << "start time: " << asctime(&begin_time);
cout << "end time: " << asctime(&end_time);
cout << "class room: " << class_room;
}
void USTHClass::Set_id(int id) {
this->id = id;
}
void USTHClass::Set_subjectID(int subjectID) {
this->subjectID = subjectID;
}
void USTHClass::Set_lecturerID(int lecturerID) {
this->lecturerID = lecturerID;
}
void USTHClass::Set_begin_time(Date begin_time) {
this->begin_time =begin_time;
}
void USTHClass::Set_end_time(Date end_time) {
this->end_time = end_time;
}
void USTHClass::Set_class_room(Room class_room) {
this->class_room = class_room;
}
int USTHClass::Get_id() {
return id;
}
int USTHClass::Get_subjectID() {
return subjectID;
}
int USTHClass::Get_lecturerID() {
return lecturerID;
}
Date USTHClass::Get_begin_time() {
return begin_time;
}
Date USTHClass::Get_end_time() {
return end_time;
}
Room USTHClass::Get_class_room() {
return class_room;
}