$treeview $search $mathjax
00001 // ////////////////////////////////////////////////////////////////////// 00002 // Import section 00003 // ////////////////////////////////////////////////////////////////////// 00004 // STL 00005 #include <cassert> 00006 #include <sstream> 00007 // Boost 00008 #include <boost/multi_array.hpp> 00009 // Boost.Serialization 00010 #include <boost/archive/text_iarchive.hpp> 00011 #include <boost/archive/text_oarchive.hpp> 00012 #include <boost/serialization/access.hpp> 00013 // StdAir 00014 #include <stdair/basic/BasConst_Inventory.hpp> 00015 #include <stdair/bom/BomManager.hpp> 00016 #include <stdair/bom/SegmentSnapshotTable.hpp> 00017 00018 namespace stdair { 00019 00020 // //////////////////////////////////////////////////////////////////// 00021 SegmentSnapshotTable::SegmentSnapshotTable() 00022 : _key (DEFAULT_TABLE_ID), _parent (NULL) { 00023 assert (false); 00024 } 00025 00026 // //////////////////////////////////////////////////////////////////// 00027 SegmentSnapshotTable::SegmentSnapshotTable (const SegmentSnapshotTable&) 00028 : _key (DEFAULT_TABLE_ID), _parent (NULL) { 00029 assert (false); 00030 } 00031 00032 // //////////////////////////////////////////////////////////////////// 00033 SegmentSnapshotTable:: 00034 SegmentSnapshotTable (const Key_T& iKey) : _key (iKey), _parent (NULL) { 00035 } 00036 00037 // //////////////////////////////////////////////////////////////////// 00038 SegmentSnapshotTable::~SegmentSnapshotTable() { 00039 } 00040 00041 // //////////////////////////////////////////////////////////////////// 00042 std::string SegmentSnapshotTable::toString() const { 00043 std::ostringstream oStr; 00044 oStr << describeKey(); 00045 return oStr.str(); 00046 } 00047 00048 // //////////////////////////////////////////////////////////////////// 00049 void SegmentSnapshotTable:: 00050 initSnapshotBlocks (const SegmentCabinIndexMap_T& iSegmentCabinIndexMap, 00051 const ClassIndexMap_T& iClassIndexMap) { 00052 _segmentCabinIndexMap = iSegmentCabinIndexMap; 00053 _classIndexMap = iClassIndexMap; 00054 00055 unsigned int lNumberOfSegmentCabins = _segmentCabinIndexMap.size(); 00056 unsigned int lNumberOfClasses = _classIndexMap.size(); 00057 00058 // Initialise the snapshot blocks 00059 // Normally, the block includes snapshots from DTD MAX to DTD 0, thus 00060 // DEFAULT_MAX_DTD + 1 values. However, we would like to add the day 00061 // before DTD MAX (this value will be initialised to zero). 00062 _bookingSnapshotBlock. 00063 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses] 00064 [DEFAULT_MAX_DTD + 2]); 00065 _cancellationSnapshotBlock. 00066 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses] 00067 [DEFAULT_MAX_DTD + 2]); 00068 _productOrientedNetBookingSnapshotBlock. 00069 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses] 00070 [DEFAULT_MAX_DTD + 2]); 00071 _priceOrientedNetBookingSnapshotBlock. 00072 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses] 00073 [DEFAULT_MAX_DTD + 2]); 00074 _productOrientedGrossBookingSnapshotBlock. 00075 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses] 00076 [DEFAULT_MAX_DTD + 2]); 00077 _priceOrientedGrossBookingSnapshotBlock. 00078 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses] 00079 [DEFAULT_MAX_DTD + 2]); 00080 _availabilitySnapshotBlock. 00081 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses] 00082 [DEFAULT_MAX_DTD + 2]); 00083 00084 } 00085 00086 // //////////////////////////////////////////////////////////////////// 00087 const ClassIndex_T& SegmentSnapshotTable:: 00088 getClassIndex (const MapKey_T& iKey) const { 00089 ClassIndexMap_T::const_iterator itVTIdx = 00090 _classIndexMap.find (iKey); 00091 assert (itVTIdx != _classIndexMap.end()); 00092 return itVTIdx->second; 00093 } 00094 00095 // //////////////////////////////////////////////////////////////////// 00096 const SegmentDataID_T& SegmentSnapshotTable:: 00097 getSegmentDataID (const SegmentCabin& iSegmentCabin) const { 00098 SegmentCabinIndexMap_T::const_iterator itSCIdx = 00099 _segmentCabinIndexMap.find (&iSegmentCabin); 00100 assert (itSCIdx != _segmentCabinIndexMap.end()); 00101 return itSCIdx->second; 00102 } 00103 00104 // //////////////////////////////////////////////////////////////////// 00105 ConstSegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00106 getConstSegmentCabinDTDBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00107 const SegmentDataID_T iSCIdxEnd, 00108 const DTD_T iDTD) const { 00109 const unsigned int lNbOfClasses = _classIndexMap.size(); 00110 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00111 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00112 00113 return _bookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00114 } 00115 00116 // //////////////////////////////////////////////////////////////////// 00117 ConstSegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00118 getConstSegmentCabinDTDRangeBookingSnapshotView 00119 (const SegmentDataID_T iSCIdxBegin, const SegmentDataID_T iSCIdxEnd, 00120 const DTD_T iDTDBegin, const DTD_T iDTDEnd) const { 00121 const unsigned int lNbOfClasses = _classIndexMap.size(); 00122 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00123 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses; 00124 00125 return _bookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00126 } 00127 00128 // //////////////////////////////////////////////////////////////////// 00129 SegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00130 getSegmentCabinDTDBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00131 const SegmentDataID_T iSCIdxEnd, 00132 const DTD_T iDTD) { 00133 const unsigned int lNbOfClasses = _classIndexMap.size(); 00134 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00135 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00136 00137 return _bookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00138 } 00139 00140 // //////////////////////////////////////////////////////////////////// 00141 SegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00142 getSegmentCabinDTDRangeBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00143 const SegmentDataID_T iSCIdxEnd, 00144 const DTD_T iDTDBegin, 00145 const DTD_T iDTDEnd) { 00146 const unsigned int lNbOfClasses = _classIndexMap.size(); 00147 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00148 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00149 00150 return _bookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00151 } 00152 00153 // //////////////////////////////////////////////////////////////////// 00154 ConstSegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00155 getConstSegmentCabinDTDCancellationSnapshotView (const SegmentDataID_T iSCIdxBegin, 00156 const SegmentDataID_T iSCIdxEnd, 00157 const DTD_T iDTD) const { 00158 const unsigned int lNbOfClasses = _classIndexMap.size(); 00159 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00160 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00161 00162 return _cancellationSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00163 } 00164 00165 // //////////////////////////////////////////////////////////////////// 00166 ConstSegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00167 getConstSegmentCabinDTDRangeCancellationSnapshotView 00168 (const SegmentDataID_T iSCIdxBegin, const SegmentDataID_T iSCIdxEnd, 00169 const DTD_T iDTDBegin, const DTD_T iDTDEnd) const { 00170 const unsigned int lNbOfClasses = _classIndexMap.size(); 00171 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00172 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses; 00173 00174 return _cancellationSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00175 } 00176 00177 // //////////////////////////////////////////////////////////////////// 00178 SegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00179 getSegmentCabinDTDCancellationSnapshotView (const SegmentDataID_T iSCIdxBegin, 00180 const SegmentDataID_T iSCIdxEnd, 00181 const DTD_T iDTD) { 00182 const unsigned int lNbOfClasses = _classIndexMap.size(); 00183 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00184 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00185 00186 return _cancellationSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00187 } 00188 00189 // //////////////////////////////////////////////////////////////////// 00190 SegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00191 getSegmentCabinDTDRangeCancellationSnapshotView(const SegmentDataID_T iSCIdxBegin, 00192 const SegmentDataID_T iSCIdxEnd, 00193 const DTD_T iDTDBegin, 00194 const DTD_T iDTDEnd) { 00195 const unsigned int lNbOfClasses = _classIndexMap.size(); 00196 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00197 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00198 00199 return _cancellationSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00200 } 00201 00202 // //////////////////////////////////////////////////////////////////// 00203 ConstSegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00204 getConstSegmentCabinDTDProductOrientedNetBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00205 const SegmentDataID_T iSCIdxEnd, 00206 const DTD_T iDTD) const { 00207 const unsigned int lNbOfClasses = _classIndexMap.size(); 00208 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00209 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00210 00211 return _productOrientedNetBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00212 } 00213 00214 // //////////////////////////////////////////////////////////////////// 00215 ConstSegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00216 getConstSegmentCabinDTDRangeProductOrientedNetBookingSnapshotView 00217 (const SegmentDataID_T iSCIdxBegin, const SegmentDataID_T iSCIdxEnd, 00218 const DTD_T iDTDBegin, const DTD_T iDTDEnd) const { 00219 const unsigned int lNbOfClasses = _classIndexMap.size(); 00220 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00221 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses; 00222 00223 return _productOrientedNetBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00224 } 00225 00226 // //////////////////////////////////////////////////////////////////// 00227 SegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00228 getSegmentCabinDTDProductOrientedNetBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00229 const SegmentDataID_T iSCIdxEnd, 00230 const DTD_T iDTD) { 00231 const unsigned int lNbOfClasses = _classIndexMap.size(); 00232 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00233 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00234 00235 return _productOrientedNetBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00236 } 00237 00238 // //////////////////////////////////////////////////////////////////// 00239 SegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00240 getSegmentCabinDTDRangeProductOrientedNetBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00241 const SegmentDataID_T iSCIdxEnd, 00242 const DTD_T iDTDBegin, 00243 const DTD_T iDTDEnd) { 00244 const unsigned int lNbOfClasses = _classIndexMap.size(); 00245 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00246 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00247 00248 return _productOrientedNetBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00249 } 00250 00251 00252 // //////////////////////////////////////////////////////////////////// 00253 ConstSegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00254 getConstSegmentCabinDTDPriceOrientedNetBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00255 const SegmentDataID_T iSCIdxEnd, 00256 const DTD_T iDTD) const { 00257 const unsigned int lNbOfClasses = _classIndexMap.size(); 00258 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00259 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00260 00261 return _priceOrientedNetBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00262 } 00263 00264 // //////////////////////////////////////////////////////////////////// 00265 ConstSegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00266 getConstSegmentCabinDTDRangePriceOrientedNetBookingSnapshotView 00267 (const SegmentDataID_T iSCIdxBegin, const SegmentDataID_T iSCIdxEnd, 00268 const DTD_T iDTDBegin, const DTD_T iDTDEnd) const { 00269 const unsigned int lNbOfClasses = _classIndexMap.size(); 00270 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00271 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses; 00272 00273 return _priceOrientedNetBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00274 } 00275 00276 // //////////////////////////////////////////////////////////////////// 00277 SegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00278 getSegmentCabinDTDPriceOrientedNetBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00279 const SegmentDataID_T iSCIdxEnd, 00280 const DTD_T iDTD) { 00281 const unsigned int lNbOfClasses = _classIndexMap.size(); 00282 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00283 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00284 00285 return _priceOrientedNetBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00286 } 00287 00288 // //////////////////////////////////////////////////////////////////// 00289 SegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00290 getSegmentCabinDTDRangePriceOrientedNetBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00291 const SegmentDataID_T iSCIdxEnd, 00292 const DTD_T iDTDBegin, 00293 const DTD_T iDTDEnd) { 00294 const unsigned int lNbOfClasses = _classIndexMap.size(); 00295 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00296 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00297 00298 return _priceOrientedNetBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00299 } 00300 00301 // //////////////////////////////////////////////////////////////////// 00302 ConstSegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00303 getConstSegmentCabinDTDProductOrientedGrossBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00304 const SegmentDataID_T iSCIdxEnd, 00305 const DTD_T iDTD) const { 00306 const unsigned int lNbOfClasses = _classIndexMap.size(); 00307 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00308 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00309 00310 return _productOrientedGrossBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00311 } 00312 00313 // //////////////////////////////////////////////////////////////////// 00314 ConstSegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00315 getConstSegmentCabinDTDRangeProductOrientedGrossBookingSnapshotView 00316 (const SegmentDataID_T iSCIdxBegin, const SegmentDataID_T iSCIdxEnd, 00317 const DTD_T iDTDBegin, const DTD_T iDTDEnd) const { 00318 const unsigned int lNbOfClasses = _classIndexMap.size(); 00319 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00320 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses; 00321 00322 return _productOrientedGrossBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00323 } 00324 00325 // //////////////////////////////////////////////////////////////////// 00326 SegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00327 getSegmentCabinDTDProductOrientedGrossBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00328 const SegmentDataID_T iSCIdxEnd, 00329 const DTD_T iDTD) { 00330 const unsigned int lNbOfClasses = _classIndexMap.size(); 00331 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00332 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00333 00334 return _productOrientedGrossBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00335 } 00336 00337 // //////////////////////////////////////////////////////////////////// 00338 SegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00339 getSegmentCabinDTDRangeProductOrientedGrossBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00340 const SegmentDataID_T iSCIdxEnd, 00341 const DTD_T iDTDBegin, 00342 const DTD_T iDTDEnd) { 00343 const unsigned int lNbOfClasses = _classIndexMap.size(); 00344 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00345 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00346 00347 return _productOrientedGrossBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00348 } 00349 00350 00351 // //////////////////////////////////////////////////////////////////// 00352 ConstSegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00353 getConstSegmentCabinDTDPriceOrientedGrossBookingSnapshotView (const SegmentDataID_T iSCIdxBegin, 00354 const SegmentDataID_T iSCIdxEnd, 00355 const DTD_T iDTD) const { 00356 const unsigned int lNbOfClasses = _classIndexMap.size(); 00357 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00358 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00359 00360 return _priceOrientedGrossBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00361 } 00362 00363 // //////////////////////////////////////////////////////////////////// 00364 ConstSegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00365 getConstSegmentCabinDTDRangePriceOrientedGrossBookingSnapshotView 00366 (const SegmentDataID_T iSCIdxBegin, const SegmentDataID_T iSCIdxEnd, 00367 const DTD_T iDTDBegin, const DTD_T iDTDEnd) const { 00368 const unsigned int lNbOfClasses = _classIndexMap.size(); 00369 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00370 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses; 00371 00372 return _priceOrientedGrossBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00373 } 00374 00375 // //////////////////////////////////////////////////////////////////// 00376 SegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00377 getSegmentCabinDTDPriceOrientedGrossBookingSnapshotView 00378 (const SegmentDataID_T iSCIdxBegin, const SegmentDataID_T iSCIdxEnd, 00379 const DTD_T iDTD) { 00380 const unsigned int lNbOfClasses = _classIndexMap.size(); 00381 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00382 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00383 00384 return _priceOrientedGrossBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00385 } 00386 00387 // //////////////////////////////////////////////////////////////////// 00388 SegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00389 getSegmentCabinDTDRangePriceOrientedGrossBookingSnapshotView 00390 (const SegmentDataID_T iSCIdxBegin, const SegmentDataID_T iSCIdxEnd, 00391 const DTD_T iDTDBegin, const DTD_T iDTDEnd) { 00392 const unsigned int lNbOfClasses = _classIndexMap.size(); 00393 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00394 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00395 00396 return _priceOrientedGrossBookingSnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00397 } 00398 00399 // //////////////////////////////////////////////////////////////////// 00400 ConstSegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00401 getConstSegmentCabinDTDAvailabilitySnapshotView 00402 (const SegmentDataID_T iSCIdxBegin, const SegmentDataID_T iSCIdxEnd, 00403 const DTD_T iDTD) const { 00404 const unsigned int lNbOfClasses = _classIndexMap.size(); 00405 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00406 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00407 00408 return _availabilitySnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00409 } 00410 00411 // //////////////////////////////////////////////////////////////////// 00412 ConstSegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00413 getConstSegmentCabinDTDRangeAvailabilitySnapshotView 00414 (const SegmentDataID_T iSCIdxBegin, const SegmentDataID_T iSCIdxEnd, 00415 const DTD_T iDTDBegin, const DTD_T iDTDEnd) const { 00416 const unsigned int lNbOfClasses = _classIndexMap.size(); 00417 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00418 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses; 00419 00420 return _availabilitySnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00421 } 00422 00423 // //////////////////////////////////////////////////////////////////// 00424 SegmentCabinDTDSnapshotView_T SegmentSnapshotTable:: 00425 getSegmentCabinDTDAvailabilitySnapshotView (const SegmentDataID_T iSCIdxBegin, 00426 const SegmentDataID_T iSCIdxEnd, 00427 const DTD_T iDTD) { 00428 const unsigned int lNbOfClasses = _classIndexMap.size(); 00429 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00430 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00431 00432 return _availabilitySnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ]; 00433 } 00434 00435 // //////////////////////////////////////////////////////////////////// 00436 SegmentCabinDTDRangeSnapshotView_T SegmentSnapshotTable:: 00437 getSegmentCabinDTDRangeAvailabilitySnapshotView(const SegmentDataID_T iSCIdxBegin, 00438 const SegmentDataID_T iSCIdxEnd, 00439 const DTD_T iDTDBegin, 00440 const DTD_T iDTDEnd) { 00441 const unsigned int lNbOfClasses = _classIndexMap.size(); 00442 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses; 00443 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses; 00444 00445 return _availabilitySnapshotBlock [ boost::indices[SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][SnapshotBlockRange_T(iDTDBegin, iDTDEnd + 1)] ]; 00446 } 00447 00448 // //////////////////////////////////////////////////////////////////// 00449 void SegmentSnapshotTable::serialisationImplementationExport() const { 00450 std::ostringstream oStr; 00451 boost::archive::text_oarchive oa (oStr); 00452 oa << *this; 00453 } 00454 00455 // //////////////////////////////////////////////////////////////////// 00456 void SegmentSnapshotTable::serialisationImplementationImport() { 00457 std::istringstream iStr; 00458 boost::archive::text_iarchive ia (iStr); 00459 ia >> *this; 00460 } 00461 00462 // //////////////////////////////////////////////////////////////////// 00463 template<class Archive> 00464 void SegmentSnapshotTable::serialize (Archive& ioArchive, 00465 const unsigned int iFileVersion) { 00466 ioArchive & _key; 00467 } 00468 00469 } 00470