*/
#include <cassert>
#include <sstream>
namespace stdair {
void CmdBomManager::buildSampleBom (BomRoot& ioBomRoot) {
<< "specifications.");
buildSampleInventorySchedule (ioBomRoot);
buildSamplePricing (ioBomRoot);
buildPartnershipsSampleInventoryAndRM (ioBomRoot);
buildPartnershipsSamplePricing (ioBomRoot);
buildCompleteDummyInventory (ioBomRoot);
buildSampleInventoryScheduleForFareFamilies (ioBomRoot);
buildSamplePricingForFareFamilies (ioBomRoot);
buildCompleteDummyInventoryForFareFamilies (ioBomRoot);
}
void CmdBomManager::buildSampleInventorySchedule (BomRoot& ioBomRoot) {
const InventoryKey lBAKey (lAirlineCodeBA);
Inventory& lBAInv = FacBom<Inventory>::instance().create (lBAKey);
const AirlineFeatureKey lAirlineFeatureBAKey (lAirlineCodeBA);
AirlineFeature& lAirlineFeatureBA =
FacBom<AirlineFeature>::instance().create (lAirlineFeatureBAKey);
const InventoryKey lAFKey (lAirlineCodeAF);
Inventory& lAFInv = FacBom<Inventory>::instance().create (lAFKey);
const AirlineFeatureKey lAirlineFeatureAFKey (lAirlineCodeAF);
AirlineFeature& lAirlineFeatureAF =
FacBom<AirlineFeature>::instance().create (lAirlineFeatureAFKey);
FlightDateKey lFlightDateKey (lFlightNumber, lDate);
FlightDate& lBA9_20110610_FD =
FacBom<FlightDate>::instance().create (lFlightDateKey);
SegmentDateKey lSegmentDateKey (lLHR, lSYD);
SegmentDate& lLHRSYDSegment =
FacBom<SegmentDate>::instance().create (lSegmentDateKey);
const std::string lBALHRRoutingLegStr = "BA;9;2011-Jun-10;LHR";
const std::string lBABKKRoutingLegStr = "BA;9;2011-Jun-10;BKK";
lLHRSYDSegment.addLegKey (lBALHRRoutingLegStr);
lLHRSYDSegment.addLegKey (lBABKKRoutingLegStr);
lLHRSYDSegment.setBoardingDate (lDate);
lLHRSYDSegment.setOffDate (lDate + l2Days);
lLHRSYDSegment.setBoardingTime (l2135);
lLHRSYDSegment.setOffTime (l0610);
lLHRSYDSegment.setElapsedTime (l2135);
lSegmentDateKey = SegmentDateKey (lLHR, lBKK);
SegmentDate& lLHRBKKSegment =
FacBom<SegmentDate>::instance().create (lSegmentDateKey);
lLHRBKKSegment.addLegKey (lBALHRRoutingLegStr);
lLHRBKKSegment.setBoardingDate (lDate);
lLHRBKKSegment.setOffDate (lDate + l1Day);
lLHRBKKSegment.setBoardingTime (l2135);
lLHRBKKSegment.setOffTime (l1540);
lLHRBKKSegment.setElapsedTime (l1105);
lSegmentDateKey = SegmentDateKey (lBKK, lSYD);
SegmentDate& lBKKSYDSegment =
FacBom<SegmentDate>::instance().create (lSegmentDateKey);
lBKKSYDSegment.addLegKey (lBABKKRoutingLegStr);
lBKKSYDSegment.setBoardingDate (lDate + l1Day);
lBKKSYDSegment.setOffDate (lDate + l2Days);
lBKKSYDSegment.setBoardingTime (l1705);
lBKKSYDSegment.setOffTime (l1540);
lBKKSYDSegment.setElapsedTime (l0905);
LegDateKey lLegDateKey (lLHR);
LegDate& lLHRLeg = FacBom<LegDate>::instance().create (lLegDateKey);
lLHRLeg.setOffPoint (lBKK);
lLHRLeg.setBoardingDate (lDate);
lLHRLeg.setOffDate (lDate + l1Day);
lLHRLeg.setBoardingTime (l2135);
lLHRLeg.setOffTime (l1540);
lLHRLeg.setElapsedTime (l1105);
lLegDateKey = LegDateKey (lBKK);
LegDate& lBKKLeg = FacBom<LegDate>::instance().create (lLegDateKey);
lBKKLeg.setOffPoint (lSYD);
lBKKLeg.setBoardingDate (lDate + l1Day);
lBKKLeg.setOffDate (lDate + l2Days);
lBKKLeg.setBoardingTime (l1705);
lBKKLeg.setOffTime (l1540);
lBKKLeg.setElapsedTime (l0905);
SegmentCabinKey lYSegmentCabinKey (lY);
SegmentCabin& lLHRBKKSegmentYCabin =
FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
SegmentCabin& lBKKSYDSegmentYCabin =
FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
SegmentCabin& lLHRSYDSegmentYCabin =
FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
LegCabinKey lYLegCabinKey (lY);
LegCabin& lLHRLegYCabin =
FacBom<LegCabin>::instance().create (lYLegCabinKey);
LegCabin& lBKKLegYCabin =
FacBom<LegCabin>::instance().create (lYLegCabinKey);
FareFamilyKey l1FareFamilyKey (l1);
FareFamily& lLHRBKKSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
lLHRBKKSegmentYCabin1Family);
lLHRBKKSegmentYCabin1Family);
FareFamily& lBKKSYDSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
lBKKSYDSegmentYCabin1Family);
lBKKSYDSegmentYCabin1Family);
FareFamily& lLHRSYDSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
lLHRSYDSegmentYCabin1Family);
lLHRSYDSegmentYCabin1Family);
BookingClassKey lQBookingClassKey (lQ);
BookingClass& lLHRBKKSegmentYCabin1FamilyQClass =
FacBom<BookingClass>::instance().create (lQBookingClassKey);
lLHRBKKSegmentYCabin1FamilyQClass);
lLHRBKKSegmentYCabin1FamilyQClass);
lLHRBKKSegmentYCabin1FamilyQClass);
lLHRBKKSegmentYCabin1FamilyQClass);
BookingClass& lBKKSYDSegmentYCabin1FamilyQClass =
FacBom<BookingClass>::instance().create (lQBookingClassKey);
lBKKSYDSegmentYCabin1FamilyQClass);
lBKKSYDSegmentYCabin1FamilyQClass);
lBKKSYDSegmentYCabin1FamilyQClass);
lBKKSYDSegmentYCabin1FamilyQClass);
BookingClass& lLHRSYDSegmentYCabin1FamilyQClass =
FacBom<BookingClass>::instance().create (lQBookingClassKey);
lLHRSYDSegmentYCabin1FamilyQClass);
lLHRSYDSegmentYCabin1FamilyQClass);
lLHRSYDSegmentYCabin1FamilyQClass);
lLHRSYDSegmentYCabin1FamilyQClass);
lFlightNumber = 84;
lFlightDateKey = FlightDateKey (lFlightNumber, lDate);
FlightDate& lAF084_20110320_FD =
FacBom<FlightDate>::instance().create (lFlightDateKey);
lSegmentDateKey = SegmentDateKey (lCDG, lSFO);
SegmentDate& lCDGSFOSegment =
FacBom<SegmentDate>::instance().create (lSegmentDateKey);
const std::string lAFCDGRoutingLegStr = "AF;84;2011-Mar-20;CDG";
lCDGSFOSegment.addLegKey (lAFCDGRoutingLegStr);
lCDGSFOSegment.setBoardingDate (lDate);
lCDGSFOSegment.setOffDate (lDate);
lCDGSFOSegment.setBoardingTime (l1040);
lCDGSFOSegment.setOffTime (l1250);
lCDGSFOSegment.setElapsedTime (l1110);
lLegDateKey = LegDateKey (lCDG);
LegDate& lCDGLeg = FacBom<LegDate>::instance().create (lLegDateKey);
lCDGLeg.setOffPoint (lSFO);
lCDGLeg.setBoardingDate (lDate);
lCDGLeg.setOffDate (lDate);
lCDGLeg.setBoardingTime (l1040);
lCDGLeg.setOffTime (l1250);
lCDGLeg.setElapsedTime (l1110);
SegmentCabin& lCDGSFOSegmentYCabin =
FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
LegCabin& lCDGLegYCabin =
FacBom<LegCabin>::instance().create (lYLegCabinKey);
FareFamily& lCDGSFOSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
lCDGSFOSegmentYCabin1Family);
lCDGSFOSegmentYCabin1Family);
BookingClass& lCDGSFOSegmentYCabin1FamilyQClass =
FacBom<BookingClass>::instance().create (lQBookingClassKey);
lCDGSFOSegmentYCabin1FamilyQClass);
lCDGSFOSegmentYCabin1FamilyQClass);
lCDGSFOSegmentYCabin1FamilyQClass);
lCDGSFOSegmentYCabin1FamilyQClass);
const DoWStruct lDoWSrtuct ("1111111");
const Date_T lBA9DateRangeStart (2010, boost::gregorian::Jun, 6);
const Date_T lBA9DateRangeEnd (2010, boost::gregorian::Jun, 7);
const DatePeriod_T lBA9DatePeriod (lBA9DateRangeStart, lBA9DateRangeEnd);
const PeriodStruct lBA9PeriodStruct (lBA9DatePeriod, lDoWSrtuct);
FlightPeriodKey lBA9FlightPeriodKey (lFlightNumber, lBA9PeriodStruct);
FlightPeriod& lBA9FlightPeriod =
FacBom<FlightPeriod>::instance().create (lBA9FlightPeriodKey);
SegmentPeriodKey lLHRSYDSegmentPeriodKey (lLHR, lSYD);
SegmentPeriod& lLHRSYDSegmentPeriod =
FacBom<SegmentPeriod>::instance().create (lLHRSYDSegmentPeriodKey);
lLHRSYDSegmentPeriod.setBoardingTime (l2135);
lLHRSYDSegmentPeriod.setOffTime (l1540);
lLHRSYDSegmentPeriod.setElapsedTime (l1105);
lLHRSYDSegmentPeriod.addCabinBookingClassList (lY,lYM);
const Date_T lAF84DateRangeStart (2011, boost::gregorian::Mar, 20);
const Date_T lAF84DateRangeEnd (2011, boost::gregorian::Mar, 21);
const DatePeriod_T lAF84DatePeriod (lAF84DateRangeStart, lAF84DateRangeEnd);
const PeriodStruct lAF84PeriodStruct (lAF84DatePeriod, lDoWSrtuct);
FlightPeriodKey lAF84FlightPeriodKey (lFlightNumber, lAF84PeriodStruct);
FlightPeriod& lAF84FlightPeriod =
FacBom<FlightPeriod>::instance().create (lAF84FlightPeriodKey);
SegmentPeriodKey lCDGSFOSegmentPeriodKey (lCDG, lSFO);
SegmentPeriod& lCDGSFOSegmentPeriod =
FacBom<SegmentPeriod>::instance().create (lCDGSFOSegmentPeriodKey);
lCDGSFOSegmentPeriod.setBoardingTime (l1040);
lCDGSFOSegmentPeriod.setOffTime (l1250);
lCDGSFOSegmentPeriod.setElapsedTime (l1110);
lCDGSFOSegmentPeriod.addCabinBookingClassList (lY,lYM);
OnDString_T lBALHRSYDOnDStr =
"BA;9,2010-Jun-06;LHR,SYD";
lBAOnDStrList.push_back (lBALHRSYDOnDStr);
OnDDateKey lBAOnDDateKey (lBAOnDStrList);
OnDDate& lBA_LHRSYD_OnDDate =
FacBom<OnDDate>::instance().create (lBAOnDDateKey);
const WTP_T lWTP750 = 750.0;
lBA_LHRSYD_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
OnDString_T lAFLHRSYDOnDStr =
"AF;9,2011-Mar-20;CDG,SFO";
lAFOnDStrList.push_back (lAFLHRSYDOnDStr);
OnDDateKey lAFOnDDateKey (lAFOnDStrList);
OnDDate& lAF_LHRSYD_OnDDate =
FacBom<OnDDate>::instance().create (lAFOnDDateKey);
lAF_LHRSYD_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
}
void CmdBomManager::
buildSampleInventoryScheduleForFareFamilies (BomRoot& ioBomRoot) {
const InventoryKey lSQKey ("SQ");
Inventory& lSQInv = BomManager::getObject<Inventory>(ioBomRoot,
lSQKey.toString());
const Date_T lDate (2010, 2, 8);
const FlightDateKey lFlightDateKey (lFlightNumber747, lDate);
FlightDate& lSQ747_20100208_FD =
FacBom<FlightDate>::instance().create (lFlightDateKey);
const SegmentDateKey lSegmentDateKey (lSIN, lBKK);
SegmentDate& lSINBKKSegment =
FacBom<SegmentDate>::instance().create (lSegmentDateKey);
const std::string lSQSINRoutingLegStr = "SQ;747;2010-Feb-8;SIN";
lSINBKKSegment.addLegKey (lSQSINRoutingLegStr);
lSINBKKSegment.setBoardingDate (lDate);
lSINBKKSegment.setOffDate (lDate);
lSINBKKSegment.setBoardingTime (l0635);
lSINBKKSegment.setOffTime (l0800);
lSINBKKSegment.setElapsedTime (l0225);
const LegDateKey lLegDateKey (lSIN);
LegDate& lSINLeg = FacBom<LegDate>::instance().create (lLegDateKey);
lSINLeg.setOffPoint (lBKK);
lSINLeg.setBoardingDate (lDate);
lSINLeg.setOffDate (lDate);
lSINLeg.setBoardingTime (l0635);
lSINLeg.setOffTime (l0800);
lSINLeg.setElapsedTime (l0225);
const SegmentCabinKey lYSegmentCabinKey (lY);
SegmentCabin& lSINBKKSegmentYCabin =
FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
lSINBKKSegmentYCabin.activateFareFamily ();
const LegCabinKey lYLegCabinKey (lY);
LegCabin& lSINLegYCabin =
FacBom<LegCabin>::instance().create (lYLegCabinKey);
const FareFamilyKey l1FareFamilyKey (l1);
FareFamily& lSINBKKSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
lSINBKKSegmentYCabin1Family);
lSINBKKSegmentYCabin1Family);
const FareFamilyKey l2FareFamilyKey (l2);
FareFamily& lSINBKKSegmentYCabin2Family =
FacBom<FareFamily>::instance().create (l2FareFamilyKey);
lSINBKKSegmentYCabin2Family);
lSINBKKSegmentYCabin2Family);
const BookingClassKey lYBookingClassKey (lClassY);
BookingClass& lSINBKKSegmentYCabin2FamilyYClass =
FacBom<BookingClass>::instance().create (lYBookingClassKey);
lSINBKKSegmentYCabin2FamilyYClass);
lSINBKKSegmentYCabin2FamilyYClass);
lSINBKKSegmentYCabin2FamilyYClass);
lSINBKKSegmentYCabin2FamilyYClass);
lSINBKKSegmentYCabin2FamilyYClass.setYield(1200);
const BookingClassKey lBBookingClassKey (lB);
BookingClass& lSINBKKSegmentYCabin2FamilyBClass =
FacBom<BookingClass>::instance().create (lBBookingClassKey);
lSINBKKSegmentYCabin2FamilyBClass);
lSINBKKSegmentYCabin2FamilyBClass);
lSINBKKSegmentYCabin2FamilyBClass);
lSINBKKSegmentYCabin2FamilyBClass);
lSINBKKSegmentYCabin2FamilyBClass.setYield(800);
const BookingClassKey lMBookingClassKey (lM);
BookingClass& lSINBKKSegmentYCabin1FamilyMClass =
FacBom<BookingClass>::instance().create (lMBookingClassKey);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass.setYield(900);
const BookingClassKey lQBookingClassKey (lQ);
BookingClass& lSINBKKSegmentYCabin1FamilyQClass =
FacBom<BookingClass>::instance().create (lQBookingClassKey);
lSINBKKSegmentYCabin1FamilyQClass);
lSINBKKSegmentYCabin1FamilyQClass);
lSINBKKSegmentYCabin1FamilyQClass);
lSINBKKSegmentYCabin1FamilyQClass);
lSINBKKSegmentYCabin1FamilyQClass.setYield(600);
const DoWStruct lDoWSrtuct ("1111111");
const Date_T lSQ747DateRangeStart (2010, boost::gregorian::Feb, 8);
const Date_T lSQ747DateRangeEnd (2010, boost::gregorian::Feb, 9);
lSQ747DateRangeEnd);
const PeriodStruct lSQ747PeriodStruct (lSQ747DatePeriod, lDoWSrtuct);
const FlightPeriodKey lSQ747FlightPeriodKey (lFlightNumber747,
lSQ747PeriodStruct);
FlightPeriod& lSQ747FlightPeriod =
FacBom<FlightPeriod>::instance().create (lSQ747FlightPeriodKey);
const SegmentPeriodKey lSINBKKSegmentPeriodKey (lSIN, lBKK);
SegmentPeriod& lSINBKKSegmentPeriod =
FacBom<SegmentPeriod>::instance().create (lSINBKKSegmentPeriodKey);
lSINBKKSegmentPeriod.addCabinBookingClassList (lY,lYBMQ);
lSINBKKSegmentPeriod.setBoardingTime (l0635);
lSINBKKSegmentPeriod.setOffTime (l0800);
lSINBKKSegmentPeriod.setElapsedTime (l0225);
const OnDString_T lSQSINBKKOnDStr =
"SQ;747,2011-Feb-14;SIN,BKK";
lSQOnDStrList.push_back (lSQSINBKKOnDStr);
const OnDDateKey lSQOnDDateKey (lSQOnDStrList);
OnDDate& lSQ_SINBKK_OnDDate =
FacBom<OnDDate>::instance().create (lSQOnDDateKey);
const WTP_T lWTP1000 = 1000.0;
const WTPDemandPair_T lWTP1000Mean120StdDev12 (lWTP1000, lMean120StdDev12);
lSQ_SINBKK_OnDDate.setTotalForecast (lY, lWTP1000Mean120StdDev12);
}
void CmdBomManager::buildDummyLegSegmentAccesses (BomRoot& ioBomRoot) {
SegmentCabin& lDummySegmentCabin =
LegCabin& lDummyLegCabin =
const bool isForFareFamilies = true;
SegmentCabin& lFFDummySegmentCabin =
isForFareFamilies);
}
void CmdBomManager::buildCompleteDummyInventory (BomRoot& ioBomRoot) {
buildDummyInventory (ioBomRoot, lCapacity);
SegmentCabin& lDummySegmentCabin =
LegCabin& lDummyLegCabin =
BookingClass& lDummyBookingClass =
FacBom<BookingClass>::instance().create (lBCKey);
lDummyBookingClass.setYield (lYield);
lDummyBookingClass.setMean (lMean);
lDummyBookingClass.setStdDev (lStdDev);
lDummyBookingClassList.push_back(&lDummyBookingClass);
VirtualClassStruct lDummyVirtualClass (lDummyBookingClassList);
lDummyVirtualClass.setYield (lYield);
lDummyVirtualClass.setMean (lMean);
lDummyVirtualClass.setStdDev (lStdDev);
lDummyLegCabin.addVirtualClass (lDummyVirtualClass);
lYield = 70;
lMean = 45;
lStdDev= 12;
lDummyBookingClass.setYield (lYield);
lDummyBookingClass.setMean (lMean);
lDummyBookingClass.setStdDev (lStdDev);
lDummyVirtualClass.setYield (lYield);
lDummyVirtualClass.setMean (lMean);
lDummyVirtualClass.setStdDev (lStdDev);
lDummyLegCabin.addVirtualClass (lDummyVirtualClass);
lYield = 42;
lMean = 80;
lStdDev= 16;
lDummyBookingClass.setYield (lYield);
lDummyBookingClass.setMean (lMean);
lDummyBookingClass.setStdDev (lStdDev);
lDummyVirtualClass.setYield (lYield);
lDummyVirtualClass.setMean (lMean);
lDummyVirtualClass.setStdDev (lStdDev);
lDummyLegCabin.addVirtualClass (lDummyVirtualClass);
}
void CmdBomManager::buildDummyInventory (BomRoot& ioBomRoot,
Inventory& lInv = FacBom<Inventory>::instance().create (lInventoryKey);
AirlineFeature& lAirlineFeature =
FacBom<AirlineFeature>::instance().create (lAirlineFeatureKey);
FlightDate& lFlightDate =
FacBom<FlightDate>::instance().create (lFlightDateKey);
LegDate& lLeg = FacBom<LegDate>::instance().create (lLegDateKey);
LegCabin& lLegCabin = FacBom<LegCabin>::instance().create (lLegCabinKey);
lLegCabin.setCapacities (iCapacity);
lLegCabin.setAvailabilityPool (iCapacity);
SegmentDate& lSegment =
FacBom<SegmentDate>::instance().create (lSegmentDateKey);
std::ostringstream oStr;
lSegment.addLegKey (oStr.str());
SegmentCabin& lSegmentCabin =
FacBom<SegmentCabin>::instance().create (lSegmentCabinKey);
FareFamilyKey l1FareFamilyKey (l1);
FareFamily& lSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
BookingClassKey lQBookingClassKey (lQ);
BookingClass& lSegmentYCabin1FamilyQClass =
FacBom<BookingClass>::instance().create (lQBookingClassKey);
lSegmentYCabin1FamilyQClass);
lSegmentYCabin1FamilyQClass);
const DoWStruct lDoWSrtuct ("1111111");
const DatePeriod_T lXXDatePeriod (lXXDateRangeStart, lXXDateRangeEnd);
const PeriodStruct lXXPeriodStruct (lXXDatePeriod, lDoWSrtuct);
FlightPeriod& lXXFlightPeriod =
FacBom<FlightPeriod>::instance().create (lXXFlightPeriodKey);
SegmentPeriod& lXXSegmentPeriod =
FacBom<SegmentPeriod>::instance().create (lXXSegmentPeriodKey);
lXXSegmentPeriod.setBoardingTime (
Duration_T (14, 0, 0));
lXXSegmentPeriod.setOffTime (
Duration_T (16, 0, 0));
lXXSegmentPeriod.setElapsedTime (
Duration_T (8, 0, 0));
lXXSegmentPeriod.addCabinBookingClassList (lY,lYQ);
}
void CmdBomManager::
buildCompleteDummyInventoryForFareFamilies (BomRoot& ioBomRoot) {
Inventory& lInv = BomManager::getObject<Inventory>(ioBomRoot,
lInventoryKey.toString());
FlightDate& lFlightDate =
FacBom<FlightDate>::instance().create (lFlightDateKey);
LegDateKey lLegDateKey (DEFAULT_ORIGIN);
LegDate& lLeg = FacBom<LegDate>::instance().create (lLegDateKey);
LegCabin& lLegCabin = FacBom<LegCabin>::instance().create (lLegCabinKey);
lLegCabin.setCapacities (lCapacity);
lLegCabin.setAvailabilityPool (lCapacity);
SegmentDate& lSegment =
FacBom<SegmentDate>::instance().create (lSegmentDateKey);
std::ostringstream oStr;
lSegment.addLegKey (oStr.str());
SegmentCabin& lSegmentCabin =
FacBom<SegmentCabin>::instance().create (lSegmentCabinKey);
const FareFamilyKey l1FareFamilyKey (l1);
FareFamily& lSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
const unsigned int size = 16;
for (unsigned int idx = 0; idx < size; ++idx) {
double i = static_cast<double> (idx);
lDemandVector1FareFamily.push_back(lMeanStdDevPair);
}
lSegmentYCabin1Family.setMeanStdDev(lDemandVector1FareFamily);
const BookingClassKey lYBookingClassKey (lY);
BookingClass& lSegmentYCabin1FamilyYClass =
FacBom<BookingClass>::instance().create (lYBookingClassKey);
lSegmentYCabin1FamilyYClass.setYield(lYield);
lSegmentYCabin1FamilyYClass);
lSegmentYCabin1FamilyYClass);
const BookingClassKey lUBookingClassKey (lU);
BookingClass& lSegmentYCabin1FamilyUClass =
FacBom<BookingClass>::instance().create (lUBookingClassKey);
lYield = 600;
lSegmentYCabin1FamilyUClass.setYield(lYield);
lSegmentYCabin1FamilyUClass);
lSegmentYCabin1FamilyUClass);
const FareFamilyKey l2FareFamilyKey (l2);
FareFamily& lSegmentYCabin2Family =
FacBom<FareFamily>::instance().create (l2FareFamilyKey);
for (unsigned int idx = 0; idx < size; ++idx) {
double i = static_cast<double> (idx);
lDemandVector2FareFamily.push_back(lMeanStdDevPair);
}
lSegmentYCabin2Family.setMeanStdDev(lDemandVector2FareFamily);
const BookingClassKey lOBookingClassKey (lO);
BookingClass& lSegmentYCabin2FamilyOClass =
FacBom<BookingClass>::instance().create (lOBookingClassKey);
lYield = 750;
lSegmentYCabin2FamilyOClass.setYield(lYield);
lSegmentYCabin2FamilyOClass);
lSegmentYCabin2FamilyOClass);
const BookingClassKey lQBookingClassKey (lQ);
BookingClass& lSegmentYCabin2FamilyQClass =
FacBom<BookingClass>::instance().create (lQBookingClassKey);
lYield = 400;
lSegmentYCabin2FamilyQClass.setYield(lYield);
lSegmentYCabin2FamilyQClass);
lSegmentYCabin2FamilyQClass);
const DoWStruct lDoWSrtuct ("1111111");
const DatePeriod_T lXXDatePeriod (lXXDateRangeStart, lXXDateRangeEnd);
const PeriodStruct lXXPeriodStruct (lXXDatePeriod, lDoWSrtuct);
lXXPeriodStruct);
FlightPeriod& lXXFlightPeriod =
FacBom<FlightPeriod>::instance().create (lXXFlightPeriodKey);
const SegmentPeriodKey lXXSegmentPeriodKey (DEFAULT_ORIGIN,
SegmentPeriod& lXXSegmentPeriod =
FacBom<SegmentPeriod>::instance().create (lXXSegmentPeriodKey);
lXXSegmentPeriod.setBoardingTime (
Duration_T (14, 0, 0));
lXXSegmentPeriod.setOffTime (
Duration_T (16, 0, 0));
lXXSegmentPeriod.setElapsedTime (
Duration_T (8, 0, 0));
lXXSegmentPeriod.addCabinBookingClassList (lYCabin,lYUOQ);
}
void CmdBomManager::buildSamplePricing (BomRoot& ioBomRoot) {
AirportPair& lAirportPair =
FacBom<AirportPair>::instance().create (lAirportPairKey);
const Date_T lDateRangeStart (2011, boost::gregorian::Jan, 15);
const Date_T lDateRangeEnd (2011, boost::gregorian::Dec, 31);
const DatePeriod_T lDateRange (lDateRangeStart, lDateRangeEnd);
const DatePeriodKey lDatePeriodKey (lDateRange);
DatePeriod& lDatePeriod =
FacBom<DatePeriod>::instance().create (lDatePeriodKey);
PosChannel& lPosChannel =
FacBom<PosChannel>::instance().create (lPosChannelKey);
const Time_T lTimeRangeStart (0, 0, 0);
const Time_T lTimeRangeEnd (23, 0, 0);
const TimePeriodKey lTimePeriodKey (lTimeRangeStart, lTimeRangeEnd);
TimePeriod& lTimePeriod =
FacBom<TimePeriod>::instance().create (lTimePeriodKey);
FareFeatures& lFareFeatures =
FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
YieldFeatures& lYieldFeatures =
FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
const AirlineClassListKey lAirlineClassListKey (lAirlineCodeList,
lClassCodeList);
AirlineClassList& lAirlineClassList =
FacBom<AirlineClassList>::instance().create (lAirlineClassListKey);
lAirlineClassList.setFare (900);
lAirlineClassList.setYield (900);
}
void CmdBomManager::buildSamplePricingForFareFamilies (BomRoot& ioBomRoot) {
const AirportPairKey lAirportPairKey ("SIN", "BKK");
AirportPair& lAirportPair =
BomManager::getObject<AirportPair>(ioBomRoot, lAirportPairKey.toString());
const Date_T lDateRangeStart (2010, boost::gregorian::Feb, 1);
const Date_T lDateRangeEnd (2011, boost::gregorian::Feb, 15);
const DatePeriod_T lDateRange (lDateRangeStart, lDateRangeEnd);
const DatePeriodKey lDatePeriodKey (lDateRange);
DatePeriod& lDatePeriod =
FacBom<DatePeriod>::instance().create (lDatePeriodKey);
const PosChannelKey lPosChannelKey (
"SIN",
CHANNEL_IN);
PosChannel& lPosChannel =
FacBom<PosChannel>::instance().create (lPosChannelKey);
const Time_T lTimeRangeStart (0, 0, 0);
const Time_T lTimeRangeEnd (23, 0, 0);
const TimePeriodKey lTimePeriodKey (lTimeRangeStart, lTimeRangeEnd);
TimePeriod& lTimePeriod =
FacBom<TimePeriod>::instance().create (lTimePeriodKey);
ONE_MONTH_ADVANCE_PURCHASE,
FareFeatures& lFareFeaturesQ =
FacBom<FareFeatures>::instance().create (lFareFeaturesQKey);
FareFeatures& lFareFeaturesM =
FacBom<FareFeatures>::instance().create (lFareFeaturesMKey);
ONE_MONTH_ADVANCE_PURCHASE,
FareFeatures& lFareFeaturesB =
FacBom<FareFeatures>::instance().create (lFareFeaturesBKey);
FareFeatures& lFareFeaturesY =
FacBom<FareFeatures>::instance().create (lFareFeaturesYKey);
YieldFeatures& lYieldFeatures =
FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
lAirlineCodeList.push_back ("SQ");
const AirlineClassListKey lAirlineClassYListKey (lAirlineCodeList,
lClassYList);
AirlineClassList& lAirlineClassYList =
FacBom<AirlineClassList>::instance().create (lAirlineClassYListKey);
lAirlineClassYList.setFare (1200);
lAirlineClassYList.setYield (1200);
lClassBList.push_back ("B");
const AirlineClassListKey lAirlineClassBListKey (lAirlineCodeList,
lClassBList);
AirlineClassList& lAirlineClassBList =
FacBom<AirlineClassList>::instance().create (lAirlineClassBListKey);
lAirlineClassBList.setFare (800);
lAirlineClassBList.setYield (800);
lClassMList.push_back ("M");
const AirlineClassListKey lAirlineClassMListKey (lAirlineCodeList,
lClassMList);
AirlineClassList& lAirlineClassMList =
FacBom<AirlineClassList>::instance().create (lAirlineClassMListKey);
lAirlineClassMList.setFare (900);
lAirlineClassMList.setYield (900);
lClassQList.push_back ("Q");
const AirlineClassListKey lAirlineClassQListKey (lAirlineCodeList,
lClassQList);
AirlineClassList& lAirlineClassQList =
FacBom<AirlineClassList>::instance().create (lAirlineClassQListKey);
lAirlineClassQList.setFare (600);
lAirlineClassQList.setYield (600);
}
void CmdBomManager::
ioTravelSolutionList.clear();
const std::string lBA9_SegmentDateKey ("BA, 9, 2011-06-10, LHR, SYD, 21:45");
TravelSolutionStruct lTS;
lTS.addSegment (lBA9_SegmentDateKey);
ioTravelSolutionList.push_back (lTS);
}
void CmdBomManager::
ioTravelSolutionList.clear();
const std::string lBA9_SegmentDateKey ("BA, 9, 2011-06-10, LHR, SYD, 21:45");
TravelSolutionStruct lTS1;
lTS1.addSegment (lBA9_SegmentDateKey);
const FareOptionStruct lFareOption1 (lClassPathQ, lFare900, lChangeFee,
isNonRefundable, lSaturdayStay);
lTS1.addFareOption (lFareOption1);
bool hasInsertOfQBeenSuccessful = lClassAvailabilityMap1.
insert (ClassAvailabilityMap_T::value_type (lClassPathQ, lAvl1)).second;
assert (hasInsertOfQBeenSuccessful == true);
lTS1.addClassAvailabilityMap (lClassAvailabilityMap1);
ioTravelSolutionList.push_back (lTS1);
const std::string lQF12_SegmentDateKey ("QF, 12, 2011-06-10, LHR, SYD, 20:45");
TravelSolutionStruct lTS2;
lTS2.addSegment (lQF12_SegmentDateKey);
const Fare_T lFare1000 (1000);
const FareOptionStruct lFareOption2 (lClassPathY, lFare1000, lNoChangeFee,
isRefundable, lSaturdayStay);
const bool hasInsertOfYBeenSuccessful = lClassAvailabilityMap2.
insert (ClassAvailabilityMap_T::value_type (lClassPathY, lAvl2)).second;
assert (hasInsertOfYBeenSuccessful == true);
lTS2.addClassAvailabilityMap (lClassAvailabilityMap2);
lTS2.addFareOption (lFareOption2);
const FareOptionStruct lFareOption3 (lClassPathQ, lFare920, lNoChangeFee,
isNonRefundable, lSaturdayStay);
hasInsertOfQBeenSuccessful = lClassAvailabilityMap2.
insert (ClassAvailabilityMap_T::value_type (lClassPathQ, lAvl2)).second;
assert (hasInsertOfYBeenSuccessful == true);
lTS2.addClassAvailabilityMap (lClassAvailabilityMap2);
lTS2.addFareOption (lFareOption3);
ioTravelSolutionList.push_back (lTS2);
}
BookingRequestStruct CmdBomManager::buildSampleBookingRequest() {
const Date_T lPreferredDepartureDate (2011, boost::gregorian::Jun, 10);
const Duration_T lPreferredDepartureTime (8, 0, 0);
const Date_T lRequestDate (2011, boost::gregorian::May, 15);
const DateTime_T lRequestDateTime (lRequestDate, lRequestTime);
BookingRequestStruct oBookingRequest (lOrigin, lDestination, lPOS,
lPreferredDepartureDate,
lRequestDateTime,
lPreferredCabin,
lPartySize, lChannel,
lTripType, lStayDuration,
lFrequentFlyerType,
lPreferredDepartureTime,
lWTP, lValueOfTime,
lChangeFees, lChangeFeeDisutility,
lNonRefundable,
lNonRefundableDisutility);
return oBookingRequest;
}
BookingRequestStruct CmdBomManager::buildSampleBookingRequestForCRS() {
const Date_T lPreferredDepartureDate (2010, boost::gregorian::Jan, 30);
const Duration_T lPreferredDepartureTime (10, 0, 0);
const Date_T lRequestDate (2010, boost::gregorian::Jan, 22);
const DateTime_T lRequestDateTime (lRequestDate, lRequestTime);
BookingRequestStruct oBookingRequest (lOrigin,
lDestination,
lPOS,
lPreferredDepartureDate,
lRequestDateTime,
lPreferredCabin,
lPartySize, lChannel,
lTripType, lStayDuration,
lFrequentFlyerType,
lPreferredDepartureTime,
lWTP, lValueOfTime,
lChangeFees, lChangeFeeDisutility,
lNonRefundable,
lNonRefundableDisutility);
return oBookingRequest;
}
void CmdBomManager::
buildPartnershipsSampleInventoryAndRM (BomRoot& ioBomRoot) {
const InventoryKey lSQKey (lAirlineCodeSQ);
Inventory& lSQInv = FacBom<Inventory>::instance().create (lSQKey);
const AirlineFeatureKey lAirlineFeatureSQKey (lAirlineCodeSQ);
AirlineFeature& lAirlineFeatureSQ =
FacBom<AirlineFeature>::instance().create (lAirlineFeatureSQKey);
const InventoryKey lCXKey (lAirlineCodeCX);
Inventory& lCXInv = FacBom<Inventory>::instance().create (lCXKey);
const AirlineFeatureKey lAirlineFeatureCXKey (lAirlineCodeCX);
AirlineFeature& lAirlineFeatureCX =
FacBom<AirlineFeature>::instance().create (lAirlineFeatureCXKey);
FlightDateKey lFlightDateKey (lFlightNumber, lDate);
FlightDate& lSQ11_20100308_FD =
FacBom<FlightDate>::instance().create (lFlightDateKey);
FlightDateKey lMktFlightDateKey (lMktFlightNumber, lDate);
FlightDate& lSQ1200_20100308_FD =
FacBom<FlightDate>::instance().create (lMktFlightDateKey);
SegmentDateKey lSegmentDateKey (lSIN, lBKK);
SegmentDate& lSINBKKSegment =
FacBom<SegmentDate>::instance().create (lSegmentDateKey);
const std::string lSQSINRoutingLegStr = "SQ;11;2010-Mar-8;SIN";
lSINBKKSegment.addLegKey (lSQSINRoutingLegStr);
lSINBKKSegment.setBoardingDate (lDate);
lSINBKKSegment.setOffDate (lDate);
lSINBKKSegment.setBoardingTime (l0820);
lSINBKKSegment.setOffTime (l1100);
lSINBKKSegment.setElapsedTime (l0340);
SegmentDateKey lMktSegmentDateKey (lBKK, lHKG);
SegmentDate& lMktBKKHKGSegment =
FacBom<SegmentDate>::instance().create (lMktSegmentDateKey);
const std::string lCXBKKRoutingLegStr = "CX;12;2010-Mar-8;BKK";
lMktBKKHKGSegment.addLegKey (lCXBKKRoutingLegStr);
lMktBKKHKGSegment.setBoardingDate (lDate);
lMktBKKHKGSegment.setOffDate (lDate);
lMktBKKHKGSegment.setBoardingTime (l1200);
lMktBKKHKGSegment.setOffTime (l1540);
lMktBKKHKGSegment.setElapsedTime (l0240);
LegDateKey lLegDateKey (lSIN);
LegDate& lSINLeg = FacBom<LegDate>::instance().create (lLegDateKey);
lSINLeg.setOffPoint (lBKK);
lSINLeg.setBoardingDate (lDate);
lSINLeg.setOffDate (lDate);
lSINLeg.setBoardingTime (l0820);
lSINLeg.setOffTime (l1100);
lSINLeg.setElapsedTime (l0340);
SegmentCabinKey lYSegmentCabinKey (lY);
SegmentCabin& lSINBKKSegmentYCabin =
FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
SegmentCabin& lMktBKKHKGSegmentYCabin =
FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
LegCabinKey lYLegCabinKey (lY);
LegCabin& lSINLegYCabin =
FacBom<LegCabin>::instance().create (lYLegCabinKey);
lSINLegYCabin.setCapacities (lCapacity);
lSINLegYCabin.setAvailabilityPool (lCapacity);
FareFamilyKey l1FareFamilyKey (l1);
FareFamily& lSINBKKSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
lSINBKKSegmentYCabin1Family);
lSINBKKSegmentYCabin1Family);
FareFamily& lMktBKKHKGSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
lMktBKKHKGSegmentYCabin1Family);
lMktBKKHKGSegmentYCabin1Family);
BookingClassKey lYBookingClassKey (lY);
BookingClass& lSINBKKSegmentYCabin1FamilyYClass =
FacBom<BookingClass>::instance().create (lYBookingClassKey);
lSINBKKSegmentYCabin1FamilyYClass);
lSINBKKSegmentYCabin1FamilyYClass);
lSINBKKSegmentYCabin1FamilyYClass);
lSINBKKSegmentYCabin1FamilyYClass);
lSINBKKSegmentYCabin1FamilyYClass.setYield(700);
BookingClass& lMktBKKHKGSegmentYCabin1FamilyYClass =
FacBom<BookingClass>::instance().create (lYBookingClassKey);
lMktBKKHKGSegmentYCabin1FamilyYClass);
lMktBKKHKGSegmentYCabin1FamilyYClass);
lMktBKKHKGSegmentYCabin1FamilyYClass);
lMktBKKHKGSegmentYCabin1FamilyYClass);
lMktBKKHKGSegmentYCabin1FamilyYClass.setYield(700);
BookingClassKey lMBookingClassKey (lM);
BookingClass& lSINBKKSegmentYCabin1FamilyMClass =
FacBom<BookingClass>::instance().create (lMBookingClassKey);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass.setYield(500);
BookingClass& lMktBKKHKGSegmentYCabin1FamilyMClass =
FacBom<BookingClass>::instance().create (lMBookingClassKey);
lMktBKKHKGSegmentYCabin1FamilyMClass);
lMktBKKHKGSegmentYCabin1FamilyMClass);
lMktBKKHKGSegmentYCabin1FamilyMClass);
lMktBKKHKGSegmentYCabin1FamilyMClass);
lMktBKKHKGSegmentYCabin1FamilyMClass.setYield(500);
OnDString_T lSQSINBKKOnDStr =
"SQ;11,2010-Mar-08;SIN,BKK";
OnDString_T lMktSQBKKHKGOnDStr =
"SQ;1200,2010-Mar-08;BKK,HKG";
lOnDStringList.push_back (lSQSINBKKOnDStr);
lOnDStringList.push_back (lMktSQBKKHKGOnDStr);
OnDDateKey lOnDDateKey (lOnDStringList);
OnDDate& lSQ_SINHKG_OnDDate =
FacBom<OnDDate>::instance().create (lOnDDateKey);
const WTP_T lWTP750 = 750.0;
lSQ_SINHKG_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
lCabinClassPairList.push_back(lCC_YM1);
lCabinClassPairList.push_back(lCC_YM2);
lSQ_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList, lYield850Mean20StdDev2);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YY1);
lCabinClassPairList.push_back(lCC_YY2);
lMean10StdDev1);
lSQ_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList,
lYield1200Mean10StdDev1);
lOnDStringList.clear();
lOnDStringList.push_back (lSQSINBKKOnDStr);
lOnDDateKey = OnDDateKey(lOnDStringList);
OnDDate& lSQ_SINBKK_OnDDate =
FacBom<OnDDate>::instance().create (lOnDDateKey);
const WTP_T lWTP400 = 400.0;
lSQ_SINBKK_OnDDate.setTotalForecast (lY, lWTP400Mean60StdDev6);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YM1);
lSQ_SINBKK_OnDDate.setDemandInformation (lCabinClassPairList,
lYield500Mean20StdDev1);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YY1);
lSQ_SINBKK_OnDDate.setDemandInformation (lCabinClassPairList,
lYield700Mean20StdDev1);
lFlightNumber = 12;
lFlightDateKey = FlightDateKey (lFlightNumber, lDate);
FlightDate& lCX12_20100308_FD =
FacBom<FlightDate>::instance().create (lFlightDateKey);
lFlightNumber = 1100;
lMktFlightDateKey = FlightDateKey (lFlightNumber, lDate);
FlightDate& lCX1100_20100308_FD =
FacBom<FlightDate>::instance().create (lMktFlightDateKey);
lSegmentDateKey = SegmentDateKey (lBKK, lHKG);
SegmentDate& lBKKHKGSegment =
FacBom<SegmentDate>::instance().create (lSegmentDateKey);
lBKKHKGSegment.addLegKey (lCXBKKRoutingLegStr);
lBKKHKGSegment.setBoardingDate (lDate);
lBKKHKGSegment.setOffDate (lDate);
lBKKHKGSegment.setBoardingTime (l1200);
lBKKHKGSegment.setOffTime (l1540);
lBKKHKGSegment.setElapsedTime (l0240);
lMktSegmentDateKey = SegmentDateKey (lSIN, lBKK);
SegmentDate& lMktSINBKKSegment =
FacBom<SegmentDate>::instance().create (lMktSegmentDateKey);
lMktSINBKKSegment.addLegKey (lSQSINRoutingLegStr);
lMktSINBKKSegment.setBoardingDate (lDate);
lMktSINBKKSegment.setOffDate (lDate);
lMktSINBKKSegment.setBoardingTime (l0820);
lMktSINBKKSegment.setOffTime (l1100);
lMktSINBKKSegment.setElapsedTime (l0340);
lLegDateKey = LegDateKey (lBKK);
LegDate& lBKKLeg = FacBom<LegDate>::instance().create (lLegDateKey);
lBKKLeg.setOffPoint (lHKG);
lBKKLeg.setBoardingDate (lDate);
lBKKLeg.setOffDate (lDate);
lBKKLeg.setBoardingTime (l1200);
lBKKLeg.setOffTime (l1540);
lBKKLeg.setElapsedTime (l0240);
SegmentCabin& lBKKHKGSegmentYCabin =
FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
SegmentCabin& lMktSINBKKSegmentYCabin =
FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
LegCabin& lBKKLegYCabin =
FacBom<LegCabin>::instance().create (lYLegCabinKey);
lBKKLegYCabin.setCapacities (lCapacity);
lBKKLegYCabin.setAvailabilityPool (lCapacity);
FareFamily& lBKKHKGSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
lBKKHKGSegmentYCabin1Family);
lBKKHKGSegmentYCabin1Family);
FareFamily& lMktSINBKKSegmentYCabin1Family =
FacBom<FareFamily>::instance().create (l1FareFamilyKey);
lMktSINBKKSegmentYCabin1Family);
lMktSINBKKSegmentYCabin1Family);
BookingClass& lBKKHKGSegmentYCabin1FamilyYClass =
FacBom<BookingClass>::instance().create (lYBookingClassKey);
lBKKHKGSegmentYCabin1FamilyYClass);
lBKKHKGSegmentYCabin1FamilyYClass);
lBKKHKGSegmentYCabin1FamilyYClass);
lBKKHKGSegmentYCabin1FamilyYClass);
lBKKHKGSegmentYCabin1FamilyYClass.setYield(700);
BookingClass& lMktSINBKKSegmentYCabin1FamilyYClass =
FacBom<BookingClass>::instance().create (lYBookingClassKey);
lMktSINBKKSegmentYCabin1FamilyYClass);
lMktSINBKKSegmentYCabin1FamilyYClass);
lMktSINBKKSegmentYCabin1FamilyYClass);
lMktSINBKKSegmentYCabin1FamilyYClass);
lMktSINBKKSegmentYCabin1FamilyYClass.setYield(700);
BookingClass& lBKKHKGSegmentYCabin1FamilyMClass =
FacBom<BookingClass>::instance().create (lMBookingClassKey);
lBKKHKGSegmentYCabin1FamilyMClass);
lBKKHKGSegmentYCabin1FamilyMClass);
lBKKHKGSegmentYCabin1FamilyMClass);
lBKKHKGSegmentYCabin1FamilyMClass);
lBKKHKGSegmentYCabin1FamilyMClass.setYield(500);
BookingClass& lMktSINBKKSegmentYCabin1FamilyMClass =
FacBom<BookingClass>::instance().create (lMBookingClassKey);
lMktSINBKKSegmentYCabin1FamilyMClass);
lMktSINBKKSegmentYCabin1FamilyMClass);
lMktSINBKKSegmentYCabin1FamilyMClass);
lMktSINBKKSegmentYCabin1FamilyMClass);
lMktSINBKKSegmentYCabin1FamilyMClass.setYield(500);
OnDString_T lMktCXSINBKKOnDStr =
"CX;1100,2010-Mar-08;SIN,BKK";
OnDString_T lCXBKKHKGOnDStr =
"CX;12,2010-Mar-08;BKK,HKG";
lOnDStringList.clear();
lOnDStringList.push_back (lMktCXSINBKKOnDStr);
lOnDStringList.push_back (lCXBKKHKGOnDStr);
lOnDDateKey = OnDDateKey(lOnDStringList);
OnDDate& lCX_SINHKG_OnDDate =
FacBom<OnDDate>::instance().create (lOnDDateKey);
lCX_SINHKG_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YM1);
lCabinClassPairList.push_back(lCC_YM2);
lCX_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList,
lYield850Mean20StdDev2);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YY1);
lCabinClassPairList.push_back(lCC_YY2);
lCX_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList,
lYield1200Mean10StdDev1);
lOnDStringList.clear();
lOnDStringList.push_back (lCXBKKHKGOnDStr);
lOnDDateKey = OnDDateKey(lOnDStringList);
OnDDate& lCX_BKKHKG_OnDDate =
FacBom<OnDDate>::instance().create (lOnDDateKey);
lCX_BKKHKG_OnDDate.setTotalForecast (lY, lWTP400Mean60StdDev6);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YM2);
lCX_BKKHKG_OnDDate.setDemandInformation (lCabinClassPairList,
lYield500Mean20StdDev1);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YY2);
lCX_BKKHKG_OnDDate.setDemandInformation (lCabinClassPairList,
lYield700Mean10StdDev1);
const DoWStruct lDoWSrtuct ("1111111");
const Date_T lDateRangeStart (2010, boost::gregorian::Mar, 8);
const Date_T lDateRangeEnd (2010, boost::gregorian::Mar, 9);
const DatePeriod_T lDatePeriod (lDateRangeStart, lDateRangeEnd);
const PeriodStruct lPeriodStruct (lDatePeriod,lDoWSrtuct);
FlightPeriodKey lFlightPeriodKey (lFlightNumber, lPeriodStruct);
FlightPeriod& lSQ11FlightPeriod =
FacBom<FlightPeriod>::instance().create (lFlightPeriodKey);
SegmentPeriodKey lSegmentPeriodKey (lSIN, lBKK);
SegmentPeriod& lSINBKKSegmentPeriod =
FacBom<SegmentPeriod>::instance().create (lSegmentPeriodKey);
lSINBKKSegmentPeriod.setBoardingTime (l0820);
lSINBKKSegmentPeriod.setOffTime (l1100);
lSINBKKSegmentPeriod.setElapsedTime (l0340);
lSINBKKSegmentPeriod.addCabinBookingClassList (lY,lYM);
lFlightPeriodKey = FlightPeriodKey(lFlightNumber, lPeriodStruct);
FlightPeriod& lCX12FlightPeriod =
FacBom<FlightPeriod>::instance().create (lFlightPeriodKey);
lSegmentPeriodKey = SegmentPeriodKey (lBKK, lHKG);
SegmentPeriod& lBKKHKGSegmentPeriod =
FacBom<SegmentPeriod>::instance().create (lSegmentPeriodKey);
lBKKHKGSegmentPeriod.setBoardingTime (l1200);
lBKKHKGSegmentPeriod.setOffTime (l1540);
lBKKHKGSegmentPeriod.setElapsedTime (l0240);
lBKKHKGSegmentPeriod.addCabinBookingClassList (lY,lYM);
}
void CmdBomManager::buildPartnershipsSamplePricing (BomRoot& ioBomRoot) {
AirportPairKey lAirportPairKey ("SIN", "BKK");
AirportPair& lSINBKKAirportPair =
FacBom<AirportPair>::instance().create (lAirportPairKey);
const Date_T lDateRangeStart (2010, boost::gregorian::Mar, 01);
const Date_T lDateRangeEnd (2010, boost::gregorian::Mar, 31);
const DatePeriod_T lDateRange (lDateRangeStart, lDateRangeEnd);
const DatePeriodKey lDatePeriodKey (lDateRange);
DatePeriod& lSINBKKDatePeriod =
FacBom<DatePeriod>::instance().create (lDatePeriodKey);
PosChannelKey lPosChannelKey ("SIN","IN");
PosChannel& lSINPosChannel =
FacBom<PosChannel>::instance().create (lPosChannelKey);
const Time_T lTimeRangeStart (0, 0, 0);
const Time_T lTimeRangeEnd (23, 0, 0);
const TimePeriodKey lFareTimePeriodKey (lTimeRangeStart,
lTimeRangeEnd);
TimePeriod& lSINBKKFareTimePeriod =
FacBom<TimePeriod>::instance().create (lFareTimePeriodKey);
FareFeatures& lSINBKKFareFeatures =
FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
lSQAirlineCodeList.push_back ("SQ");
lYClassCodeList.push_back ("Y");
const AirlineClassListKey lSQAirlineYClassListKey (lSQAirlineCodeList,
lYClassCodeList);
lMClassCodeList.push_back ("M");
const AirlineClassListKey lSQAirlineMClassListKey (lSQAirlineCodeList,
lMClassCodeList);
AirlineClassList& lSQAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lSQAirlineYClassListKey);
lSQAirlineYClassList.setFare(700);
AirlineClassList& lSQAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lSQAirlineMClassListKey);
lSQAirlineMClassList.setFare(500);
lAirportPairKey = AirportPairKey ("BKK", "HKG");
AirportPair& lBKKHKGAirportPair =
FacBom<AirportPair>::instance().create (lAirportPairKey);
DatePeriod& lBKKHKGDatePeriod =
FacBom<DatePeriod>::instance().create (lDatePeriodKey);
lPosChannelKey = PosChannelKey("BKK","IN");
PosChannel& lBKKPosChannel =
FacBom<PosChannel>::instance().create (lPosChannelKey);
TimePeriod& lBKKHKGFareTimePeriod =
FacBom<TimePeriod>::instance().create (lFareTimePeriodKey);
FareFeatures& lBKKHKGFareFeatures =
FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
lCXAirlineCodeList.push_back ("CX");
const AirlineClassListKey lCXAirlineYClassListKey (lCXAirlineCodeList,
lYClassCodeList);
const AirlineClassListKey lCXAirlineMClassListKey (lCXAirlineCodeList,
lMClassCodeList);
AirlineClassList& lCXAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lCXAirlineYClassListKey);
lCXAirlineYClassList.setFare(700);
AirlineClassList& lCXAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lCXAirlineMClassListKey);
lCXAirlineMClassList.setFare(500);
lAirportPairKey = AirportPairKey ("SIN", "HKG");
AirportPair& lSINHKGAirportPair =
FacBom<AirportPair>::instance().create (lAirportPairKey);
DatePeriod& lSINHKGDatePeriod =
FacBom<DatePeriod>::instance().create (lDatePeriodKey);
lPosChannelKey = PosChannelKey("SIN","IN");
PosChannel& lOnDSINPosChannel =
FacBom<PosChannel>::instance().create (lPosChannelKey);
TimePeriod& lSINHKGFareTimePeriod =
FacBom<TimePeriod>::instance().create (lFareTimePeriodKey);
FareFeatures& lSINHKGFareFeatures =
FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
lSQ_CXAirlineCodeList.push_back ("SQ");
lSQ_CXAirlineCodeList.push_back ("CX");
lY_YClassCodeList.push_back ("Y");
lY_YClassCodeList.push_back ("Y");
const AirlineClassListKey lSQ_CXAirlineYClassListKey (lSQ_CXAirlineCodeList,
lY_YClassCodeList);
lM_MClassCodeList.push_back ("M");
lM_MClassCodeList.push_back ("M");
const AirlineClassListKey lSQ_CXAirlineMClassListKey (lSQ_CXAirlineCodeList,
lM_MClassCodeList);
AirlineClassList& lSQ_CXAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineYClassListKey);
lSQ_CXAirlineYClassList.setFare(1200);
lSQ_CXAirlineYClassList);
lSQ_CXAirlineYClassList);
AirlineClassList& lSQ_CXAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineMClassListKey);
lSQ_CXAirlineMClassList.setFare(850);
lSQ_CXAirlineMClassList);
lSQ_CXAirlineMClassList);
PosChannel& lRAC_SINBKKPosChannel =
FacBom<PosChannel>::instance().create (lPosChannelKey);
const TimePeriodKey lYieldTimePeriodKey (lTimeRangeStart,
lTimeRangeEnd);
TimePeriod& lSINBKKYieldTimePeriod =
FacBom<TimePeriod>::instance().create (lYieldTimePeriodKey);
lSINBKKYieldTimePeriod);
lSINBKKYieldTimePeriod);
YieldFeatures& lSINBKKYieldFeatures =
FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
lSINBKKYieldFeatures);
lSINBKKYieldFeatures);
AirlineClassList& lRAC_SQAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lSQAirlineYClassListKey);
lRAC_SQAirlineYClassList.setYield(700);
lRAC_SQAirlineYClassList);
lRAC_SQAirlineYClassList);
AirlineClassList& lRAC_SQAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lSQAirlineMClassListKey);
lRAC_SQAirlineMClassList.setYield(500);
lRAC_SQAirlineMClassList);
lRAC_SQAirlineMClassList);
PosChannel& lRAC_BKKHKGPosChannel =
FacBom<PosChannel>::instance().create (lPosChannelKey);
TimePeriod& lBKKHKGYieldTimePeriod =
FacBom<TimePeriod>::instance().create (lYieldTimePeriodKey);
lBKKHKGYieldTimePeriod);
lBKKHKGYieldTimePeriod);
YieldFeatures& lBKKHKGYieldFeatures =
FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
lBKKHKGYieldFeatures);
lBKKHKGYieldFeatures);
AirlineClassList& lRAC_CXAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lCXAirlineYClassListKey);
lRAC_CXAirlineYClassList.setYield(700);
lRAC_CXAirlineYClassList);
lRAC_CXAirlineYClassList);
AirlineClassList& lRAC_CXAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lCXAirlineMClassListKey);
lRAC_CXAirlineMClassList.setYield(500);
lRAC_CXAirlineMClassList);
lRAC_CXAirlineMClassList);
PosChannel& lRAC_SINHKGChannel =
FacBom<PosChannel>::instance().create (lPosChannelKey);
TimePeriod& lSINHKGYieldTimePeriod =
FacBom<TimePeriod>::instance().create (lYieldTimePeriodKey);
YieldFeatures& lSINHKGYieldFeatures =
FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
lSINHKGYieldFeatures);
lSINHKGYieldFeatures);
AirlineClassList& lRAC_SQ_CXAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineYClassListKey);
lRAC_SQ_CXAirlineYClassList.setYield(1200);
lRAC_SQ_CXAirlineYClassList);
lRAC_SQ_CXAirlineYClassList);
AirlineClassList& lRAC_SQ_CXAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineMClassListKey);
lRAC_SQ_CXAirlineMClassList.setYield(850);
lRAC_SQ_CXAirlineMClassList);
lRAC_SQ_CXAirlineMClassList);
}
}
*/
#include <cassert>
#include <sstream>
namespace stdair {
void CmdCloneBomManager::cloneBomRoot (const BomRoot& iBomRoot,
BomRoot& ioCloneBomRoot) {
const bool hasInventoryList = BomManager::hasList<Inventory> (iBomRoot);
if (hasInventoryList == true) {
BomManager::getList<Inventory> (iBomRoot);
for (InventoryList_T::const_iterator itInv = lInventoryList.begin();
itInv != lInventoryList.end(); ++itInv) {
const Inventory* lInv_ptr = *itInv;
assert (lInv_ptr != NULL);
Inventory& lCloneInventory = cloneInventory (*lInv_ptr, ioCloneBomRoot);
}
}
const bool hastAirportPairList =
BomManager::hasList<AirportPair> (iBomRoot);
if (hastAirportPairList == true) {
BomManager::getList<AirportPair> (iBomRoot);
for (AirportPairList_T::const_iterator itAirportPair =
lAirportPairList.begin();
itAirportPair != lAirportPairList.end(); ++itAirportPair) {
const AirportPair* lAirportPair_ptr = *itAirportPair;
assert (lAirportPair_ptr != NULL);
AirportPair& lCloneAirportPair = cloneAirportPair (*lAirportPair_ptr);
}
}
}
Inventory& CmdCloneBomManager::cloneInventory (const Inventory& iInventory,
BomRoot& ioCloneBomRoot) {
Inventory& lCloneInventory =
FacCloneBom<Inventory>::instance().clone (iInventory);
const bool hasFlighDateList = BomManager::hasList<FlightDate> (iInventory);
if (hasFlighDateList == true) {
BomManager::getList<FlightDate> (iInventory);
for (FlightDateList_T::const_iterator itFD = lFlightDateList.begin();
itFD != lFlightDateList.end(); ++itFD) {
const FlightDate* lFD_ptr = *itFD;
assert (lFD_ptr != NULL);
FlightDate& lCloneFD = cloneFlightDate (*lFD_ptr);
}
}
const bool hasPartnerList = BomManager::hasList<Inventory> (iInventory);
if (hasPartnerList == true) {
BomManager::getList<Inventory> (iInventory);
for (InventoryList_T::const_iterator itInv =
lPartnerInventoryList.begin();
itInv != lPartnerInventoryList.end(); ++itInv) {
const Inventory* lInv_ptr = *itInv;
assert (lInv_ptr != NULL);
Inventory& lClonePartnerInventory = cloneInventory (*lInv_ptr,
ioCloneBomRoot);
lClonePartnerInventory);
lClonePartnerInventory);
}
}
const bool hasOnDList = BomManager::hasList<OnDDate> (iInventory);
if (hasOnDList == true){
BomManager::getList<OnDDate> (iInventory);
for (OnDDateList_T::const_iterator itOnD = lOnDDateList.begin();
itOnD != lOnDDateList.end(); ++itOnD) {
const OnDDate* lOnDDate_ptr = *itOnD;
assert (lOnDDate_ptr != NULL);
OnDDate& lCloneOnDDate = cloneOnDDate (*lOnDDate_ptr);
}
}
const bool hasFlightPeriodList =
BomManager::hasList<FlightPeriod> (iInventory);
if (hasFlightPeriodList == true) {
BomManager::getList<FlightPeriod> (iInventory);
for (FlightPeriodList_T::const_iterator itFlightPeriod =
lFlightPeriodList.begin();
itFlightPeriod != lFlightPeriodList.end(); ++itFlightPeriod) {
const FlightPeriod* lFlightPeriod_ptr = *itFlightPeriod;
assert (lFlightPeriod_ptr != NULL);
FlightPeriod& lCloneFlightPeriod = cloneFlightPeriod (*lFlightPeriod_ptr);
}
}
const AirlineFeature* lAirlineFeature_ptr =
BomManager::getObjectPtr<AirlineFeature,Inventory> (iInventory,
iInventory.getAirlineCode());
if (lAirlineFeature_ptr != NULL) {
AirlineFeature& lCloneAirlineFeature =
cloneAirlineFeature (*lAirlineFeature_ptr);
}
return lCloneInventory;
}
AirlineFeature& CmdCloneBomManager::
cloneAirlineFeature (const AirlineFeature& iAirlineFeature) {
AirlineFeature& lCloneAirlineFeature =
FacCloneBom<AirlineFeature>::instance().clone (iAirlineFeature);
return lCloneAirlineFeature;
}
OnDDate& CmdCloneBomManager::cloneOnDDate (const OnDDate& iOnDDate) {
OnDDate& lCloneOnDDate =
FacCloneBom<OnDDate>::instance().clone (iOnDDate);
return lCloneOnDDate;
}
FlightDate& CmdCloneBomManager::
cloneFlightDate (const FlightDate& iFlightDate) {
FlightDate& lCloneFlightDate =
FacCloneBom<FlightDate>::instance().clone (iFlightDate);
const bool hasLegDateList = BomManager::hasList<LegDate> (iFlightDate);
if (hasLegDateList == true) {
BomManager::getList<LegDate> (iFlightDate);
for (LegDateList_T::const_iterator itLD = lLegDateList.begin();
itLD != lLegDateList.end(); ++itLD) {
const LegDate* lLD_ptr = *itLD;
assert (lLD_ptr != NULL);
LegDate& lCloneLegDate = cloneLegDate (*lLD_ptr);
}
}
const bool hasSegmentDateList =
BomManager::hasList<SegmentDate> (iFlightDate);
if (hasSegmentDateList == true) {
BomManager::getList<SegmentDate> (iFlightDate);
for (SegmentDateList_T::const_iterator itSD = lSegmentDateList.begin();
itSD != lSegmentDateList.end(); ++itSD) {
const SegmentDate* lSD_ptr = *itSD;
assert (lSD_ptr != NULL);
SegmentDate& lCloneSegmentDate = cloneSegmentDate (*lSD_ptr);
}
}
return lCloneFlightDate;
}
LegDate& CmdCloneBomManager::cloneLegDate (const LegDate& iLegDate) {
LegDate& lCloneLegDate =
FacCloneBom<LegDate>::instance().clone (iLegDate);
const bool hasLegCabinList = BomManager::hasList<LegCabin> (iLegDate);
if (hasLegCabinList == true) {
BomManager::getList<LegCabin> (iLegDate);
for (LegCabinList_T::const_iterator itLC = lLegCabinList.begin();
itLC != lLegCabinList.end(); ++itLC) {
const LegCabin* lLC_ptr = *itLC;
assert (lLC_ptr != NULL);
LegCabin& lCloneLegCabin = cloneLegCabin (*lLC_ptr);
}
}
return lCloneLegDate;
}
LegCabin& CmdCloneBomManager::cloneLegCabin (const LegCabin& iLegCabin) {
LegCabin& lCloneLegCabin =
FacCloneBom<LegCabin>::instance().clone (iLegCabin);
const bool hasBucketList = BomManager::hasList<Bucket> (iLegCabin);
if (hasBucketList == true) {
BomManager::getList<Bucket> (iLegCabin);
for (BucketList_T::const_iterator itBucket = lBucketList.begin();
itBucket != lBucketList.end(); ++itBucket) {
const Bucket* lBucket_ptr = *itBucket;
assert (lBucket_ptr != NULL);
Bucket& lCloneBucket = cloneBucket (*lBucket_ptr);
}
}
return lCloneLegCabin;
}
Bucket& CmdCloneBomManager::cloneBucket (const Bucket& iBucket) {
Bucket& lCloneBucket =
FacCloneBom<Bucket>::instance().clone (iBucket);
return lCloneBucket;
}
SegmentDate& CmdCloneBomManager::
cloneSegmentDate (const SegmentDate& iSegmentDate) {
SegmentDate& lCloneSegmentDate =
FacCloneBom<SegmentDate>::instance().clone (iSegmentDate);
const bool hasSegmentCabinList =
BomManager::hasList<SegmentCabin> (iSegmentDate);
if (hasSegmentCabinList == true) {
BomManager::getList<SegmentCabin> (iSegmentDate);
for (SegmentCabinList_T::const_iterator itSC = lSegmentCabinList.begin();
itSC != lSegmentCabinList.end(); ++itSC) {
const SegmentCabin* lSC_ptr = *itSC;
assert (lSC_ptr != NULL);
SegmentCabin& lCloneSegmentCabin = cloneSegmentCabin (*lSC_ptr);
linkBookingClassesWithSegment (lCloneSegmentDate,
lCloneSegmentCabin);
}
}
return lCloneSegmentDate;
}
void CmdCloneBomManager::
linkBookingClassesWithSegment (SegmentDate& iCloneSegmentDate,
SegmentCabin& iCloneSegmentCabin) {
const bool hasFareFamilyList =
BomManager::hasList<FareFamily> (iCloneSegmentCabin);
if (hasFareFamilyList == true) {
BomManager::getList<FareFamily> (iCloneSegmentCabin);
for (FareFamilyList_T::const_iterator itCloneFF = lCloneFFList.begin();
itCloneFF != lCloneFFList.end(); ++itCloneFF) {
const FareFamily* lCloneFF_ptr = *itCloneFF;
assert (lCloneFF_ptr != NULL);
const bool hasBookingClasslist =
BomManager::hasList<BookingClass> (<em>lCloneFF_ptr);
if (hasBookingClasslist == true) {
BomManager::getList<BookingClass> (*lCloneFF_ptr);
for (BookingClassList_T::const_iterator itCloneBC =
lCloneBCList.begin();
itCloneBC != lCloneBCList.end(); ++itCloneBC) {
const BookingClass</em> lCloneBC_ptr = *itCloneBC;
assert (lCloneBC_ptr != NULL);
*lCloneBC_ptr);
*lCloneBC_ptr);
}
}
}
}
}
SegmentCabin& CmdCloneBomManager::
cloneSegmentCabin (const SegmentCabin& iSegmentCabin) {
SegmentCabin& lCloneSegmentCabin =
FacCloneBom<SegmentCabin>::instance().clone (iSegmentCabin);
const bool hasFareFamilyList =
BomManager::hasList<FareFamily> (iSegmentCabin);
if (hasFareFamilyList == true) {
BomManager::getList<FareFamily> (iSegmentCabin);
for (FareFamilyList_T::const_iterator itFF = lFareFamilyList.begin();
itFF != lFareFamilyList.end(); ++itFF) {
const FareFamily* lFF_ptr = *itFF;
assert (lFF_ptr != NULL);
FareFamily& lCloneFareFamily = cloneFareFamily (*lFF_ptr);
}
}
return lCloneSegmentCabin;
}
FareFamily& CmdCloneBomManager::
cloneFareFamily (const FareFamily& iFareFamily) {
FareFamily& lCloneFareFamily =
FacCloneBom<FareFamily>::instance().clone (iFareFamily);
const bool hasBookingClassList =
BomManager::hasList<BookingClass> (iFareFamily);
if (hasBookingClassList == true) {
BomManager::getList<BookingClass> (iFareFamily);
for (BookingClassList_T::const_iterator itBookingClass =
lBookingClassList.begin();
itBookingClass != lBookingClassList.end(); ++itBookingClass) {
const BookingClass* lBC_ptr = *itBookingClass;
assert (lBC_ptr != NULL);
BookingClass& lCloneBookingClass = cloneBookingClass (*lBC_ptr);
}
}
return lCloneFareFamily;
}
BookingClass& CmdCloneBomManager::
cloneBookingClass (const BookingClass& iBookingClass) {
BookingClass& lCloneBookingClass =
FacCloneBom<BookingClass>::instance().clone (iBookingClass);
return lCloneBookingClass;
}
AirportPair& CmdCloneBomManager::
cloneAirportPair (const AirportPair& iAirportPair) {
AirportPair& lCloneAirportPair =
FacCloneBom<AirportPair>::instance().clone (iAirportPair);
const bool hasDatePeriodList =
BomManager::hasList<DatePeriod> (iAirportPair);
if (hasDatePeriodList == true) {
BomManager::getList<DatePeriod> (iAirportPair);
for (DatePeriodList_T::const_iterator itDatePeriod =
lDatePeriodList.begin();
itDatePeriod != lDatePeriodList.end(); ++itDatePeriod) {
const DatePeriod* lDatePeriod_ptr = *itDatePeriod;
assert (lDatePeriod_ptr != NULL);
DatePeriod& lCloneDatePeriod = cloneDatePeriod (*lDatePeriod_ptr);
}
}
return lCloneAirportPair;
}
DatePeriod& CmdCloneBomManager::
cloneDatePeriod (const DatePeriod& iDatePeriod) {
DatePeriod& lCloneDatePeriod =
FacCloneBom<DatePeriod>::instance().clone (iDatePeriod);
const bool hasPosChannelList =
BomManager::hasList<PosChannel> (iDatePeriod);
if (hasPosChannelList == true) {
BomManager::getList<PosChannel> (iDatePeriod);
for (PosChannelList_T::const_iterator itPosChannel =
lPosChannelList.begin();
itPosChannel != lPosChannelList.end(); ++itPosChannel) {
const PosChannel* lPosChannel_ptr = *itPosChannel;
assert (lPosChannel_ptr != NULL);
PosChannel& lClonePosChannel = clonePosChannel (*lPosChannel_ptr);
}
}
return lCloneDatePeriod;
}
PosChannel& CmdCloneBomManager::
clonePosChannel (const PosChannel& iPosChannel) {
PosChannel& lClonePosChannel =
FacCloneBom<PosChannel>::instance().clone (iPosChannel);
const bool hasTimePeriodList =
BomManager::hasList<TimePeriod> (iPosChannel);
if (hasTimePeriodList == true) {
BomManager::getList<TimePeriod> (iPosChannel);
for (TimePeriodList_T::const_iterator itTimePeriod =
lTimePeriodList.begin();
itTimePeriod != lTimePeriodList.end(); ++itTimePeriod) {
const TimePeriod* lTimePeriod_ptr = *itTimePeriod;
assert (lTimePeriod_ptr != NULL);
TimePeriod& lCloneTimePeriod = cloneTimePeriod (*lTimePeriod_ptr);
}
}
return lClonePosChannel;
}
TimePeriod& CmdCloneBomManager::
cloneTimePeriod (const TimePeriod& iTimePeriod) {
TimePeriod& lCloneTimePeriod =
FacCloneBom<TimePeriod>::instance().clone (iTimePeriod);
const bool hasFareFeaturesList =
BomManager::hasList<FareFeatures> (iTimePeriod);
if (hasFareFeaturesList == true) {
BomManager::getList<FareFeatures> (iTimePeriod);
for (FareFeaturesList_T::const_iterator itFF = lFareFeaturesList.begin();
itFF != lFareFeaturesList.end(); ++itFF) {
const FareFeatures* lFF_ptr = *itFF;
assert (lFF_ptr != NULL);
FareFeatures& lCloneFareFeatures =
cloneFeatures<FareFeatures> (*lFF_ptr);
}
}
const bool hasYieldFeaturesList =
BomManager::hasList<YieldFeatures> (iTimePeriod);
if (hasYieldFeaturesList == true) {
BomManager::getList<YieldFeatures> (iTimePeriod);
for (YieldFeaturesList_T::const_iterator itYF =
lYieldFeaturesList.begin();
itYF != lYieldFeaturesList.end(); ++itYF) {
const YieldFeatures* lYF_ptr = *itYF;
assert (lYF_ptr != NULL);
YieldFeatures& lCloneYieldFeatures =
cloneFeatures<YieldFeatures> (*lYF_ptr);
}
}
return lCloneTimePeriod;
}
template <typename FEATURE_TYPE>
FEATURE_TYPE& CmdCloneBomManager::
cloneFeatures (const FEATURE_TYPE& iFeatures) {
FEATURE_TYPE& lCloneFeatures =
FacCloneBom<FEATURE_TYPE>::instance().clone (iFeatures);
const bool hasAirlineClassListList =
BomManager::hasList<AirlineClassList> (iFeatures);
if (hasAirlineClassListList == true) {
BomManager::getList<AirlineClassList> (iFeatures);
for (AirlineClassListList_T::const_iterator itACList =
lAirlineClassList.begin();
itACList != lAirlineClassList.end(); ++itACList) {
const AirlineClassList* lACList_ptr = *itACList;
assert (lACList_ptr != NULL);
AirlineClassList& lCloneAirlineClassList =
cloneAirlineClassList (*lACList_ptr);
lCloneAirlineClassList);
lCloneAirlineClassList);
}
}
return lCloneFeatures;
}
AirlineClassList& CmdCloneBomManager::
cloneAirlineClassList (const AirlineClassList& iAirlineClassList) {
AirlineClassList& lCloneAirlineClassList =
FacCloneBom<AirlineClassList>::instance().clone (iAirlineClassList);
return lCloneAirlineClassList;
}
FlightPeriod& CmdCloneBomManager::
cloneFlightPeriod (const FlightPeriod& iFlightPeriod) {
FlightPeriod& lCloneFlightPeriod =
FacCloneBom<FlightPeriod>::instance().clone (iFlightPeriod);
const bool hasSegmentPeriodList =
BomManager::hasList<SegmentPeriod> (iFlightPeriod);
if (hasSegmentPeriodList == true) {
BomManager::getList<SegmentPeriod> (iFlightPeriod);
for (SegmentPeriodList_T::const_iterator itSegmentPeriod =
lSegmentPeriodList.begin();
itSegmentPeriod != lSegmentPeriodList.end(); ++itSegmentPeriod) {
const SegmentPeriod* lSegmentPeriod_ptr = *itSegmentPeriod;
assert (lSegmentPeriod_ptr != NULL);
SegmentPeriod& lCloneSegmentPeriod =
cloneSegmentPeriod (*lSegmentPeriod_ptr);
lCloneSegmentPeriod);
lCloneSegmentPeriod);
}
}
return lCloneFlightPeriod;
}
SegmentPeriod& CmdCloneBomManager::
cloneSegmentPeriod (const SegmentPeriod& iSegmentPeriod) {
SegmentPeriod& lCloneSegmentPeriod =
FacCloneBom<SegmentPeriod>::instance().clone (iSegmentPeriod);
return lCloneSegmentPeriod;
}
}