-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPerson.cpp
85 lines (72 loc) · 1.3 KB
/
Person.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
#include "Person.h"
Person::Person(std::string arg_SSN, std::string arg_name, GPS_DD arg_home)
{
this->SSN = arg_SSN;
this->name = arg_name;
this->home = arg_home;
}
Person::Person()
{
this->SSN = "";
this->name = "";
this->home = GPS_DD {};
}
void
Person::setHome
(GPS_DD arg_home)
{
this->home = arg_home;
}
void
Person::setCurrentLocation
(GPS_DD arg_location, JvTime arg_time)
{
this->location = arg_location;
this->since_when = arg_time;
}
GPS_DD
Person::getHome
(void)
{
return this->home;
}
std::string
Person::getSSN()
{
return this->SSN;
}
std::string
Person::getName()
{
return this->name;
}
bool
Person::operator==
(Person& aPerson)
{
// if I change the internal value of aPerson here, then this change will be observed.
return (this->SSN == aPerson.getSSN());
}
int
Person::operator==
(Person bPerson)
{
// if I change the internal value of aPerson here, then this change will be observed.
return 5;
}
double
Person::operator-
(GPS_DD& aLocation)
{
return (this->location - aLocation);
}
void Person::dump
(void)
{
std::cout << "dump Person" << std::endl;
std::cout << " {" << std::endl;
std::cout << " name = " << this->name << std::endl;
std::cout << " SSN = " << this->SSN << std::endl;
std::cout << " }" << std::endl;
return;
}