StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
OptimisationNotificationStruct.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/OptimisationNotificationStruct.hpp>
00009 
00010 namespace stdair {
00011   
00012   // //////////////////////////////////////////////////////////////////////
00013   OptimisationNotificationStruct::OptimisationNotificationStruct()
00014     :  _partySize (0), _stayDuration (0), _wtp (0.0), _valueOfTime (0.0) {
00015     assert (false);
00016   }
00017     
00018   // //////////////////////////////////////////////////////////////////////
00019   OptimisationNotificationStruct::
00020   OptimisationNotificationStruct (const OptimisationNotificationStruct& iOptimisationNotification)
00021     : _origin (iOptimisationNotification._origin),
00022       _destination (iOptimisationNotification._destination),
00023       _pos (iOptimisationNotification._pos),
00024       _preferredDepartureDate (iOptimisationNotification._preferredDepartureDate), 
00025       _notificationDateTime (iOptimisationNotification._notificationDateTime),
00026       _preferredCabin (iOptimisationNotification._preferredCabin),
00027       _partySize (iOptimisationNotification._partySize),
00028       _channel (iOptimisationNotification._channel),
00029       _tripType (iOptimisationNotification._tripType),
00030       _stayDuration (iOptimisationNotification._stayDuration),
00031       _frequentFlyerType (iOptimisationNotification._frequentFlyerType),
00032       _preferredDepartureTime (iOptimisationNotification._preferredDepartureTime),
00033       _wtp (iOptimisationNotification._wtp),
00034       _valueOfTime (iOptimisationNotification._valueOfTime) {
00035   }
00036   
00037   // //////////////////////////////////////////////////////////////////////
00038   OptimisationNotificationStruct::
00039   OptimisationNotificationStruct (const AirportCode_T& iOrigin,
00040                         const AirportCode_T& iDestination,
00041                         const CityCode_T& iPOS,
00042                         const Date_T& iDepartureDate,
00043                         const DateTime_T& iNotificationDateTime,
00044                         const CabinCode_T& iPreferredCabin,
00045                         const NbOfSeats_T& iPartySize,
00046                         const ChannelLabel_T& iChannel,
00047                         const TripType_T& iTripType,
00048                         const DayDuration_T& iStayDuration,
00049                         const FrequentFlyer_T& iFrequentFlyerType,
00050                         const Duration_T& iPreferredDepartureTime,
00051                         const WTP_T& iWTP,
00052                         const PriceValue_T& iValueOfTime)
00053     : _origin (iOrigin), _destination (iDestination),
00054       _pos (iPOS), _preferredDepartureDate (iDepartureDate), 
00055       _notificationDateTime (iNotificationDateTime),
00056       _preferredCabin (iPreferredCabin), _partySize (iPartySize),
00057       _channel (iChannel), _tripType (iTripType),
00058       _stayDuration (iStayDuration), _frequentFlyerType (iFrequentFlyerType),
00059       _preferredDepartureTime (iPreferredDepartureTime), _wtp (iWTP),
00060       _valueOfTime (iValueOfTime) {
00061   }
00062   
00063   // //////////////////////////////////////////////////////////////////////
00064   OptimisationNotificationStruct::~OptimisationNotificationStruct() {
00065   }
00066   
00067   // //////////////////////////////////////////////////////////////////////
00068   void OptimisationNotificationStruct::toStream (std::ostream& ioOut) const {
00069     ioOut << describe();
00070   }
00071 
00072   // //////////////////////////////////////////////////////////////////////
00073   void OptimisationNotificationStruct::fromStream (std::istream& ioIn) {
00074   }
00075   
00076   // //////////////////////////////////////////////////////////////////////
00077   const std::string OptimisationNotificationStruct::describe() const {
00078     std::ostringstream oStr;
00079     oStr << "At " << _notificationDateTime
00080          << ", for (" << _pos << ") " << _origin << "-" << _destination
00081          << " " << _preferredDepartureDate << " " << _preferredCabin
00082          << " " << _partySize << " " << _channel << " " << _tripType 
00083          << " " << _stayDuration << " " << _frequentFlyerType
00084          << " " << _preferredDepartureTime << " " << _wtp
00085          << " " << _valueOfTime;
00086     return oStr.str();
00087   }
00088 
00089 }