StdAir Logo  0.44.0
C++ Standard Airline IT Object Library
AirlineClassList.cpp
Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 #include <sstream>
00007 // Boost.Serialization
00008 #include <boost/archive/text_iarchive.hpp>
00009 #include <boost/archive/text_oarchive.hpp>
00010 #include <boost/serialization/access.hpp>
00011 // StdAir
00012 #include <stdair/basic/BasConst_Inventory.hpp>
00013 #include <stdair/service/Logger.hpp>
00014 #include <stdair/bom/AirlineClassList.hpp>
00015 
00016 namespace stdair {
00017 
00018   // ////////////////////////////////////////////////////////////////////
00019   AirlineClassList::AirlineClassList()
00020     : _key (DEFAULT_AIRLINE_CODE_LIST, DEFAULT_CLASS_CODE_LIST),
00021       _parent (NULL)  {
00022     assert (false);
00023   }
00024 
00025   // ////////////////////////////////////////////////////////////////////
00026   AirlineClassList::AirlineClassList (const AirlineClassList& iACL)
00027     : _key (iACL._key), _parent (NULL)  {
00028     assert (false);
00029   }
00030 
00031   // ////////////////////////////////////////////////////////////////////
00032   AirlineClassList::AirlineClassList (const Key_T& iKey)
00033     : _key (iKey), _parent (NULL)  {
00034   }
00035 
00036   // ////////////////////////////////////////////////////////////////////
00037   AirlineClassList::~AirlineClassList() {
00038   }
00039   
00040   // ////////////////////////////////////////////////////////////////////
00041   std::string AirlineClassList::toString() const {
00042     std::ostringstream oStr;
00043     oStr << describeKey() << ", " << _yield <<  ", " << _fare;
00044     return oStr.str();
00045   }
00046 
00047   // ////////////////////////////////////////////////////////////////////
00048   void AirlineClassList::serialisationImplementationExport() const {
00049     std::ostringstream oStr;
00050     boost::archive::text_oarchive oa (oStr);
00051     oa << *this;
00052   }
00053 
00054   // ////////////////////////////////////////////////////////////////////
00055   void AirlineClassList::serialisationImplementationImport() {
00056     std::istringstream iStr;
00057     boost::archive::text_iarchive ia (iStr);
00058     ia >> *this;
00059   }
00060 
00061   // ////////////////////////////////////////////////////////////////////
00062   template<class Archive>
00063   void AirlineClassList::serialize (Archive& ioArchive,
00064                                     const unsigned int iFileVersion) {
00065     ioArchive & _key & _yield & _fare;
00066   }
00067 
00068 }
00069 
00070 
00071