SimFQT Logo  1.00.0
C++ Simulated Fare Quote System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
FareRuleStruct.hpp
Go to the documentation of this file.
1 #ifndef __SIMFQT_BOM_FARERULESTRUCT_HPP
2 #define __SIMFQT_BOM_FARERULESTRUCT_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <string>
9 #include <vector>
10 // StdAir
11 #include <stdair/stdair_demand_types.hpp>
12 #include <stdair/stdair_inventory_types.hpp>
13 #include <stdair/basic/StructAbstract.hpp>
14 #include <stdair/basic/BasParserHelperTypes.hpp>
15 // SIMFQT
16 #include <simfqt/SIMFQT_Types.hpp>
17 
18 namespace SIMFQT {
19 
21  struct FareRuleStruct : public stdair::StructAbstract {
22  public:
23 
25  FareRuleStruct ();
26 
27  public:
28  // ///////// Getters //////////
31  return _fareId;
32  }
33 
35  stdair::AirportCode_T getOrigin () const {
36  return _origin;
37  }
38 
40  stdair::AirportCode_T getDestination () const {
41  return _destination;
42  }
43 
45  stdair::TripType_T getTripType () const {
46  return _tripType;
47  }
48 
50  stdair::Date_T getDateRangeStart () const {
51  return _dateRangeStart;
52  }
53 
55  stdair::Date_T getDateRangeEnd () const {
56  return _dateRangeEnd;
57  }
58 
60  stdair::Duration_T getTimeRangeStart () const {
61  return _timeRangeStart;
62  }
63 
65  stdair::Duration_T getTimeRangeEnd () const {
66  return _timeRangeEnd;
67  }
68 
70  stdair::CabinCode_T getCabinCode () const {
71  return _cabinCode;
72  }
73 
75  const stdair::CityCode_T getPOS () const {
76  return _pos;
77  }
78 
80  stdair::ChannelLabel_T getChannel () const {
81  return _channel;
82  }
83 
85  stdair::DayDuration_T getAdvancePurchase () const {
86  return _advancePurchase;
87  }
88 
90  stdair::SaturdayStay_T getSaturdayStay () const {
91  return _saturdayStay;
92  }
93 
95  stdair::ChangeFees_T getChangeFees () const {
96  return _changeFees;
97  }
98 
100  stdair::NonRefundable_T getNonRefundable () const {
101  return _nonRefundable;
102  }
103 
105  stdair::DayDuration_T getMinimumStay () const {
106  return _minimumStay;
107  }
108 
110  stdair::PriceValue_T getFare () const {
111  return _fare;
112  }
113 
115  stdair::AirlineCode_T getAirlineCode () const {
116  return _airlineCode;
117  }
118 
120  stdair::ClassCode_T getClassCode () const {
121  return _classCode;
122  }
123 
125  const unsigned int getAirlineListSize () const {
126  return _airlineCodeList.size();
127  }
128 
130  const unsigned int getClassCodeListSize () const {
131  return _classCodeList.size();
132  }
133 
135  stdair::AirlineCodeList_T getAirlineList () const {
136  return _airlineCodeList;
137  }
138 
140  stdair::ClassList_StringList_T getClassCodeList () const {
141  return _classCodeList;
142  }
143 
144  public:
145  // ///////// Display support methods //////////
147  stdair::Date_T calculateDate() const;
148 
150  stdair::Duration_T calculateTime() const;
151 
153  const std::string describe() const;
154 
155  public:
156  // ///////// Setters //////////
158  void setFareID (const SIMFQT::FareQuoteID_T& iFareQuoteID) {
159  _fareId = iFareQuoteID;
160  }
161 
163  void setOrigin (const stdair::AirportCode_T& iOrigin) {
164  _origin = iOrigin;
165  }
166 
168  void setDestination (const stdair::AirportCode_T& iDestination) {
169  _destination = iDestination;
170  }
171 
173  void setTripType (const stdair::TripType_T& iTripType) {
174  _tripType = iTripType;
175  }
176 
178  void setDateRangeStart (const stdair::Date_T& iDateRangeStart) {
179  _dateRangeStart = iDateRangeStart;
180  }
181 
183  void setDateRangeEnd (const stdair::Date_T& iDateRangeEnd) {
184  _dateRangeEnd = iDateRangeEnd;
185  }
186 
188  void setTimeRangeStart (const stdair::Duration_T& iTimeRangeStart) {
189  _timeRangeStart = iTimeRangeStart;
190  }
191 
193  void setTimeRangeEnd (const stdair::Duration_T& iTimeRangeEnd) {
194  _timeRangeEnd = iTimeRangeEnd;
195  }
196 
198  void setCabinCode (const stdair::CabinCode_T& iCabinCode) {
199  _cabinCode = iCabinCode;
200  }
201 
203  void setPOS (const stdair::CityCode_T& iPOS) {
204  _pos = iPOS;
205  }
206 
208  void setChannel (const stdair::ChannelLabel_T& iChannel) {
209  _channel = iChannel;
210  }
211 
213  void setAdvancePurchase (const stdair::DayDuration_T& iAdvancePurchase) {
214  _advancePurchase = iAdvancePurchase;
215  }
216 
218  void setSaturdayStay (const stdair::SaturdayStay_T& iSaturdayStay) {
219  _saturdayStay = iSaturdayStay;
220  }
221 
223  void setChangeFees (const stdair::ChangeFees_T& iChangeFees) {
224  _changeFees = iChangeFees;
225  }
226 
228  void setNonRefundable (const stdair::NonRefundable_T& iNonRefundable) {
229  _nonRefundable = iNonRefundable;
230  }
231 
233  void setMinimumStay (const stdair::DayDuration_T& iMinimumStay) {
234  _minimumStay = iMinimumStay;
235  }
236 
238  void setFare (const stdair::PriceValue_T& iFare) {
239  _fare = iFare;
240  }
241 
243  void setAirlineCode (const stdair::AirlineCode_T& iAirlineCode) {
244  _airlineCode = iAirlineCode;
245  }
246 
248  void setClassCode (const stdair::ClassCode_T& iClassCode) {
249  _classCode = iClassCode;
250  }
251 
254  _airlineCodeList.clear();
255  }
256 
259  _classCodeList.clear();
260  }
261 
263  void addAirlineCode (const stdair::AirlineCode_T& iAirlineCode) {
264  _airlineCodeList.push_back (iAirlineCode);
265  }
266 
268  void addClassCode (const stdair::ClassCode_T& iClassCode) {
269  _classCodeList.push_back (iClassCode);
270  }
271 
272  public:
273  // ////////////////// Attributes /////////////////
275  stdair::year_t _itYear;
276  stdair::month_t _itMonth;
277  stdair::day_t _itDay;
278 
280  stdair::hour_t _itHours;
281  stdair::minute_t _itMinutes;
282  stdair::second_t _itSeconds;
283 
284  private:
285  // ////////////////// Attributes /////////////////
287  SIMFQT::FareQuoteID_T _fareId;
288 
290  stdair::AirportCode_T _origin;
291 
293  stdair::AirportCode_T _destination;
294 
296  stdair::TripType_T _tripType;
297 
299  stdair::Date_T _dateRangeStart;
300 
302  stdair::Date_T _dateRangeEnd;
303 
305  stdair::Duration_T _timeRangeStart;
306 
308  stdair::Duration_T _timeRangeEnd;
309 
311  stdair::CabinCode_T _cabinCode;
312 
314  stdair::CityCode_T _pos;
315 
317  stdair::ChannelLabel_T _channel;
318 
320  stdair::DayDuration_T _advancePurchase;
321 
323  stdair::SaturdayStay_T _saturdayStay;
324 
326  stdair::ChangeFees_T _changeFees;
327 
329  stdair::NonRefundable_T _nonRefundable;
330 
332  stdair::DayDuration_T _minimumStay;
333 
335  stdair::PriceValue_T _fare;
336 
338  stdair::AirlineCode_T _airlineCode;
339 
341  stdair::ClassCode_T _classCode;
342 
345  stdair::AirlineCodeList_T _airlineCodeList;
346 
349  stdair::ClassList_StringList_T _classCodeList;
350 
351  };
352 
353 }
354 #endif // __SIMFQT_BOM_FARERULESTRUCT_HPP