AirSched Logo  0.1.4
C++ Simulated Airline Schedule Manager Library
SegmentStruct.cpp
Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 #include <sstream>
00007 // STDAIR
00008 #include <stdair/bom/SegmentDate.hpp>
00009 // AIRSCHED
00010 #include <airsched/bom/SegmentStruct.hpp>
00011 
00012 namespace AIRSCHED {
00013 
00014   // //////////////////////////////////////////////////////////////////////
00015   const std::string SegmentStruct::describe() const {
00016     std::ostringstream ostr;
00017     ostr << "    " << _boardingPoint << " / "
00018          << boost::posix_time::to_simple_string(_boardingTime)
00019          << " -- " << _offPoint << " / "
00020          << boost::posix_time::to_simple_string(_offTime)
00021          << " --> "
00022          << boost::posix_time::to_simple_string(_elapsed)
00023          << std::endl;
00024     for (SegmentCabinStructList_T::const_iterator itCabin =
00025            _cabinList.begin(); itCabin != _cabinList.end(); itCabin++) {
00026       const SegmentCabinStruct& lCabin = *itCabin;
00027       ostr << lCabin.describe();
00028     }
00029     ostr << std::endl;
00030     
00031     return ostr.str();
00032   }
00033 
00034   // //////////////////////////////////////////////////////////////////////
00035   void SegmentStruct::fill (stdair::SegmentDate& ioSegmentDate) const {
00036     // Note that some parameters (boarding date, boarding time, off
00037     // date, off time, elapsed time) are set by
00038     // SegmentDate::fillFromRouting() when the routing (with legs) is
00039     // built. So, it is useless to set those parameters here.
00040 
00041     // At that time, there are no other parameters.
00042   }
00043 
00044 }