My Project
passenger.h
Go to the documentation of this file.
1 
7 #ifndef SRC_PASSENGER_H_
8 #define SRC_PASSENGER_H_
9 
10 #include <iostream>
11 #include <string>
12 
17 class Passenger {
18  public:
27  explicit Passenger(int = -1, std::string = "Nobody");
31  void Update();
35  void GetOnBus();
39  int GetTotalWait() const;
47  bool IsOnBus() const;
53  int GetDestination() const;
57  void Report(std::ostream &out) const;
58 
59  private:
60  std::string name_;
61  int destination_stop_id_;
62  int wait_at_stop_;
63  int time_on_bus_;
64  int id_;
65  static int count_; // global count, used to set ID for new instances
66  bool on_bus_; // If true, passenger on bus
67 };
68 #endif // SRC_PASSENGER_H_
Passenger::GetOnBus
void GetOnBus()
Passenger getting on bus.
Definition: passenger.cc:29
Passenger::Report
void Report(std::ostream &out) const
Public reporter.
Definition: passenger.cc:45
Passenger::Passenger
Passenger(int=-1, std::string="Nobody")
Constructs a passenger with a standard name and id.
Definition: passenger.cc:17
Passenger::IsOnBus
bool IsOnBus() const
Method to decide if a passenger is on bus.
Definition: passenger.cc:37
Passenger::Update
void Update()
Method to update wait at stop.
Definition: passenger.cc:24
Passenger
The main class to define passenger.
Definition: passenger.h:17
Passenger::GetDestination
int GetDestination() const
Get destination id of the passenger.
Definition: passenger.cc:41
Passenger::GetTotalWait
int GetTotalWait() const
Total wait time on stop and on bus.
Definition: passenger.cc:33