8 #include <boost/multi_array.hpp>
10 #include <boost/archive/text_iarchive.hpp>
11 #include <boost/archive/text_oarchive.hpp>
12 #include <boost/serialization/access.hpp>
21 SegmentSnapshotTable::SegmentSnapshotTable()
27 SegmentSnapshotTable::SegmentSnapshotTable (
const SegmentSnapshotTable&)
33 SegmentSnapshotTable::
34 SegmentSnapshotTable (
const Key_T& iKey) : _key (iKey), _parent (NULL) {
43 std::ostringstream oStr;
63 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses]
66 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses]
69 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses]
72 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses]
75 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses]
78 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses]
81 resize (boost::extents[lNumberOfSegmentCabins*lNumberOfClasses]
89 ClassIndexMap_T::const_iterator itVTIdx =
92 return itVTIdx->second;
98 SegmentCabinIndexMap_T::const_iterator itSCIdx =
101 return itSCIdx->second;
108 const DTD_T iDTD)
const {
110 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
111 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
120 const DTD_T iDTDBegin,
const DTD_T iDTDEnd)
const {
121 const unsigned int lNbOfClasses = _classIndexMap.size();
122 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
123 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses;
134 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
135 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
144 const DTD_T iDTDBegin,
145 const DTD_T iDTDEnd) {
147 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
148 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
157 const DTD_T iDTD)
const {
159 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
160 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
169 const DTD_T iDTDBegin,
const DTD_T iDTDEnd)
const {
170 const unsigned int lNbOfClasses = _classIndexMap.size();
171 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
172 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses;
183 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
184 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
193 const DTD_T iDTDBegin,
194 const DTD_T iDTDEnd) {
196 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
197 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
206 const DTD_T iDTD)
const {
208 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
209 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
218 const DTD_T iDTDBegin,
const DTD_T iDTDEnd)
const {
219 const unsigned int lNbOfClasses = _classIndexMap.size();
220 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
221 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses;
232 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
233 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
242 const DTD_T iDTDBegin,
243 const DTD_T iDTDEnd) {
245 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
246 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
256 const DTD_T iDTD)
const {
258 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
259 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
268 const DTD_T iDTDBegin,
const DTD_T iDTDEnd)
const {
269 const unsigned int lNbOfClasses = _classIndexMap.size();
270 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
271 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses;
282 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
283 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
292 const DTD_T iDTDBegin,
293 const DTD_T iDTDEnd) {
295 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
296 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
305 const DTD_T iDTD)
const {
307 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
308 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
317 const DTD_T iDTDBegin,
const DTD_T iDTDEnd)
const {
318 const unsigned int lNbOfClasses = _classIndexMap.size();
319 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
320 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses;
331 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
332 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
341 const DTD_T iDTDBegin,
342 const DTD_T iDTDEnd) {
344 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
345 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
355 const DTD_T iDTD)
const {
357 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
358 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
367 const DTD_T iDTDBegin,
const DTD_T iDTDEnd)
const {
368 const unsigned int lNbOfClasses = _classIndexMap.size();
369 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
370 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses;
380 const unsigned int lNbOfClasses = _classIndexMap.size();
381 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
382 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
384 return _priceOrientedGrossBookingSnapshotBlock [ boost::indices[
SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ];
392 const unsigned int lNbOfClasses = _classIndexMap.size();
393 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
394 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
403 const DTD_T iDTD)
const {
404 const unsigned int lNbOfClasses = _classIndexMap.size();
405 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
406 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
408 return _availabilitySnapshotBlock [ boost::indices[
SnapshotBlockRange_T(lClassIdxBegin, lClassIdxEnd)][iDTD] ];
415 const DTD_T iDTDBegin,
const DTD_T iDTDEnd)
const {
416 const unsigned int lNbOfClasses = _classIndexMap.size();
417 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
418 const unsigned int lClassIdxEnd = (iSCIdxEnd +1) * lNbOfClasses;
429 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
430 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
439 const DTD_T iDTDBegin,
440 const DTD_T iDTDEnd) {
442 const unsigned int lClassIdxBegin = iSCIdxBegin * lNbOfClasses;
443 const unsigned int lClassIdxEnd = (iSCIdxEnd + 1) * lNbOfClasses;
449 void SegmentSnapshotTable::serialisationImplementationExport()
const {
450 std::ostringstream oStr;
451 boost::archive::text_oarchive oa (oStr);
456 void SegmentSnapshotTable::serialisationImplementationImport() {
457 std::istringstream iStr;
458 boost::archive::text_iarchive ia (iStr);
463 template<
class Archive>
465 const unsigned int iFileVersion) {