$treeview $search $mathjax
00001 #ifndef __SIMFQT_BOM_FARERULESTRUCT_HPP 00002 #define __SIMFQT_BOM_FARERULESTRUCT_HPP 00003 00004 // ////////////////////////////////////////////////////////////////////// 00005 // Import section 00006 // ////////////////////////////////////////////////////////////////////// 00007 // STL 00008 #include <string> 00009 #include <vector> 00010 // StdAir 00011 #include <stdair/stdair_demand_types.hpp> 00012 #include <stdair/stdair_inventory_types.hpp> 00013 #include <stdair/basic/StructAbstract.hpp> 00014 #include <stdair/basic/BasParserHelperTypes.hpp> 00015 // SIMFQT 00016 #include <simfqt/SIMFQT_Types.hpp> 00017 00018 namespace SIMFQT { 00019 00021 struct FareRuleStruct : public stdair::StructAbstract { 00022 public: 00023 00025 FareRuleStruct (); 00026 00027 public: 00028 // ///////// Getters ////////// 00030 SIMFQT::FareQuoteID_T getFareID () const { 00031 return _fareId; 00032 } 00033 00035 stdair::AirportCode_T getOrigin () const { 00036 return _origin; 00037 } 00038 00040 stdair::AirportCode_T getDestination () const { 00041 return _destination; 00042 } 00043 00045 stdair::TripType_T getTripType () const { 00046 return _tripType; 00047 } 00048 00050 stdair::Date_T getDateRangeStart () const { 00051 return _dateRangeStart; 00052 } 00053 00055 stdair::Date_T getDateRangeEnd () const { 00056 return _dateRangeEnd; 00057 } 00058 00060 stdair::Duration_T getTimeRangeStart () const { 00061 return _timeRangeStart; 00062 } 00063 00065 stdair::Duration_T getTimeRangeEnd () const { 00066 return _timeRangeEnd; 00067 } 00068 00070 stdair::CabinCode_T getCabinCode () const { 00071 return _cabinCode; 00072 } 00073 00075 const stdair::CityCode_T getPOS () const { 00076 return _pos; 00077 } 00078 00080 stdair::ChannelLabel_T getChannel () const { 00081 return _channel; 00082 } 00083 00085 stdair::DayDuration_T getAdvancePurchase () const { 00086 return _advancePurchase; 00087 } 00088 00090 stdair::SaturdayStay_T getSaturdayStay () const { 00091 return _saturdayStay; 00092 } 00093 00095 stdair::ChangeFees_T getChangeFees () const { 00096 return _changeFees; 00097 } 00098 00100 stdair::NonRefundable_T getNonRefundable () const { 00101 return _nonRefundable; 00102 } 00103 00105 stdair::DayDuration_T getMinimumStay () const { 00106 return _minimumStay; 00107 } 00108 00110 stdair::PriceValue_T getFare () const { 00111 return _fare; 00112 } 00113 00115 stdair::AirlineCode_T getAirlineCode () const { 00116 return _airlineCode; 00117 } 00118 00120 stdair::ClassCode_T getClassCode () const { 00121 return _classCode; 00122 } 00123 00125 const unsigned int getAirlineListSize () const { 00126 return _airlineCodeList.size(); 00127 } 00128 00130 const unsigned int getClassCodeListSize () const { 00131 return _classCodeList.size(); 00132 } 00133 00135 stdair::AirlineCodeList_T getAirlineList () const { 00136 return _airlineCodeList; 00137 } 00138 00140 stdair::ClassList_StringList_T getClassCodeList () const { 00141 return _classCodeList; 00142 } 00143 00144 public: 00145 // ///////// Display support methods ////////// 00147 stdair::Date_T calculateDate() const; 00148 00150 stdair::Duration_T calculateTime() const; 00151 00153 const std::string describe() const; 00154 00155 public: 00156 // ///////// Setters ////////// 00158 void setFareID (const SIMFQT::FareQuoteID_T& iFareQuoteID) { 00159 _fareId = iFareQuoteID; 00160 } 00161 00163 void setOrigin (const stdair::AirportCode_T& iOrigin) { 00164 _origin = iOrigin; 00165 } 00166 00168 void setDestination (const stdair::AirportCode_T& iDestination) { 00169 _destination = iDestination; 00170 } 00171 00173 void setTripType (const stdair::TripType_T& iTripType) { 00174 _tripType = iTripType; 00175 } 00176 00178 void setDateRangeStart (const stdair::Date_T& iDateRangeStart) { 00179 _dateRangeStart = iDateRangeStart; 00180 } 00181 00183 void setDateRangeEnd (const stdair::Date_T& iDateRangeEnd) { 00184 _dateRangeEnd = iDateRangeEnd; 00185 } 00186 00188 void setTimeRangeStart (const stdair::Duration_T& iTimeRangeStart) { 00189 _timeRangeStart = iTimeRangeStart; 00190 } 00191 00193 void setTimeRangeEnd (const stdair::Duration_T& iTimeRangeEnd) { 00194 _timeRangeEnd = iTimeRangeEnd; 00195 } 00196 00198 void setCabinCode (const stdair::CabinCode_T& iCabinCode) { 00199 _cabinCode = iCabinCode; 00200 } 00201 00203 void setPOS (const stdair::CityCode_T& iPOS) { 00204 _pos = iPOS; 00205 } 00206 00208 void setChannel (const stdair::ChannelLabel_T& iChannel) { 00209 _channel = iChannel; 00210 } 00211 00213 void setAdvancePurchase (const stdair::DayDuration_T& iAdvancePurchase) { 00214 _advancePurchase = iAdvancePurchase; 00215 } 00216 00218 void setSaturdayStay (const stdair::SaturdayStay_T& iSaturdayStay) { 00219 _saturdayStay = iSaturdayStay; 00220 } 00221 00223 void setChangeFees (const stdair::ChangeFees_T& iChangeFees) { 00224 _changeFees = iChangeFees; 00225 } 00226 00228 void setNonRefundable (const stdair::NonRefundable_T& iNonRefundable) { 00229 _nonRefundable = iNonRefundable; 00230 } 00231 00233 void setMinimumStay (const stdair::DayDuration_T& iMinimumStay) { 00234 _minimumStay = iMinimumStay; 00235 } 00236 00238 void setFare (const stdair::PriceValue_T& iFare) { 00239 _fare = iFare; 00240 } 00241 00243 void setAirlineCode (const stdair::AirlineCode_T& iAirlineCode) { 00244 _airlineCode = iAirlineCode; 00245 } 00246 00248 void setClassCode (const stdair::ClassCode_T& iClassCode) { 00249 _classCode = iClassCode; 00250 } 00251 00253 void clearAirlineCodeList () { 00254 _airlineCodeList.clear(); 00255 } 00256 00258 void clearClassCodeList () { 00259 _classCodeList.clear(); 00260 } 00261 00263 void addAirlineCode (const stdair::AirlineCode_T& iAirlineCode) { 00264 _airlineCodeList.push_back (iAirlineCode); 00265 } 00266 00268 void addClassCode (const stdair::ClassCode_T& iClassCode) { 00269 _classCodeList.push_back (iClassCode); 00270 } 00271 00272 public: 00273 // ////////////////// Attributes ///////////////// 00275 stdair::year_t _itYear; 00276 stdair::month_t _itMonth; 00277 stdair::day_t _itDay; 00278 00280 stdair::hour_t _itHours; 00281 stdair::minute_t _itMinutes; 00282 stdair::second_t _itSeconds; 00283 00284 private: 00285 // ////////////////// Attributes ///////////////// 00287 SIMFQT::FareQuoteID_T _fareId; 00288 00290 stdair::AirportCode_T _origin; 00291 00293 stdair::AirportCode_T _destination; 00294 00296 stdair::TripType_T _tripType; 00297 00299 stdair::Date_T _dateRangeStart; 00300 00302 stdair::Date_T _dateRangeEnd; 00303 00305 stdair::Duration_T _timeRangeStart; 00306 00308 stdair::Duration_T _timeRangeEnd; 00309 00311 stdair::CabinCode_T _cabinCode; 00312 00314 stdair::CityCode_T _pos; 00315 00317 stdair::ChannelLabel_T _channel; 00318 00320 stdair::DayDuration_T _advancePurchase; 00321 00323 stdair::SaturdayStay_T _saturdayStay; 00324 00326 stdair::ChangeFees_T _changeFees; 00327 00329 stdair::NonRefundable_T _nonRefundable; 00330 00332 stdair::DayDuration_T _minimumStay; 00333 00335 stdair::PriceValue_T _fare; 00336 00338 stdair::AirlineCode_T _airlineCode; 00339 00341 stdair::ClassCode_T _classCode; 00342 00345 stdair::AirlineCodeList_T _airlineCodeList; 00346 00349 stdair::ClassList_StringList_T _classCodeList; 00350 00351 }; 00352 00353 } 00354 #endif // __SIMFQT_BOM_FARERULESTRUCT_HPP