StdAir Logo  0.43.0
C++ Standard Airline IT Library
PosChannelKey.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_Request.hpp>
00010 #include <stdair/bom/PosChannelKey.hpp>
00011 
00012 namespace stdair {
00013 
00014   // ////////////////////////////////////////////////////////////////////
00015   PosChannelKey::PosChannelKey()
00016     : _pos (DEFAULT_POS),
00017       _channel (DEFAULT_CHANNEL) {
00018     assert (false);
00019   }
00020 
00021   // ////////////////////////////////////////////////////////////////////
00022   PosChannelKey::PosChannelKey (const CityCode_T& iPos,
00023                                 const ChannelLabel_T& iChannel)
00024     : _pos (iPos), _channel(iChannel) {
00025   }
00026 
00027   // ////////////////////////////////////////////////////////////////////
00028   PosChannelKey::PosChannelKey (const PosChannelKey& iKey)
00029     : _pos (iKey._pos), _channel (iKey._channel) {
00030   }
00031 
00032   // ////////////////////////////////////////////////////////////////////
00033   PosChannelKey::~PosChannelKey () {
00034   }
00035 
00036   // ////////////////////////////////////////////////////////////////////
00037   void PosChannelKey::toStream (std::ostream& ioOut) const {
00038     ioOut << "PosChannelKey: " << toString() << std::endl;
00039   }
00040 
00041   // ////////////////////////////////////////////////////////////////////
00042   void PosChannelKey::fromStream (std::istream& ioIn) {
00043   }
00044 
00045   // ////////////////////////////////////////////////////////////////////
00046   const std::string PosChannelKey::toString() const {
00047     std::ostringstream oStr;
00048     oStr << _pos << DEFAULT_KEY_SUB_FLD_DELIMITER
00049          << " " << _channel; 
00050     return oStr.str();
00051   }
00052 
00053 }