AirSched Logo  0.1.4
C++ Simulated Airline Schedule Manager Library
ReachableUniverse.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/ReachableUniverse.hpp>
00015 #include <airsched/bom/SegmentPathPeriod.hpp>
00016 
00017 namespace AIRSCHED {
00018 
00019   // ////////////////////////////////////////////////////////////////////
00020   ReachableUniverse::ReachableUniverse()
00021     : _key (stdair::DEFAULT_ORIGIN), _parent (NULL) {
00022     assert (false);
00023   }
00024 
00025   // ////////////////////////////////////////////////////////////////////
00026   ReachableUniverse::ReachableUniverse (const ReachableUniverse&)
00027     : _key (stdair::DEFAULT_ORIGIN), _parent (NULL) {
00028     assert (false);
00029   }
00030 
00031   // ////////////////////////////////////////////////////////////////////
00032   ReachableUniverse::ReachableUniverse (const Key_T& iKey)
00033     : _key (iKey), _parent (NULL) {
00034   }
00035 
00036   // ////////////////////////////////////////////////////////////////////
00037   ReachableUniverse::~ReachableUniverse() {
00038   }
00039 
00040   // ////////////////////////////////////////////////////////////////////
00041   std::string ReachableUniverse::toString() const {
00042     std::ostringstream oStr;
00043     oStr << _key.toString();
00044     return oStr.str();
00045   }
00046   
00047   // ////////////////////////////////////////////////////////////////////
00048   void ReachableUniverse::serialisationImplementationExport() const {
00049     std::ostringstream oStr;
00050     boost::archive::text_oarchive oa (oStr);
00051     oa << *this;
00052   }
00053 
00054   // ////////////////////////////////////////////////////////////////////
00055   void ReachableUniverse::serialisationImplementationImport() {
00056     std::istringstream iStr;
00057     boost::archive::text_iarchive ia (iStr);
00058     ia >> *this;
00059   }
00060 
00061   // ////////////////////////////////////////////////////////////////////
00062   template<class Archive>
00063   void ReachableUniverse::serialize (Archive& ioArchive,
00064                                      const unsigned int iFileVersion) {
00065     ioArchive & _key;
00066   }
00067 
00068   // ////////////////////////////////////////////////////////////////////
00069   // Explicit template instantiation
00070   namespace ba = boost::archive;
00071   template
00072   void ReachableUniverse::serialize<ba::text_oarchive> (ba::text_oarchive&,
00073                                                         unsigned int);
00074   template
00075   void ReachableUniverse::serialize<ba::text_iarchive> (ba::text_iarchive&,
00076                                                         unsigned int);
00077   // ////////////////////////////////////////////////////////////////////
00078 
00079 }
00080