8 #include <boost/date_time/gregorian/formatters.hpp>
9 #include <boost/date_time/posix_time/posix_time.hpp>
18 BookingRequestStruct::BookingRequestStruct()
36 BookingRequestStruct::
38 : _generatorKey (iBookingRequest._generatorKey),
39 _origin (iBookingRequest._origin),
40 _destination (iBookingRequest._destination),
41 _pos (iBookingRequest._pos),
42 _preferredDepartureDate (iBookingRequest._preferredDepartureDate),
43 _preferredDepartureTime (iBookingRequest._preferredDepartureTime),
44 _requestDateTime (iBookingRequest._requestDateTime),
45 _preferredCabin (iBookingRequest._preferredCabin),
46 _partySize (iBookingRequest._partySize),
47 _channel (iBookingRequest._channel),
48 _tripType (iBookingRequest._tripType),
49 _stayDuration (iBookingRequest._stayDuration),
50 _frequentFlyerType (iBookingRequest._frequentFlyerType),
51 _wtp (iBookingRequest._wtp),
52 _valueOfTime (iBookingRequest._valueOfTime) {
56 BookingRequestStruct::
61 const Date_T& iDepartureDate,
72 : _generatorKey (iGeneratorKey), _origin (iOrigin),
73 _destination (iDestination), _pos (iPOS),
74 _preferredDepartureDate (iDepartureDate),
75 _preferredDepartureTime (iPreferredDepartureTime),
76 _requestDateTime (iRequestDateTime),
77 _preferredCabin (iPreferredCabin), _partySize (iPartySize),
78 _channel (iChannel), _tripType (iTripType),
79 _stayDuration (iStayDuration), _frequentFlyerType (iFrequentFlyerType),
80 _wtp (iWTP), _valueOfTime (iValueOfTime) {
84 BookingRequestStruct::
88 const Date_T& iDepartureDate,
99 : _generatorKey (
""), _origin (iOrigin),
100 _destination (iDestination), _pos (iPOS),
101 _preferredDepartureDate (iDepartureDate),
102 _preferredDepartureTime (iPreferredDepartureTime),
103 _requestDateTime (iRequestDateTime),
104 _preferredCabin (iPreferredCabin), _partySize (iPartySize),
105 _channel (iChannel), _tripType (iTripType),
106 _stayDuration (iStayDuration), _frequentFlyerType (iFrequentFlyerType),
107 _wtp (iWTP), _valueOfTime (iValueOfTime) {
125 std::ostringstream oStr;
126 oStr <<
"At " << _requestDateTime
127 <<
", for (" << _pos <<
", " << _channel <<
")"
128 <<
" " << _origin <<
"-" << _destination <<
" (" << _tripType <<
")"
129 <<
" " << _preferredDepartureDate <<
" (" << _stayDuration <<
" days)"
130 <<
" " << _preferredDepartureTime
131 <<
" " << _preferredCabin <<
" " << _partySize
132 <<
" " << _frequentFlyerType <<
" " << _wtp <<
" " << _valueOfTime;
138 const int dInt = iInt -
static_cast<int> (iInt / 100) * 100;
140 oStream <<
"0" << dInt;
148 std::ostringstream oStr;
151 const Date_T& lRequestDate = _requestDateTime.date();
152 oStr << boost::gregorian::to_iso_extended_string (lRequestDate);
154 const Duration_T& lRequestTime = _requestDateTime.time_of_day();
155 oStr <<
", " << boost::posix_time::to_simple_string (lRequestTime);
158 oStr <<
", " << _pos;
161 oStr <<
", " << _channel;
164 oStr <<
", " << _origin;
167 oStr <<
", " << _destination;
171 << boost::gregorian::to_iso_extended_string (_preferredDepartureDate);
175 << boost::posix_time::to_simple_string (_preferredDepartureTime);
178 oStr <<
", " <<
"00:00-23:59";
182 << boost::gregorian::to_iso_extended_string (_preferredDepartureDate);
185 oStr <<
", " <<
"23:55";
188 oStr <<
", " << _preferredCabin;
191 oStr <<
", " << _tripType;
198 oStr << _stayDuration;
202 oStr <<
", " << _frequentFlyerType;
205 oStr <<
", " << _wtp;
209 oStr <<
", " <<
"100";
212 oStr <<
", " << _valueOfTime;