AirSched Logo  0.1.4
C++ Simulated Airline Schedule Manager Library
OriginDestinationSetKey.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 // AirSched
00014 #include <airsched/bom/OriginDestinationSetKey.hpp>
00015 
00016 namespace AIRSCHED {
00017 
00018   // ////////////////////////////////////////////////////////////////////
00019   OriginDestinationSetKey::OriginDestinationSetKey()
00020     : _destination (stdair::DEFAULT_DESTINATION) {
00021     assert (false);
00022   }
00023 
00024   // ////////////////////////////////////////////////////////////////////
00025   OriginDestinationSetKey::
00026   OriginDestinationSetKey (const stdair::AirportCode_T& iDestination)
00027     : _destination (iDestination) {
00028   }
00029 
00030   // ////////////////////////////////////////////////////////////////////
00031   OriginDestinationSetKey::
00032   OriginDestinationSetKey (const OriginDestinationSetKey& iKey)
00033     : _destination (iKey._destination) {
00034   }
00035 
00036   // ////////////////////////////////////////////////////////////////////
00037   OriginDestinationSetKey::~OriginDestinationSetKey() {
00038   }
00039 
00040   // ////////////////////////////////////////////////////////////////////
00041   void OriginDestinationSetKey::toStream (std::ostream& ioOut) const {
00042     ioOut << "OriginDestinationSetKey: " << toString() << std::endl;
00043   }
00044 
00045   // ////////////////////////////////////////////////////////////////////
00046   void OriginDestinationSetKey::fromStream (std::istream& ioIn) {
00047   }
00048 
00049   // ////////////////////////////////////////////////////////////////////
00050   const std::string OriginDestinationSetKey::toString() const {
00051     std::ostringstream oStr;
00052     oStr << _destination;
00053     return oStr.str();
00054   }
00055 
00056   // ////////////////////////////////////////////////////////////////////
00057   void OriginDestinationSetKey::serialisationImplementationExport() const {
00058     std::ostringstream oStr;
00059     boost::archive::text_oarchive oa (oStr);
00060     oa << *this;
00061   }
00062 
00063   // ////////////////////////////////////////////////////////////////////
00064   void OriginDestinationSetKey::serialisationImplementationImport() {
00065     std::istringstream iStr;
00066     boost::archive::text_iarchive ia (iStr);
00067     ia >> *this;
00068   }
00069 
00070   // ////////////////////////////////////////////////////////////////////
00071   template<class Archive>
00072   void OriginDestinationSetKey::serialize (Archive& ioArchive,
00073                                            const unsigned int iFileVersion) {
00078     ioArchive & _destination;
00079   }
00080 
00081   // ////////////////////////////////////////////////////////////////////
00082   // Explicit template instantiation
00083   namespace ba = boost::archive;
00084   template
00085   void OriginDestinationSetKey::serialize<ba::text_oarchive> (ba::text_oarchive&,
00086                                                               unsigned int);
00087   template
00088   void OriginDestinationSetKey::serialize<ba::text_iarchive> (ba::text_iarchive&,
00089                                                               unsigned int);
00090   // ////////////////////////////////////////////////////////////////////
00091 
00092 }