AirInv Logo  1.00.0
C++ Simulated Airline Inventory Management System library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SegmentStruct.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 // STDAIR
7 #include <stdair/bom/SegmentDate.hpp>
8 // AIRINV
10 
11 namespace AIRINV {
12 
13  // //////////////////////////////////////////////////////////////////////
14  const std::string SegmentStruct::describe() const {
15  std::ostringstream ostr;
16 
17  ostr << " " << _boardingPoint << " / "
18  << boost::posix_time::to_simple_string(_boardingTime)
19  << " -- " << _offPoint << " / "
20  << boost::posix_time::to_simple_string(_offTime)
21  << " --> "
22  << boost::posix_time::to_simple_string(_elapsed)
23  << std::endl;
24 
25  for (SegmentCabinStructList_T::const_iterator itCabin =
26  _cabinList.begin(); itCabin != _cabinList.end(); itCabin++) {
27  const SegmentCabinStruct& lCabin = *itCabin;
28  ostr << lCabin.describe();
29  }
30  ostr << std::endl;
31 
32  return ostr.str();
33  }
34 
35  // //////////////////////////////////////////////////////////////////////
36  void SegmentStruct::fill (stdair::SegmentDate& ioSegmentDate) const {
37  // Set the Boarding Date
38  ioSegmentDate.setBoardingDate (_offDate);
39  // Set the Boarding Time
40  ioSegmentDate.setBoardingTime (_boardingTime);
41  // Set the Off Date
42  ioSegmentDate.setOffDate (_offDate);
43  // Set the Off Time
44  ioSegmentDate.setOffTime (_offTime);
45  // Set the Elapsed Time
46  ioSegmentDate.setElapsedTime (_elapsed);
47  }
48 
49 }