-
Notifications
You must be signed in to change notification settings - Fork 0
/
StationExam.h
81 lines (59 loc) · 1.15 KB
/
StationExam.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
80
81
#ifndef XAMINE_STATIONEXAM_H_
#define XAMINE_STATIONEXAM_H_
#include "Person.h"
#include "Station.h"
#include <time.h>
namespace Xamine {
class StationExam {
public:
StationExam() :
m_person(NULL),
m_station(NULL),
m_start(0),
m_end(0)
{
}
Person *getPerson() {
return m_person;
}
void setPerson(Person *person) {
m_person = person;
}
Station *getStation() {
return m_station;
}
void setStation(Station *station) {
m_station = station;
}
void start() {
time(&m_start);
}
void end() {
time(&m_end);
}
int getDuration() const {
return (int)(m_end - m_start);
}
bool hasPassed() const {
return m_passed;
}
bool hasStarted() const {
return getStart() != 0;
}
bool hasEnded() const {
return hasStarted() && getEnd() != 0;
}
private:
time_t getStart() const {
return m_start;
}
time_t getEnd() const {
return m_end;
}
Person *m_person;
Station *m_station;
time_t m_start, m_end;
bool m_passed;
};
}
#endif