OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
LocationKey.hpp
Go to the documentation of this file.
1#ifndef __OPENTREP_LOCATIONKEY_HPP
2#define __OPENTREP_LOCATIONKEY_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <iosfwd>
9#include <string>
10// OpenTrep
13#include <opentrep/IATAType.hpp>
14
15namespace OPENTREP {
16
30 public:
31 // //////////////// Getters ///////////////
35 const IATACode_T& getIataCode() const {
36 return _iataCode;
37 }
38
42 const IATAType& getIataType() const {
43 return _iataType;
44 }
45
49 const GeonamesID_T& getGeonamesID() const {
50 return _geonamesID;
51 }
52
56 const IsGeonames_T& isGeonames() const {
57 return _isGeonames;
58 }
59
60
61 public:
62 // ////////////////// Setters /////////////////
66 void setIataCode (const std::string& iIataCode) {
67 _iataCode = IATACode_T (iIataCode);
68 }
69
73 void setIataType (const IATAType& iIATAType) {
74 _iataType = iIATAType;
75 }
76
80 void setGeonamesID (const GeonamesID_T& iGeonamesID) {
81 _geonamesID = iGeonamesID;
82 }
83
88 _isGeonames = isGeonames;
89 }
90
91
92 public:
93 // ////////////// Display methods //////////////
99 void toStream (std::ostream&) const;
100
106 void fromStream (std::istream&);
107
111 std::string toString() const;
112
117 std::string describe() const;
118
119
120 public:
121 // ////////////// Constructors and destructors //////////////
125 LocationKey (const IATACode_T&, const IATAType&, const GeonamesID_T&);
126
130 LocationKey (const LocationKey&);
131
135 ~LocationKey();
136
140 bool operator== (const LocationKey&) const;
141
145 bool operator!= (const LocationKey& iLocationKey) const {
146 return !(iLocationKey == *this);
147 }
148
149 private:
153 LocationKey();
154
155
156 private:
157 // //////////////////// Attributes ///////////////////////
163 IATACode_T _iataCode;
164
170 IATAType _iataType;
171
177 GeonamesID_T _geonamesID;
178
182 IsGeonames_T _isGeonames;
183 };
184
185}
186#endif // __OPENTREP_LOCATIONKEY_HPP
unsigned int GeonamesID_T
Enumeration of place/location types with respect to their use for transportation purposes.
Definition IATAType.hpp:42
Class modelling the primary key of a location/POR (point of reference).
void toStream(std::ostream &) const
void setIataCode(const std::string &iIataCode)
const IATAType & getIataType() const
std::string describe() const
void setGeonamesID(const GeonamesID_T &iGeonamesID)
LocationKey(const IATACode_T &, const IATAType &, const GeonamesID_T &)
std::string toString() const
void setIataType(const IATAType &iIATAType)
const IATACode_T & getIataCode() const
void setIsGeonames(const IsGeonames_T &isGeonames)
bool operator==(const LocationKey &) const
const GeonamesID_T & getGeonamesID() const
void fromStream(std::istream &)
const IsGeonames_T & isGeonames() const
bool operator!=(const LocationKey &iLocationKey) const