-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDriver.h
More file actions
195 lines (163 loc) · 3.59 KB
/
Driver.h
File metadata and controls
195 lines (163 loc) · 3.59 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#ifndef EX2_DRIVER_H
#define EX2_DRIVER_H
#include "Node.h"
#include "Taxi.h"
#include "Trip.h"
#include <boost/archive/xml_oarchive.hpp>
#include <boost/archive/xml_iarchive.hpp>
#include <iostream>
#include <fstream>
#include <boost/serialization/serialization.hpp>
enum maritalStatus {SINGLE, MARRIED, DIVORCED, WIDOWED};
//Class for driver.
//With some members.
class Driver {
private:
Taxi* taxi;
Trip* trip;
int id;
int age;
maritalStatus mStatus;
int yOfExp;
int avgSatisfaction;
Node* location;
int vehicle_id;
public:
/**
* constructor for Driver.
*
* @param id
* @param age
* @param mStatus
* @param yOfExp
* @param location
*/
Driver(int id, int age, maritalStatus mStatus, int yOfExp, Node *location);
/**
* constructor for Driver.
*
* @param id
* @param age
* @param mrStatus
* @param yOfExp
* @param vehicle_id
*/
Driver(int id, int age, char mrStatus, int yOfExp, int vehicle_id);
/**
* constructor for Driver.
*
* @param id
* @param age
* @param mrStatus
* @param yOfExp
* @param vehicle_id
* @param locationD
*/
Driver(int id, int age, char mrStatus, int yOfExp, int vehicle_id, Node* locationD);
Driver(Driver* newDriver);
Driver();
/**
* Distructor for Driver.
*/
virtual ~Driver();
/**
* getting driver's taxi.
* @return Taxi*
*/
Taxi *getTaxi() const;
/**
* setting driver's taxi.
* @param taxi
*/
void setTaxi(Taxi *taxi);
/**
* get driver's id.
* @return int
*/
int getId() const;
/**
* setting driver's id.
* @param id
*/
void setId(int id);
/**
* getting driver's age.
* @return int
*/
int getAge() const;
/**
* setting driver's age.
* @param age
*/
void setAge(int age);
/**
* driver's marital status.
* @return maritalStatus
*/
maritalStatus getMStatus() const;
/**
* setting driver's marital status.
* @param mStatus
*/
void setMStatus(maritalStatus mStatus);
/**
* driver's years of experience.
* @return int
*/
int getYOfExp() const;
/**
* setting driver's years of experience.
* @param yOfExp
*/
void setYOfExp(int yOfExp);
/**
* average satisfaction.
* @return int
*/
int getAvgSatisfaction() const;
/**
* setting average satisfaction.
* @param avgSatisfaction
*/
void setAvgSatisfaction(int avgSatisfaction);
/**
* driver's location.
* @return Node*
*/
Node *getLocation() const;
/**
* setting driver's location.
* @param location
*/
void setLocation(Node *location);
/**
* get driver's trip.
* @return Trip
*/
Trip *getTrip() const;
/**
* setting Driver's trip.
* @param trip
*/
void setTrip(Trip *trip);
/**
* printing driver location.
*/
void printLocation();
/**
* clearing the trip.
*/
void clearTrip();
template<class Archive>
void serialize(Archive& archive, const unsigned int version)
{
archive & BOOST_SERIALIZATION_NVP(taxi);
archive & BOOST_SERIALIZATION_NVP(id);
archive & BOOST_SERIALIZATION_NVP(age);
archive & BOOST_SERIALIZATION_NVP(mStatus);
archive & BOOST_SERIALIZATION_NVP(yOfExp);
archive & BOOST_SERIALIZATION_NVP(location);
archive & BOOST_SERIALIZATION_NVP(vehicle_id);
}
};
#endif //EX2_DRIVER_H