StdAir Logo  0.44.0
C++ Standard Airline IT Object Library
AirportPairKey.cpp
Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <ostream>
00006 #include <sstream>
00007 // STDAIR
00008 #include <stdair/basic/BasConst_BomDisplay.hpp>
00009 #include <stdair/basic/BasConst_Inventory.hpp>
00010 #include <stdair/bom/AirportPairKey.hpp>
00011 
00012 namespace stdair {
00013 
00014   // ////////////////////////////////////////////////////////////////////
00015   AirportPairKey::AirportPairKey ()
00016     : _boardingPoint (DEFAULT_ORIGIN), 
00017       _offPoint (DEFAULT_DESTINATION) {
00018     assert (false);
00019   }
00020 
00021   // ////////////////////////////////////////////////////////////////////
00022   AirportPairKey::AirportPairKey (const AirportCode_T& iBoardingPoint,
00023                                   const AirportCode_T& iOffPoint)
00024     : _boardingPoint (iBoardingPoint), _offPoint (iOffPoint) {
00025   }
00026 
00027   // ////////////////////////////////////////////////////////////////////
00028   AirportPairKey::AirportPairKey (const AirportPairKey& iKey)
00029     : _boardingPoint (iKey._boardingPoint),
00030       _offPoint (iKey._offPoint) {
00031   }
00032 
00033   // ////////////////////////////////////////////////////////////////////
00034   AirportPairKey::~AirportPairKey () {
00035   }
00036 
00037   // ////////////////////////////////////////////////////////////////////
00038   void AirportPairKey::toStream (std::ostream& ioOut) const {
00039     ioOut << "AirportPairKey: " << toString() << std::endl;
00040   }
00041 
00042   // ////////////////////////////////////////////////////////////////////
00043   void AirportPairKey::fromStream (std::istream& ioIn) {
00044   }
00045 
00046   // ////////////////////////////////////////////////////////////////////
00047   const std::string AirportPairKey::toString() const {
00048     std::ostringstream oStr;
00049     oStr << _boardingPoint << DEFAULT_KEY_SUB_FLD_DELIMITER
00050          << " " << _offPoint; 
00051     return oStr.str();
00052   }
00053 
00054 }