$treeview $search $mathjax
StdAir Logo  1.00.1
$projectbrief
$projectbrief
$searchbox

stdair/bom/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),
00028       _parent (NULL),
00029       _yield(iACL._yield),
00030       _fare(iACL._fare) {
00031   }
00032 
00033   // ////////////////////////////////////////////////////////////////////
00034   AirlineClassList::AirlineClassList (const Key_T& iKey)
00035     : _key (iKey), _parent (NULL)  {
00036   }
00037 
00038   // ////////////////////////////////////////////////////////////////////
00039   AirlineClassList::~AirlineClassList() {
00040   }
00041   
00042   // ////////////////////////////////////////////////////////////////////
00043   std::string AirlineClassList::toString() const {
00044     std::ostringstream oStr;
00045     oStr << describeKey() << ", " << _yield <<  ", " << _fare;
00046     return oStr.str();
00047   }
00048 
00049   // ////////////////////////////////////////////////////////////////////
00050   void AirlineClassList::serialisationImplementationExport() const {
00051     std::ostringstream oStr;
00052     boost::archive::text_oarchive oa (oStr);
00053     oa << *this;
00054   }
00055 
00056   // ////////////////////////////////////////////////////////////////////
00057   void AirlineClassList::serialisationImplementationImport() {
00058     std::istringstream iStr;
00059     boost::archive::text_iarchive ia (iStr);
00060     ia >> *this;
00061   }
00062 
00063   // ////////////////////////////////////////////////////////////////////
00064   template<class Archive>
00065   void AirlineClassList::serialize (Archive& ioArchive,
00066                                     const unsigned int iFileVersion) {
00067     ioArchive & _key & _yield & _fare;
00068   }
00069 
00070 }
00071 
00072 
00073