AirRAC Logo  1.00.0
C++ Simulated Revenue Accounting (RAC) System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
YieldRuleStruct.hpp
Go to the documentation of this file.
1 #ifndef __AIRRAC_BOM_YIELDRULESTRUCT_HPP
2 #define __AIRRAC_BOM_YIELDRULESTRUCT_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <string>
9 // StdAir
10 #include <stdair/stdair_basic_types.hpp>
11 #include <stdair/stdair_date_time_types.hpp>
12 #include <stdair/stdair_demand_types.hpp>
13 #include <stdair/stdair_inventory_types.hpp>
14 #include <stdair/basic/StructAbstract.hpp>
15 #include <stdair/basic/BasParserHelperTypes.hpp>
16 // AirRAC
17 #include <airrac/AIRRAC_Types.hpp>
18 
19 namespace AIRRAC {
20 
24  struct YieldRuleStruct : public stdair::StructAbstract {
25  public:
26  // /////////////////// Initialisation / Destruction /////////////////////
31 
36 
37  public:
38  // ////////////////////// Getters /////////////////////////
41  return _yieldId;
42  }
43 
45  stdair::AirportCode_T getOrigin () const {
46  return _origin;
47  }
48 
50  stdair::AirportCode_T getDestination () const {
51  return _destination;
52  }
53 
55  stdair::TripType_T getTripType () const {
56  return _tripType;
57  }
58 
60  stdair::Date_T getDateRangeStart () const {
61  return _dateRangeStart;
62  }
63 
65  stdair::Date_T getDateRangeEnd () const {
66  return _dateRangeEnd;
67  }
68 
70  stdair::Duration_T getTimeRangeStart () const {
71  return _timeRangeStart;
72  }
73 
75  stdair::Duration_T getTimeRangeEnd () const {
76  return _timeRangeEnd;
77  }
78 
80  stdair::CabinCode_T getCabinCode () const {
81  return _cabinCode;
82  }
83 
85  const stdair::CityCode_T getPOS () const {
86  return _pos;
87  }
88 
90  stdair::ChannelLabel_T getChannel () const {
91  return _channel;
92  }
93 
95  stdair::YieldValue_T getYield () const {
96  return _yield;
97  }
98 
100  stdair::AirlineCode_T getAirlineCode () const {
101  return _airlineCode;
102  }
103 
105  stdair::ClassCode_T getClassCode () const {
106  return _classCode;
107  }
108 
110  const unsigned int getAirlineListSize () const {
111  return _airlineCodeList.size();
112  }
113 
115  const unsigned int getClassCodeListSize () const {
116  return _classCodeList.size();
117  }
118 
120  stdair::AirlineCodeList_T getAirlineList () const {
121  return _airlineCodeList;
122  }
123 
125  stdair::ClassList_StringList_T getClassCodeList () const {
126  return _classCodeList;
127  }
128 
129  public:
130  // ////////////////////// Display support methods /////////////////////////
132  stdair::Date_T calculateDate() const;
133 
135  stdair::Duration_T calculateTime() const;
136 
138  const std::string describe() const;
139 
140  public:
141  // ///////// Setters //////////
143  void setYieldID (const AIRRAC::YieldID_T iYieldID) {
144  _yieldId = iYieldID;
145  }
146 
148  void setOrigin (const stdair::AirportCode_T& iOrigin) {
149  _origin = iOrigin;
150  }
151 
153  void setDestination (const stdair::AirportCode_T& iDestination) {
154  _destination = iDestination;
155  }
156 
158  void setTripType (const stdair::TripType_T& iTripType) {
159  _tripType = iTripType;
160  }
161 
163  void setDateRangeStart (const stdair::Date_T& iDateRangeStart) {
164  _dateRangeStart = iDateRangeStart;
165  }
166 
168  void setDateRangeEnd (const stdair::Date_T& iDateRangeEnd) {
169  _dateRangeEnd = iDateRangeEnd;
170  }
171 
173  void setTimeRangeStart (const stdair::Duration_T& iTimeRangeStart) {
174  _timeRangeStart = iTimeRangeStart;
175  }
176 
178  void setTimeRangeEnd (const stdair::Duration_T& iTimeRangeEnd) {
179  _timeRangeEnd = iTimeRangeEnd;
180  }
181 
183  void setCabinCode (const stdair::CabinCode_T& iCabinCode) {
184  _cabinCode = iCabinCode;
185  }
186 
188  void setPOS (const stdair::CityCode_T& iPOS) {
189  _pos = iPOS;
190  }
191 
193  void setChannel (const stdair::ChannelLabel_T& iChannel) {
194  _channel = iChannel;
195  }
196 
198  void setYield(const stdair::YieldValue_T& iYield) {
199  _yield = iYield;
200  }
201 
203  void setAirlineCode (const stdair::AirlineCode_T& iAirlineCode) {
204  _airlineCode = iAirlineCode;
205  }
206 
208  void setClassCode (const stdair::ClassCode_T& iClassCode) {
209  _classCode = iClassCode;
210  }
211 
214  _airlineCodeList.clear();
215  }
216 
219  _classCodeList.clear();
220  }
221 
223  void addAirlineCode (const stdair::AirlineCode_T& iAirlineCode) {
224  _airlineCodeList.push_back (iAirlineCode);
225  }
226 
228  void addClassCode (const stdair::ClassCode_T& iClassCode) {
229  _classCodeList.push_back (iClassCode);
230  }
231 
232  public:
233  // ////////////////// Attributes /////////////////
235  stdair::year_t _itYear;
236  stdair::month_t _itMonth;
237  stdair::day_t _itDay;
238 
240  //long _itHours;
241  stdair::hour_t _itHours;
242  stdair::minute_t _itMinutes;
243  stdair::second_t _itSeconds;
244 
245  private:
246  // ////////////////// Attributes /////////////////
247 
249  YieldID_T _yieldId;
250 
252  stdair::AirportCode_T _origin;
253 
255  stdair::AirportCode_T _destination;
256 
258  stdair::TripType_T _tripType;
259 
261  stdair::Date_T _dateRangeStart;
262 
264  stdair::Date_T _dateRangeEnd;
265 
267  stdair::Duration_T _timeRangeStart;
268 
270  stdair::Duration_T _timeRangeEnd;
271 
273  stdair::YieldValue_T _yield;
274 
276  stdair::CabinCode_T _cabinCode;
277 
279  stdair::CityCode_T _pos;
280 
282  stdair::ChannelLabel_T _channel;
283 
285  stdair::AirlineCode_T _airlineCode;
286 
288  stdair::ClassCode_T _classCode;
289 
291  stdair::AirlineCodeList_T _airlineCodeList;
292 
294  stdair::ClassList_StringList_T _classCodeList;
295  };
296 
297 }
298 #endif // __AIRRAC_BOM_YIELDRULESTRUCT_HPP