-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstop.h
84 lines (76 loc) · 1.92 KB
/
stop.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
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
/**
* @file Bus.cc
*
* @copyright 2019 3081 Staff, All rights reserved.
*/
#ifndef SRC_STOP_H_
#define SRC_STOP_H_
#include <list>
#include <iostream>
#include "src/bus.h"
#include "src/passenger.h"
class Bus;
class Stop : public IObservable<StopData*>{
public:
/**
* @brief Constructs a stop with a id number, longitude, and latitude.
*
*
* @param[in] int holding an stop id number
* @param[in] double holding a stop longitude
* @param[in] double holding a stop latitude
*
*/
explicit Stop(int, double = 44.973723, double = -93.235365);
/**
* @brief Get stop id number
*
* @return integer
*/
int LoadPassengers(Bus *); // Removing passengers from stop
// and onto a bus
/**
* @brief Load and count passengers in a stop list onto bus
*
* @param[in] Bus pointer pointing at Bus class
*
* @return integer
*/
int AddPassengers(Passenger *); // Adding passengers
// to the stop (from the generator)
/**
* @brief Add passengers into the stop passengers list and return 1
*
* @param[in] Passenger pointer pointing at passenger
*
* @return integer
*/
void Update();
/**
* @brief print stops status as well as pasenger status at that stop
*/
int GetId() const;
/**
* @brief Get stop id number
*
* @return integer
*/
void Report(std::ostream&) const;
void Update2();
void UpdateStopData();
StopData GetStopData() const;
// Vis Getters
double GetLongitude() const { return longitude_; }
double GetLatitude() const { return latitude_; }
size_t GetNumPassengersPresent() { return passengers_.size(); }
private:
int id_;
std::list<Passenger *> passengers_; // considered array, vector, queue, list
double longitude_;
double latitude_; // are we using long/lat coords?
StopData stop_data_;
// derived information - not needed depending on passengers_
// data structure implementation?
// int passengers_present_;
};
#endif // SRC_STOP_H_