-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDatabase.h
35 lines (29 loc) · 989 Bytes
/
Database.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
#pragma once
#include <string>
#include <vector>
#include "Passenger.h"
#include "Flight.h"
namespace AirlineApp {
const int kFirstTicketNumber = 1000;
const int kFirstFlightNumber = 100;
const int kFirstDepartureTime = 5;
const int kFirstArrivalTime = 6;
const int kSeatNumber = 1;
class Database {
public:
Passenger& addPassenger(Flight& flight, const std::string& firstName, const std::string& lastName);
Passenger& getPassenger(int ticketNumber);
Passenger& getPassenger(const std::string& firstName, const std::string& lastName);
Flight& addFlight();
Flight& getFlight(int flightNumber);
void printFlights() const;
private:
std::vector<Passenger> mPassengers;
std::vector<Flight> mFlights;
int mNextTicketNumber = kFirstTicketNumber;
int mNextFlightNumber = kFirstFlightNumber;
int mNextDepartureTime = kFirstDepartureTime;
int mNextArrivalTime = kFirstArrivalTime;
int mSeatNumber = kSeatNumber;
};
}