-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAddress.cpp
86 lines (66 loc) · 1.64 KB
/
Address.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
#include "Address.h"
#include "AddressPrivate.h"
#include <QHash>
Address::Address() :
d(new AddressPrivate)
{
}
Address::Address(const Address& other) :
d(other.d)
{
}
QString Address::houseNumber() const {
return d->houseNumber;
}
Street Address::street() const {
return d->street;
}
QString Address::city() const {
return d->city;
}
int Address::zipCode() const {
return d->zipCode;
}
QSharedPointer<geos::geom::Point> Address::coordinate() const {
return d->coordinate;
}
Address::AddressType Address::addressType() const {
return d->addressType;
}
bool Address::allowStructural() const {
return d->allowStructural;
}
void Address::setHouseNumber(QString houseNumber) {
d->houseNumber = houseNumber;
}
void Address::setStreet(Street street) {
d->street = street;
}
void Address::setCity(QString city) {
d->city = city;
}
void Address::setZipCode(int zipCode) {
d->zipCode = zipCode;
}
void Address::setCoordinate(QSharedPointer<geos::geom::Point> coordinate) {
d->coordinate = coordinate;
}
void Address::setAddressType(AddressType addressType) {
d->addressType = addressType;
}
void Address::setAllowStructural(bool allowStructural) {
d->allowStructural = allowStructural;
}
Address& Address::operator=(const Address& other) {
d = other.d;
return *this;
}
Address::~Address() {
}
uint qHash(const Address& key) {
return qHash(key.houseNumber()) ^ qHash(key.street().name());
}
bool operator==(const Address& address1, const Address& address2) {
return address1.houseNumber() == address2.houseNumber()
&& address1.street().name() == address2.street().name();
}