My Project
stop.h
Go to the documentation of this file.
1 
7 #ifndef SRC_STOP_H_
8 #define SRC_STOP_H_
9 
10 #include <list>
11 #include <iostream>
12 #include <string>
13 
14 #include "src/bus.h"
15 #include "src/passenger.h"
16 
17 class Bus;
22 class Stop {
23  public:
28  explicit Stop(int, double = 44.973723, double = -93.235365);
34  int GetId() const;
42  int AddPassengers(Passenger *);
43  void Update();
44  void Report(std::ostream &out) const;
50  int LoadPassengers(Bus * bus);
56  double GetLong();
62  double GetLat();
68  std::string GetName();
74  size_t GetNumPassengers();
75 
76  private:
77  int id_;
78  std::list<Passenger *> passengers_; // considered array, vector, queue, list
79  double longitude_;
80  double latitude_; // are we using long/lat coords?
81  // derived information - not needed depending on passengers_
82  // data structure implementation?
83  // int passengers_present_;
84 };
85 #endif // SRC_STOP_H_
Stop
The main class to define stop.
Definition: stop.h:22
Stop::Stop
Stop(int, double=44.973723, double=-93.235365)
Constructs a stop with latitude and longitude.
Definition: stop.cc:12
Stop::AddPassengers
int AddPassengers(Passenger *)
Method to add passengers to the stop.
Definition: stop.cc:18
Stop::GetLong
double GetLong()
Getter of longitude.
Definition: stop.cc:48
Bus
The main class to define bus.
Definition: bus.h:28
Stop::GetLat
double GetLat()
Getter of latitude.
Definition: stop.cc:52
Stop::GetId
int GetId() const
Get if of the stops_.
Definition: stop.cc:44
Stop::GetName
std::string GetName()
Getter of stop name.
Definition: stop.cc:56
Passenger
The main class to define passenger.
Definition: passenger.h:17
Stop::LoadPassengers
int LoadPassengers(Bus *bus)
Method to load passenger on bus.
Definition: stop.cc:23
Stop::GetNumPassengers
size_t GetNumPassengers()
Getter of number of passengers.
Definition: stop.cc:60
passenger.h
bus.h