OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
OPENTREP::LocationKey Struct Reference

Class modelling the primary key of a location/POR (point of reference). More...

#include <opentrep/LocationKey.hpp>

+ Inheritance diagram for OPENTREP::LocationKey:

Public Member Functions

const IATACode_TgetIataCode () const
 
const IATATypegetIataType () const
 
const GeonamesID_TgetGeonamesID () const
 
const IsGeonames_TisGeonames () const
 
void setIataCode (const std::string &iIataCode)
 
void setIataType (const IATAType &iIATAType)
 
void setGeonamesID (const GeonamesID_T &iGeonamesID)
 
void setIsGeonames (const IsGeonames_T &isGeonames)
 
void toStream (std::ostream &) const
 
void fromStream (std::istream &)
 
std::string toString () const
 
std::string describe () const
 
 LocationKey (const IATACode_T &, const IATAType &, const GeonamesID_T &)
 
 LocationKey (const LocationKey &)
 
 ~LocationKey ()
 
bool operator== (const LocationKey &) const
 
bool operator!= (const LocationKey &iLocationKey) const
 

Detailed Description

Class modelling the primary key of a location/POR (point of reference).

The primary key is composed of:

  • IATA 3-letter code. See IATACode_T for more details.
  • Travel type. See IATAType for more details.
  • Geonames ID, when referenced by Geonames (0 otherwise). See GeonamesID_T for more details.

Definition at line 29 of file LocationKey.hpp.

Constructor & Destructor Documentation

◆ LocationKey() [1/2]

OPENTREP::LocationKey::LocationKey ( const IATACode_T & iIataCode,
const IATAType & iIataType,
const GeonamesID_T & iGeonamesID )

Main constructor.

Definition at line 13 of file LocationKey.cpp.

References LocationKey().

Referenced by LocationKey(), LocationKey(), operator!=(), and operator==().

◆ LocationKey() [2/2]

OPENTREP::LocationKey::LocationKey ( const LocationKey & iLocationKey)

Default copy constructor.

Definition at line 32 of file LocationKey.cpp.

References LocationKey().

◆ ~LocationKey()

OPENTREP::LocationKey::~LocationKey ( )

Destructor.

Definition at line 39 of file LocationKey.cpp.

Member Function Documentation

◆ getIataCode()

const IATACode_T & OPENTREP::LocationKey::getIataCode ( ) const
inline

Get the IATA code.

Definition at line 35 of file LocationKey.hpp.

Referenced by OPENTREP::Result::calculateCodeMatches(), and OPENTREP::LocationExchange::exportLocation().

◆ getIataType()

const IATAType & OPENTREP::LocationKey::getIataType ( ) const
inline

Get the IATA location type (e.g., A for airport).

Definition at line 42 of file LocationKey.hpp.

Referenced by OPENTREP::LocationExchange::exportLocation().

◆ getGeonamesID()

const GeonamesID_T & OPENTREP::LocationKey::getGeonamesID ( ) const
inline

Get the Geonames ID.

Definition at line 49 of file LocationKey.hpp.

Referenced by OPENTREP::LocationExchange::exportLocation().

◆ isGeonames()

const IsGeonames_T & OPENTREP::LocationKey::isGeonames ( ) const
inline

State whether that POR is referenced by Geonames.

Definition at line 56 of file LocationKey.hpp.

Referenced by setIsGeonames().

◆ setIataCode()

void OPENTREP::LocationKey::setIataCode ( const std::string & iIataCode)
inline

Set the IATA code.

Definition at line 66 of file LocationKey.hpp.

◆ setIataType()

void OPENTREP::LocationKey::setIataType ( const IATAType & iIATAType)
inline

Set the IATA location type (e.g., A for airport).

Definition at line 73 of file LocationKey.hpp.

◆ setGeonamesID()

void OPENTREP::LocationKey::setGeonamesID ( const GeonamesID_T & iGeonamesID)
inline

Set the Geonames ID.

Definition at line 80 of file LocationKey.hpp.

◆ setIsGeonames()

void OPENTREP::LocationKey::setIsGeonames ( const IsGeonames_T & isGeonames)
inline

Set the Geonames flag.

Definition at line 87 of file LocationKey.hpp.

References isGeonames().

◆ toStream()

void OPENTREP::LocationKey::toStream ( std::ostream & ioOut) const
virtual

Dump the structure into an output stream.

Parameters
ostream&the output stream.

Implements OPENTREP::OPENTREP_Abstract.

Definition at line 67 of file LocationKey.cpp.

References toString().

◆ fromStream()

void OPENTREP::LocationKey::fromStream ( std::istream & ioIn)
virtual

Read a structure from an input stream.

Parameters
istream&the input stream.

Implements OPENTREP::OPENTREP_Abstract.

Definition at line 72 of file LocationKey.cpp.

◆ toString()

std::string OPENTREP::LocationKey::toString ( ) const
virtual

Get the serialised version of the structure.

Implements OPENTREP::OPENTREP_Abstract.

Definition at line 60 of file LocationKey.cpp.

References describe().

Referenced by OPENTREP::DBManager::insertPlaceInDB(), and toStream().

◆ describe()

std::string OPENTREP::LocationKey::describe ( ) const

Get a string describing the whole key (differentiating two objects at any level).

Definition at line 51 of file LocationKey.cpp.

Referenced by toString().

◆ operator==()

bool OPENTREP::LocationKey::operator== ( const LocationKey & iLocationKey) const

Comparison operator.

Definition at line 43 of file LocationKey.cpp.

References LocationKey().

◆ operator!=()

bool OPENTREP::LocationKey::operator!= ( const LocationKey & iLocationKey) const
inline

Comparison operator.

Definition at line 145 of file LocationKey.hpp.

References LocationKey().


The documentation for this struct was generated from the following files: