Bridges-C++  3.4.5-dev1-6-g935685a
Bridges(C++ API)
City.h
Go to the documentation of this file.
1 #ifndef CITY_H
2 
3 #define CITY_H
4 
5 #include <string>
6 
7 using std::string;
8 
9 namespace bridges {
10  namespace dataset {
11 
29  class City {
30 
31  private:
32  string city, state, country, time_zone;
33  int elevation, population;
34  float latit, longit; // city location
35 
36  public:
40  City() = default;
41 
42  City (string cty, string st, string cntry, string tm_zone,
43  int elev, int pop, float lat, float lon) {
44  city = cty;
45  state = st;
46  country = cntry;
47  time_zone = tm_zone;
48  elevation = elev;
49  population = pop;
50  latit = lat;
51  longit = lon;
52  }
53 
54  string getCity() const {
55  return city;
56  }
57 
58  void setCity(string c) {
59  city = c;
60  }
61 
62  string getState() const {
63  return state;
64  }
65 
66  void setState(string st) {
67  state = st;
68  }
69 
70  string getCountry() const {
71  return country;
72  }
73 
74  void setCountry(string cntry) {
75  country = cntry;
76  }
77 
78  string getTimeZone() const {
79  return time_zone;
80  }
81 
82  void setTimeZone(string tz) {
83  time_zone = tz;
84  }
85 
86  float getLatitude() const {
87  return latit;
88  }
89 
90  void setLatitude(float lat) {
91  latit = lat;
92  }
93 
94  float getLongitude() const {
95  return longit;
96  }
97 
98  void setLongitude(float lon) {
99  longit = lon;
100  }
101  float getPopulation()const {
102  return population;
103  }
104 
105  void setPopulation(int pop) {
106  population = pop;
107  }
108 
109  int getElevation() const {
110  return elevation;
111  }
112 
113  void setElevation(int elev) {
114  elevation = elev;
115  }
116  };
117  };
118 };
119 #endif
Class that holds data of a city.
Definition: City.h:29
void setLongitude(float lon)
Definition: City.h:98
void setLatitude(float lat)
Definition: City.h:90
string getTimeZone() const
Definition: City.h:78
void setElevation(int elev)
Definition: City.h:113
void setTimeZone(string tz)
Definition: City.h:82
void setCity(string c)
Definition: City.h:58
int getElevation() const
Definition: City.h:109
float getLongitude() const
Definition: City.h:94
string getCity() const
Definition: City.h:54
City(string cty, string st, string cntry, string tm_zone, int elev, int pop, float lat, float lon)
Definition: City.h:42
string getCountry() const
Definition: City.h:70
float getPopulation() const
Definition: City.h:101
void setState(string st)
Definition: City.h:66
float getLatitude() const
Definition: City.h:86
string getState() const
Definition: City.h:62
void setPopulation(int pop)
Definition: City.h:105
void setCountry(string cntry)
Definition: City.h:74
Support for drawing Bar charts.
Definition: alltypes.h:4