Go to the documentation of this file.00001
00002
00003
00004
00005 #include <cassert>
00006 #include <sstream>
00007
00008 #include <stdair/basic/BasConst_General.hpp>
00009 #include <stdair/bom/LegDate.hpp>
00010
00011 #include <airinv/bom/LegStruct.hpp>
00012
00013 namespace AIRINV {
00014
00015
00016 LegStruct::LegStruct ()
00017 : _boardingDate (stdair::DEFAULT_DATE), _offDate (stdair::DEFAULT_DATE) {
00018 }
00019
00020
00021 const std::string LegStruct::describe() const {
00022 std::ostringstream ostr;
00023 ostr << " " << _boardingPoint << " / " << _boardingDate << " "
00024 << boost::posix_time::to_simple_string(_boardingTime)
00025 << " -- " << _offPoint << " / " << _offDate << " "
00026 << boost::posix_time::to_simple_string(_offTime)
00027 << " --> "
00028 << boost::posix_time::to_simple_string(_elapsed)
00029 << std::endl;
00030 for (LegCabinStructList_T::const_iterator itCabin = _cabinList.begin();
00031 itCabin != _cabinList.end(); itCabin++) {
00032 const LegCabinStruct& lCabin = *itCabin;
00033 ostr << lCabin.describe();
00034 }
00035 ostr << std::endl;
00036
00037 return ostr.str();
00038 }
00039
00040
00041 void LegStruct::fill (const stdair::Date_T& iRefDate,
00042 stdair::LegDate& ioLegDate) const {
00043
00044 ioLegDate.setOffPoint (_offPoint);
00045
00046 ioLegDate.setBoardingDate (iRefDate + _boardingDateOffset);
00047
00048 ioLegDate.setBoardingTime (_boardingTime);
00049
00050 ioLegDate.setOffDate (iRefDate + _offDateOffset);
00051
00052 ioLegDate.setOffTime (_offTime);
00053
00054 ioLegDate.setElapsedTime (_elapsed);
00055 }
00056
00057
00058 void LegStruct::fill (stdair::LegDate& ioLegDate) const {
00059
00060 ioLegDate.setOffPoint (_offPoint);
00061
00062 ioLegDate.setBoardingDate (_offDate);
00063
00064 ioLegDate.setBoardingTime (_boardingTime);
00065
00066 ioLegDate.setOffDate (_offDate);
00067
00068 ioLegDate.setOffTime (_offTime);
00069
00070 ioLegDate.setElapsedTime (_elapsed);
00071 }
00072
00073 }