StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
OptimisationNotificationStruct.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 #include <sstream>
7 // StdAir
9 
10 namespace stdair {
11 
12  // //////////////////////////////////////////////////////////////////////
13  OptimisationNotificationStruct::OptimisationNotificationStruct()
14  : _partySize (0), _stayDuration (0), _wtp (0.0), _valueOfTime (0.0) {
15  assert (false);
16  }
17 
18  // //////////////////////////////////////////////////////////////////////
19  OptimisationNotificationStruct::
20  OptimisationNotificationStruct (const OptimisationNotificationStruct& iOptimisationNotification)
21  : _origin (iOptimisationNotification._origin),
22  _destination (iOptimisationNotification._destination),
23  _pos (iOptimisationNotification._pos),
24  _preferredDepartureDate (iOptimisationNotification._preferredDepartureDate),
25  _notificationDateTime (iOptimisationNotification._notificationDateTime),
26  _preferredCabin (iOptimisationNotification._preferredCabin),
27  _partySize (iOptimisationNotification._partySize),
28  _channel (iOptimisationNotification._channel),
29  _tripType (iOptimisationNotification._tripType),
30  _stayDuration (iOptimisationNotification._stayDuration),
31  _frequentFlyerType (iOptimisationNotification._frequentFlyerType),
32  _preferredDepartureTime (iOptimisationNotification._preferredDepartureTime),
33  _wtp (iOptimisationNotification._wtp),
34  _valueOfTime (iOptimisationNotification._valueOfTime) {
35  }
36 
37  // //////////////////////////////////////////////////////////////////////
38  OptimisationNotificationStruct::
39  OptimisationNotificationStruct (const AirportCode_T& iOrigin,
40  const AirportCode_T& iDestination,
41  const CityCode_T& iPOS,
42  const Date_T& iDepartureDate,
43  const DateTime_T& iNotificationDateTime,
44  const CabinCode_T& iPreferredCabin,
45  const NbOfSeats_T& iPartySize,
46  const ChannelLabel_T& iChannel,
47  const TripType_T& iTripType,
48  const DayDuration_T& iStayDuration,
49  const FrequentFlyer_T& iFrequentFlyerType,
50  const Duration_T& iPreferredDepartureTime,
51  const WTP_T& iWTP,
52  const PriceValue_T& iValueOfTime)
53  : _origin (iOrigin), _destination (iDestination),
54  _pos (iPOS), _preferredDepartureDate (iDepartureDate),
55  _notificationDateTime (iNotificationDateTime),
56  _preferredCabin (iPreferredCabin), _partySize (iPartySize),
57  _channel (iChannel), _tripType (iTripType),
58  _stayDuration (iStayDuration), _frequentFlyerType (iFrequentFlyerType),
59  _preferredDepartureTime (iPreferredDepartureTime), _wtp (iWTP),
60  _valueOfTime (iValueOfTime) {
61  }
62 
63  // //////////////////////////////////////////////////////////////////////
65  }
66 
67  // //////////////////////////////////////////////////////////////////////
68  void OptimisationNotificationStruct::toStream (std::ostream& ioOut) const {
69  ioOut << describe();
70  }
71 
72  // //////////////////////////////////////////////////////////////////////
73  void OptimisationNotificationStruct::fromStream (std::istream& ioIn) {
74  }
75 
76  // //////////////////////////////////////////////////////////////////////
77  const std::string OptimisationNotificationStruct::describe() const {
78  std::ostringstream oStr;
79  oStr << "At " << _notificationDateTime
80  << ", for (" << _pos << ") " << _origin << "-" << _destination
81  << " " << _preferredDepartureDate << " " << _preferredCabin
82  << " " << _partySize << " " << _channel << " " << _tripType
83  << " " << _stayDuration << " " << _frequentFlyerType
84  << " " << _preferredDepartureTime << " " << _wtp
85  << " " << _valueOfTime;
86  return oStr.str();
87  }
88 
89 }
LocationCode_T AirportCode_T
std::string CabinCode_T
boost::posix_time::ptime DateTime_T
std::string TripType_T
Handle on the StdAir library context.
boost::posix_time::time_duration Duration_T
LocationCode_T CityCode_T
double PriceValue_T
double NbOfSeats_T
std::string FrequentFlyer_T
boost::gregorian::date Date_T
std::string ChannelLabel_T