-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVehicle.cpp
More file actions
70 lines (55 loc) · 1.67 KB
/
Vehicle.cpp
File metadata and controls
70 lines (55 loc) · 1.67 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
#include "Vehicle.h"
using namespace std;
Vehicle::Vehicle(const std::string& license, const std::string& type, const std::string& color, const std::string& brand, const std::string& model, unsigned long long clientId)
: licensePlate(license), type(type), color(color), brand(brand), model(model), clientId(clientId){
}
std::string Vehicle::getLicensePlate() const {
return licensePlate;
}
std::string Vehicle::getType() const {
return type;
}
std::string Vehicle::getColor() const {
return color;
}
std::string Vehicle::getBrand() const {
return brand;
}
std::string Vehicle::getModel() const {
return model;
}
unsigned long long Vehicle::getClientId() const {
return clientId;
}
void Vehicle::setLicensePlate(const std::string& license) {
this->licensePlate = license;
}
void Vehicle::setType(const std::string& type) {
this->type = type;
}
void Vehicle::setColor(const std::string& color) {
this->color = color;
}
void Vehicle::setBrand(const std::string& brand) {
this->brand = brand;
}
void Vehicle::setModel(const std::string& model) {
this->model = model;
}
void Vehicle::setClientId(unsigned long long clientId) {
if (this->clientId == 0)
this->clientId = clientId;
else
cerr << getErrMsg(VH_CLIENT_ASSOCIATE) << endl;
}
void Vehicle::updateClientId(unsigned long long clientId) {
this->clientId = clientId;
}
std::ostream& operator<<(std::ostream& os, const Vehicle& vehicle) {
os << "Patente: " << vehicle.licensePlate << std::endl
<< "Tipo: " << vehicle.type << std::endl
<< "Color: " << vehicle.color << std::endl
<< "Marca: " << vehicle.brand << std::endl
<< "Modelo: " << vehicle.model;
return os;
}