StdAir Logo  1.00.19
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
C++ Class Building Sample StdAir BOM Trees
/*===================================================================================*/
// First airport pair SIN-BKK.
// Set the airport-pair primary key.
AirportPairKey lAirportPairKey ("SIN", "BKK");
// Create the AirportPairKey object and link it to the ioBomRoot object.
AirportPair& lSINBKKAirportPair =
FacBomManager::addToListAndMap (ioBomRoot, lSINBKKAirportPair);
FacBomManager::linkWithParent (ioBomRoot, lSINBKKAirportPair);
// Set the fare date-period primary key.
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);
// Create the DatePeriodKey object and link it to the PosChannel object.
DatePeriod& lSINBKKDatePeriod =
FacBomManager::addToListAndMap (lSINBKKAirportPair, lSINBKKDatePeriod);
FacBomManager::linkWithParent (lSINBKKAirportPair, lSINBKKDatePeriod);
// Set the point-of-sale-channel primary key.
PosChannelKey lPosChannelKey ("SIN","IN");
// Create the PositionKey object and link it to the AirportPair object.
PosChannel& lSINPosChannel =
FacBomManager::addToListAndMap (lSINBKKDatePeriod, lSINPosChannel);
FacBomManager::linkWithParent (lSINBKKDatePeriod, lSINPosChannel);
// Set the fare time-period primary key.
const Time_T lTimeRangeStart (0, 0, 0);
const Time_T lTimeRangeEnd (23, 0, 0);
const TimePeriodKey lFareTimePeriodKey (lTimeRangeStart,
lTimeRangeEnd);
// Create the TimePeriodKey and link it to the DatePeriod object.
TimePeriod& lSINBKKFareTimePeriod =
FacBom<TimePeriod>::instance().create (lFareTimePeriodKey);
FacBomManager::addToListAndMap (lSINPosChannel, lSINBKKFareTimePeriod);
FacBomManager::linkWithParent (lSINPosChannel, lSINBKKFareTimePeriod);
// Generate the FareRule
const FareFeaturesKey lFareFeaturesKey (TRIP_TYPE_ONE_WAY,
// Create the FareFeaturesKey and link it to the TimePeriod object.
FareFeatures& lSINBKKFareFeatures =
FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
FacBomManager::addToListAndMap (lSINBKKFareTimePeriod, lSINBKKFareFeatures);
FacBomManager::linkWithParent (lSINBKKFareTimePeriod, lSINBKKFareFeatures);
// Generate Segment Features and link them to their FareRule.
AirlineCodeList_T lSQAirlineCodeList;
lSQAirlineCodeList.push_back ("SQ");
ClassList_StringList_T lYClassCodeList;
lYClassCodeList.push_back ("Y");
const AirlineClassListKey lSQAirlineYClassListKey (lSQAirlineCodeList,
lYClassCodeList);
ClassList_StringList_T lMClassCodeList;
lMClassCodeList.push_back ("M");
const AirlineClassListKey lSQAirlineMClassListKey (lSQAirlineCodeList,
lMClassCodeList);
// Create the AirlineClassListKey and link it to the FareFeatures object.
AirlineClassList& lSQAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lSQAirlineYClassListKey);
lSQAirlineYClassList.setFare(700);
FacBomManager::addToListAndMap (lSINBKKFareFeatures, lSQAirlineYClassList);
FacBomManager::linkWithParent (lSINBKKFareFeatures, lSQAirlineYClassList);
AirlineClassList& lSQAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lSQAirlineMClassListKey);
lSQAirlineMClassList.setFare(500);
FacBomManager::addToListAndMap (lSINBKKFareFeatures, lSQAirlineMClassList);
FacBomManager::linkWithParent (lSINBKKFareFeatures, lSQAirlineMClassList);
/*===================================================================================*/
// Second airport pair BKK-HKG.
// Set the airport-pair primary key.
lAirportPairKey = AirportPairKey ("BKK", "HKG");
// Create the AirportPairKey object and link it to the ioBomRoot object.
AirportPair& lBKKHKGAirportPair =
FacBomManager::addToListAndMap (ioBomRoot, lBKKHKGAirportPair);
FacBomManager::linkWithParent (ioBomRoot, lBKKHKGAirportPair);
// Set the fare date-period primary key.
// Use the same as previously.
// Create the DatePeriodKey object and link it to the PosChannel object.
DatePeriod& lBKKHKGDatePeriod =
FacBomManager::addToListAndMap (lBKKHKGAirportPair, lBKKHKGDatePeriod);
FacBomManager::linkWithParent (lBKKHKGAirportPair, lBKKHKGDatePeriod);
// Set the point-of-sale-channel primary key.
lPosChannelKey = PosChannelKey("BKK","IN");
// Create the PositionKey object and link it to the AirportPair object.
PosChannel& lBKKPosChannel =
FacBomManager::addToListAndMap (lBKKHKGDatePeriod, lBKKPosChannel);
FacBomManager::linkWithParent (lBKKHKGDatePeriod, lBKKPosChannel);
// Set the fare time-period primary key.
// Use the same as previously.
// Create the TimePeriodKey and link it to the DatePeriod object.
TimePeriod& lBKKHKGFareTimePeriod =
FacBom<TimePeriod>::instance().create (lFareTimePeriodKey);
FacBomManager::addToListAndMap (lBKKPosChannel, lBKKHKGFareTimePeriod);
FacBomManager::linkWithParent (lBKKPosChannel, lBKKHKGFareTimePeriod);
// Generate the FareRule
// Use the same key as previously.
// Create the FareFeaturesKey and link it to the TimePeriod object.
FareFeatures& lBKKHKGFareFeatures =
FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
FacBomManager::addToListAndMap (lBKKHKGFareTimePeriod, lBKKHKGFareFeatures);
FacBomManager::linkWithParent (lBKKHKGFareTimePeriod, lBKKHKGFareFeatures);
// Generate Segment Features and link them to their FareRule.
AirlineCodeList_T lCXAirlineCodeList;
lCXAirlineCodeList.push_back ("CX");
const AirlineClassListKey lCXAirlineYClassListKey (lCXAirlineCodeList,
lYClassCodeList);
const AirlineClassListKey lCXAirlineMClassListKey (lCXAirlineCodeList,
lMClassCodeList);
// Create the AirlineClassListKey and link it to the FareFeatures object.
AirlineClassList& lCXAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lCXAirlineYClassListKey);
lCXAirlineYClassList.setFare(700);
FacBomManager::addToListAndMap (lBKKHKGFareFeatures, lCXAirlineYClassList);
FacBomManager::linkWithParent (lBKKHKGFareFeatures, lCXAirlineYClassList);
AirlineClassList& lCXAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lCXAirlineMClassListKey);
lCXAirlineMClassList.setFare(500);
FacBomManager::addToListAndMap (lBKKHKGFareFeatures, lCXAirlineMClassList);
FacBomManager::linkWithParent (lBKKHKGFareFeatures, lCXAirlineMClassList);
/*===================================================================================*/
// Third airport pair SIN-HKG.
// Set the airport-pair primary key.
lAirportPairKey = AirportPairKey ("SIN", "HKG");
// Create the AirportPairKey object and link it to the ioBomRoot object.
AirportPair& lSINHKGAirportPair =
FacBomManager::addToListAndMap (ioBomRoot, lSINHKGAirportPair);
FacBomManager::linkWithParent (ioBomRoot, lSINHKGAirportPair);
// Set the fare date-period primary key.
// Use the same as previously.
// Create the DatePeriodKey object and link it to the PosChannel object.
DatePeriod& lSINHKGDatePeriod =
FacBomManager::addToListAndMap (lSINHKGAirportPair, lSINHKGDatePeriod);
FacBomManager::linkWithParent (lSINHKGAirportPair, lSINHKGDatePeriod);
// Set the point-of-sale-channel primary key.
lPosChannelKey = PosChannelKey("SIN","IN");
// Create the PositionKey object and link it to the AirportPair object.
PosChannel& lOnDSINPosChannel =
FacBomManager::addToListAndMap (lSINHKGDatePeriod, lOnDSINPosChannel);
FacBomManager::linkWithParent (lSINHKGDatePeriod, lOnDSINPosChannel);
// Set the fare time-period primary key.
// Use the same as previously.
// Create the TimePeriodKey and link it to the DatePeriod object.
TimePeriod& lSINHKGFareTimePeriod =
FacBom<TimePeriod>::instance().create (lFareTimePeriodKey);
FacBomManager::addToListAndMap (lOnDSINPosChannel, lSINHKGFareTimePeriod);
FacBomManager::linkWithParent (lOnDSINPosChannel, lSINHKGFareTimePeriod);
// Generate the FareRule
// Use the same key as previously.
// Create the FareFeaturesKey and link it to the TimePeriod object.
FareFeatures& lSINHKGFareFeatures =
FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
FacBomManager::addToListAndMap (lSINHKGFareTimePeriod, lSINHKGFareFeatures);
FacBomManager::linkWithParent (lSINHKGFareTimePeriod, lSINHKGFareFeatures);
// Generate Segment Features and link them to their FareRule.
AirlineCodeList_T lSQ_CXAirlineCodeList;
lSQ_CXAirlineCodeList.push_back ("SQ");
lSQ_CXAirlineCodeList.push_back ("CX");
ClassList_StringList_T lY_YClassCodeList;
lY_YClassCodeList.push_back ("Y");
lY_YClassCodeList.push_back ("Y");
const AirlineClassListKey lSQ_CXAirlineYClassListKey (lSQ_CXAirlineCodeList,
lY_YClassCodeList);
ClassList_StringList_T lM_MClassCodeList;
lM_MClassCodeList.push_back ("M");
lM_MClassCodeList.push_back ("M");
const AirlineClassListKey lSQ_CXAirlineMClassListKey (lSQ_CXAirlineCodeList,
lM_MClassCodeList);
// Create the AirlineClassListKey and link it to the FareFeatures object.
AirlineClassList& lSQ_CXAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineYClassListKey);
lSQ_CXAirlineYClassList.setFare(1200);
FacBomManager::addToListAndMap (lSINHKGFareFeatures,
lSQ_CXAirlineYClassList);
FacBomManager::linkWithParent (lSINHKGFareFeatures,
lSQ_CXAirlineYClassList);
AirlineClassList& lSQ_CXAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineMClassListKey);
lSQ_CXAirlineMClassList.setFare(850);
FacBomManager::addToListAndMap (lSINHKGFareFeatures,
lSQ_CXAirlineMClassList);
FacBomManager::linkWithParent (lSINHKGFareFeatures,
lSQ_CXAirlineMClassList);
/*===================================================================================*/
// Use the same airport pair, and date period for adding SQ SIN-BKK yields.
// Set the point-of-sale-channel primary key.
lPosChannelKey = PosChannelKey(DEFAULT_POS, DEFAULT_CHANNEL);
// Create the PositionKey object and link it to the AirportPair object.
PosChannel& lRAC_SINBKKPosChannel =
FacBomManager::addToListAndMap (lSINBKKDatePeriod, lRAC_SINBKKPosChannel);
FacBomManager::linkWithParent (lSINBKKDatePeriod, lRAC_SINBKKPosChannel);
// Set the yield time-period primary key.
const TimePeriodKey lYieldTimePeriodKey (lTimeRangeStart,
lTimeRangeEnd);
// Create the TimePeriodKey and link it to the DatePeriod object.
TimePeriod& lSINBKKYieldTimePeriod =
FacBom<TimePeriod>::instance().create (lYieldTimePeriodKey);
FacBomManager::addToListAndMap (lRAC_SINBKKPosChannel,
lSINBKKYieldTimePeriod);
FacBomManager::linkWithParent (lRAC_SINBKKPosChannel,
lSINBKKYieldTimePeriod);
// Generate the YieldRule
const YieldFeaturesKey lYieldFeaturesKey (TRIP_TYPE_ONE_WAY,
// Create the YieldFeaturesKey and link it to the TimePeriod object.
YieldFeatures& lSINBKKYieldFeatures =
FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
FacBomManager::addToListAndMap (lSINBKKYieldTimePeriod,
lSINBKKYieldFeatures);
FacBomManager::linkWithParent (lSINBKKYieldTimePeriod,
lSINBKKYieldFeatures);
// Generate Segment Features and link them to their YieldRule.
// Use the same key as previously.
// Create the AirlineClassListKey and link it to the YieldFeatures object.
AirlineClassList& lRAC_SQAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lSQAirlineYClassListKey);
lRAC_SQAirlineYClassList.setYield(700);
FacBomManager::addToListAndMap (lSINBKKYieldFeatures,
lRAC_SQAirlineYClassList);
FacBomManager::linkWithParent (lSINBKKYieldFeatures,
lRAC_SQAirlineYClassList);
AirlineClassList& lRAC_SQAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lSQAirlineMClassListKey);
lRAC_SQAirlineMClassList.setYield(500);
FacBomManager::addToListAndMap (lSINBKKYieldFeatures,
lRAC_SQAirlineMClassList);
FacBomManager::linkWithParent (lSINBKKYieldFeatures,
lRAC_SQAirlineMClassList);
/*===================================================================================*/
// Use the same airport pair, and date period for adding CX BKK-HKG yields.
// Set the point-of-sale-channel primary key.
// Use the same as previously.
// Create the PositionKey object and link it to the AirportPair object.
PosChannel& lRAC_BKKHKGPosChannel =
FacBomManager::addToListAndMap (lBKKHKGDatePeriod, lRAC_BKKHKGPosChannel);
FacBomManager::linkWithParent (lBKKHKGDatePeriod, lRAC_BKKHKGPosChannel);
// Set the yield time-period primary key.
// Use the same as previously.
// Create the TimePeriodKey and link it to the DatePeriod object.
TimePeriod& lBKKHKGYieldTimePeriod =
FacBom<TimePeriod>::instance().create (lYieldTimePeriodKey);
FacBomManager::addToListAndMap (lRAC_BKKHKGPosChannel,
lBKKHKGYieldTimePeriod);
FacBomManager::linkWithParent (lRAC_BKKHKGPosChannel,
lBKKHKGYieldTimePeriod);
// Generate the YieldRule
// Use the same key as previously.
// Create the YieldFeaturesKey and link it to the TimePeriod object.
YieldFeatures& lBKKHKGYieldFeatures =
FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
FacBomManager::addToListAndMap (lBKKHKGYieldTimePeriod,
lBKKHKGYieldFeatures);
FacBomManager::linkWithParent (lBKKHKGYieldTimePeriod,
lBKKHKGYieldFeatures);
// Generate Segment Features and link them to their YieldRule.
// Use the same key as previously.
// Create the AirlineClassListKey and link it to the YieldFeatures object.
AirlineClassList& lRAC_CXAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lCXAirlineYClassListKey);
lRAC_CXAirlineYClassList.setYield(700);
FacBomManager::addToListAndMap (lBKKHKGYieldFeatures,
lRAC_CXAirlineYClassList);
FacBomManager::linkWithParent (lBKKHKGYieldFeatures,
lRAC_CXAirlineYClassList);
AirlineClassList& lRAC_CXAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lCXAirlineMClassListKey);
lRAC_CXAirlineMClassList.setYield(500);
FacBomManager::addToListAndMap (lBKKHKGYieldFeatures,
lRAC_CXAirlineMClassList);
FacBomManager::linkWithParent (lBKKHKGYieldFeatures,
lRAC_CXAirlineMClassList);
/*===================================================================================*/
// Use the same airport pair, and date period for SQ-CX SIN-HKG
// Set the point-of-sale-channel primary key.
// Use the same as previously.
// Create the PositionKey object and link it to the AirportPair object.
PosChannel& lRAC_SINHKGChannel =
FacBomManager::addToListAndMap (lSINHKGDatePeriod, lRAC_SINHKGChannel);
FacBomManager::linkWithParent (lSINHKGDatePeriod, lRAC_SINHKGChannel);
// Set the yield time-period primary key.
// Use the same as previously.
// Create the TimePeriodKey and link it to the DatePeriod object.
TimePeriod& lSINHKGYieldTimePeriod =
FacBom<TimePeriod>::instance().create (lYieldTimePeriodKey);
FacBomManager::addToListAndMap (lRAC_SINHKGChannel, lSINHKGYieldTimePeriod);
FacBomManager::linkWithParent (lRAC_SINHKGChannel, lSINHKGYieldTimePeriod);
// Generate the YieldRule
// Use the same key as previously.
// Create the YieldFeaturesKey and link it to the TimePeriod object.
YieldFeatures& lSINHKGYieldFeatures =
FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
FacBomManager::addToListAndMap (lSINHKGYieldTimePeriod,
lSINHKGYieldFeatures);
FacBomManager::linkWithParent (lSINHKGYieldTimePeriod,
lSINHKGYieldFeatures);
// Generate Segment Features and link them to their YieldRule.
// Use the same key as previously
// Create the AirlineClassListKey and link it to the YieldFeatures object.
AirlineClassList& lRAC_SQ_CXAirlineYClassList =
FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineYClassListKey);
lRAC_SQ_CXAirlineYClassList.setYield(1200);
FacBomManager::addToListAndMap (lSINHKGYieldFeatures,
lRAC_SQ_CXAirlineYClassList);
FacBomManager::linkWithParent (lSINHKGYieldFeatures,
lRAC_SQ_CXAirlineYClassList);
AirlineClassList& lRAC_SQ_CXAirlineMClassList =
FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineMClassListKey);
lRAC_SQ_CXAirlineMClassList.setYield(850);
FacBomManager::addToListAndMap (lSINHKGYieldFeatures,
lRAC_SQ_CXAirlineMClassList);
FacBomManager::linkWithParent (lSINHKGYieldFeatures,
lRAC_SQ_CXAirlineMClassList);
}
}
// Check whether there are Inventory objects
const bool hasInventoryList = BomManager::hasList<Inventory> (iBomRoot);
if (hasInventoryList == true) {
// Browse the inventories
const InventoryList_T& lInventoryList =
for (InventoryList_T::const_iterator itInv = lInventoryList.begin();
itInv != lInventoryList.end(); ++itInv) {
const Inventory* lInv_ptr = *itInv;
assert (lInv_ptr != NULL);
// Clone the current inventory
Inventory& lCloneInventory = cloneInventory (*lInv_ptr, ioCloneBomRoot);
FacBomManager::addToListAndMap (ioCloneBomRoot, lCloneInventory);
FacBomManager::linkWithParent (ioCloneBomRoot, lCloneInventory);
}
}
// Check whether there are Airport Pair objects
const bool hastAirportPairList =
if (hastAirportPairList == true) {
// Browse the airport pairs
const AirportPairList_T& lAirportPairList =
for (AirportPairList_T::const_iterator itAirportPair =
lAirportPairList.begin();
itAirportPair != lAirportPairList.end(); ++itAirportPair) {
const AirportPair* lAirportPair_ptr = *itAirportPair;
assert (lAirportPair_ptr != NULL);
// Clone the current airport pair
AirportPair& lCloneAirportPair = cloneAirportPair (*lAirportPair_ptr);
FacBomManager::addToListAndMap (ioCloneBomRoot, lCloneAirportPair);
FacBomManager::linkWithParent (ioCloneBomRoot, lCloneAirportPair);
}
}
}
// ////////////////////////////////////////////////////////////////////
Inventory& CmdCloneBomManager::cloneInventory (const Inventory& iInventory,
BomRoot& ioCloneBomRoot) {
Inventory& lCloneInventory =
// Check whether there are FlightDate objects
const bool hasFlighDateList = BomManager::hasList<FlightDate> (iInventory);
if (hasFlighDateList == true) {
// Browse the flight-dates
const FlightDateList_T& lFlightDateList =
for (FlightDateList_T::const_iterator itFD = lFlightDateList.begin();
itFD != lFlightDateList.end(); ++itFD) {
const FlightDate* lFD_ptr = *itFD;
assert (lFD_ptr != NULL);
// Clone the current flight-date
FlightDate& lCloneFD = cloneFlightDate (*lFD_ptr);
FacBomManager::addToListAndMap (lCloneInventory, lCloneFD);
FacBomManager::linkWithParent (lCloneInventory, lCloneFD);
}
}
// Check if the inventory contains a list of partners
const bool hasPartnerList = BomManager::hasList<Inventory> (iInventory);
if (hasPartnerList == true) {
// Browse the partner's inventories
const InventoryList_T& lPartnerInventoryList =
for (InventoryList_T::const_iterator itInv =
lPartnerInventoryList.begin();
itInv != lPartnerInventoryList.end(); ++itInv) {
const Inventory* lInv_ptr = *itInv;
assert (lInv_ptr != NULL);
// Clone the current partnership inventory
Inventory& lClonePartnerInventory = cloneInventory (*lInv_ptr,
ioCloneBomRoot);
lClonePartnerInventory);
lClonePartnerInventory);
}
}
// Check whether there are O&D date objects
const bool hasOnDList = BomManager::hasList<OnDDate> (iInventory);
if (hasOnDList == true){
//Browse the O&Ds
const OnDDateList_T& lOnDDateList =
for (OnDDateList_T::const_iterator itOnD = lOnDDateList.begin();
itOnD != lOnDDateList.end(); ++itOnD) {
const OnDDate* lOnDDate_ptr = *itOnD;
assert (lOnDDate_ptr != NULL);
// Clone the current O&D date
OnDDate& lCloneOnDDate = cloneOnDDate (*lOnDDate_ptr);
FacBomManager::addToListAndMap (lCloneInventory, lCloneOnDDate);
FacBomManager::linkWithParent (lCloneInventory, lCloneOnDDate);
}
}
// Check whether there are Flight Period objects
const bool hasFlightPeriodList =
if (hasFlightPeriodList == true) {
// Browse the flight-periods
const FlightPeriodList_T& lFlightPeriodList =
for (FlightPeriodList_T::const_iterator itFlightPeriod =
lFlightPeriodList.begin();
itFlightPeriod != lFlightPeriodList.end(); ++itFlightPeriod) {
const FlightPeriod* lFlightPeriod_ptr = *itFlightPeriod;
assert (lFlightPeriod_ptr != NULL);
// Clone the current flight period
FlightPeriod& lCloneFlightPeriod = cloneFlightPeriod (*lFlightPeriod_ptr);
FacBomManager::addToListAndMap (lCloneInventory, lCloneFlightPeriod);
FacBomManager::linkWithParent (lCloneInventory, lCloneFlightPeriod);
}
}
// Check whether there is an airline feature object
const AirlineFeature* lAirlineFeature_ptr =
iInventory.getAirlineCode());
if (lAirlineFeature_ptr != NULL) {
// Clone the current airline feature object
AirlineFeature& lCloneAirlineFeature =
cloneAirlineFeature (*lAirlineFeature_ptr);
FacBomManager::setAirlineFeature (lCloneInventory, lCloneAirlineFeature);
FacBomManager::linkWithParent (lCloneInventory, lCloneAirlineFeature);
// Link the airline feature object with the top of the BOM tree
FacBomManager::addToListAndMap (ioCloneBomRoot, lCloneAirlineFeature);
}
return lCloneInventory;
}
// ////////////////////////////////////////////////////////////////////
AirlineFeature& CmdCloneBomManager::
cloneAirlineFeature (const AirlineFeature& iAirlineFeature) {
AirlineFeature& lCloneAirlineFeature =
return lCloneAirlineFeature;
}
// ////////////////////////////////////////////////////////////////////
OnDDate& CmdCloneBomManager::cloneOnDDate (const OnDDate& iOnDDate) {
OnDDate& lCloneOnDDate =
return lCloneOnDDate;
}
// ////////////////////////////////////////////////////////////////////
FlightDate& CmdCloneBomManager::
cloneFlightDate (const FlightDate& iFlightDate) {
FlightDate& lCloneFlightDate =
// Check whether there are LegDate objects
const bool hasLegDateList = BomManager::hasList<LegDate> (iFlightDate);
if (hasLegDateList == true) {
// Browse the leg-dates
const LegDateList_T& lLegDateList =
for (LegDateList_T::const_iterator itLD = lLegDateList.begin();
itLD != lLegDateList.end(); ++itLD) {
const LegDate* lLD_ptr = *itLD;
assert (lLD_ptr != NULL);
// Clone the current leg-date
LegDate& lCloneLegDate = cloneLegDate (*lLD_ptr);
FacBomManager::addToListAndMap (lCloneFlightDate, lCloneLegDate);
FacBomManager::linkWithParent (lCloneFlightDate, lCloneLegDate);
}
}
// Check whether there are SegmentDate objects
const bool hasSegmentDateList =
if (hasSegmentDateList == true) {
// Browse the segment-dates
const SegmentDateList_T& lSegmentDateList =
for (SegmentDateList_T::const_iterator itSD = lSegmentDateList.begin();
itSD != lSegmentDateList.end(); ++itSD) {
const SegmentDate* lSD_ptr = *itSD;
assert (lSD_ptr != NULL);
// Clone the current segment-date
SegmentDate& lCloneSegmentDate = cloneSegmentDate (*lSD_ptr);
FacBomManager::addToListAndMap (lCloneFlightDate, lCloneSegmentDate);
FacBomManager::linkWithParent (lCloneFlightDate, lCloneSegmentDate);
}
}
return lCloneFlightDate;
}
// ////////////////////////////////////////////////////////////////////
LegDate& CmdCloneBomManager::cloneLegDate (const LegDate& iLegDate) {
LegDate& lCloneLegDate =
// Check whether there are LegCabin objects
const bool hasLegCabinList = BomManager::hasList<LegCabin> (iLegDate);
if (hasLegCabinList == true) {
// Browse the leg-cabins
const LegCabinList_T& lLegCabinList =
for (LegCabinList_T::const_iterator itLC = lLegCabinList.begin();
itLC != lLegCabinList.end(); ++itLC) {
const LegCabin* lLC_ptr = *itLC;
assert (lLC_ptr != NULL);
// Clone the current leg-cabin
LegCabin& lCloneLegCabin = cloneLegCabin (*lLC_ptr);
FacBomManager::addToListAndMap (lCloneLegDate, lCloneLegCabin);
FacBomManager::linkWithParent (lCloneLegDate, lCloneLegCabin);
}
}
return lCloneLegDate;
}
// ////////////////////////////////////////////////////////////////////
LegCabin& CmdCloneBomManager::cloneLegCabin (const LegCabin& iLegCabin) {
LegCabin& lCloneLegCabin =
// Check whether there are Bucket objects
const bool hasBucketList = BomManager::hasList<Bucket> (iLegCabin);
if (hasBucketList == true) {
// Browse the buckets
const BucketList_T& lBucketList =
for (BucketList_T::const_iterator itBucket = lBucketList.begin();
itBucket != lBucketList.end(); ++itBucket) {
const Bucket* lBucket_ptr = *itBucket;
assert (lBucket_ptr != NULL);
// Clone the current bucket
Bucket& lCloneBucket = cloneBucket (*lBucket_ptr);
FacBomManager::addToListAndMap (lCloneLegCabin, lCloneBucket);
FacBomManager::linkWithParent (lCloneLegCabin, lCloneBucket);
}
}
return lCloneLegCabin;
}
// ////////////////////////////////////////////////////////////////////
Bucket& CmdCloneBomManager::cloneBucket (const Bucket& iBucket) {
Bucket& lCloneBucket =
return lCloneBucket;
}
// ////////////////////////////////////////////////////////////////////
SegmentDate& CmdCloneBomManager::
cloneSegmentDate (const SegmentDate& iSegmentDate) {
SegmentDate& lCloneSegmentDate =
// Check whether there are SegmentCabin objects
const bool hasSegmentCabinList =
if (hasSegmentCabinList == true) {
// Browse the segment-cabins
const SegmentCabinList_T& lSegmentCabinList =
for (SegmentCabinList_T::const_iterator itSC = lSegmentCabinList.begin();
itSC != lSegmentCabinList.end(); ++itSC) {
const SegmentCabin* lSC_ptr = *itSC;
assert (lSC_ptr != NULL);
// Clone the current segment-cabin
SegmentCabin& lCloneSegmentCabin = cloneSegmentCabin (*lSC_ptr);
FacBomManager::addToListAndMap (lCloneSegmentDate, lCloneSegmentCabin);
FacBomManager::linkWithParent (lCloneSegmentDate, lCloneSegmentCabin);
linkBookingClassesWithSegment (lCloneSegmentDate,
lCloneSegmentCabin);
}
}
return lCloneSegmentDate;
}
// ////////////////////////////////////////////////////////////////////
void CmdCloneBomManager::
linkBookingClassesWithSegment (SegmentDate& iCloneSegmentDate,
SegmentCabin& iCloneSegmentCabin) {
// Browse the fare families to link the booking-classes to the
// segment-cabin and to the segment-date
const bool hasFareFamilyList =
BomManager::hasList<FareFamily> (iCloneSegmentCabin);
if (hasFareFamilyList == true) {
const FareFamilyList_T& lCloneFFList =
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);
// Browse the list of booking classes
const bool hasBookingClasslist =
if (hasBookingClasslist == true) {
const BookingClassList_T& lCloneBCList =
for (BookingClassList_T::const_iterator itCloneBC =
lCloneBCList.begin();
itCloneBC != lCloneBCList.end(); ++itCloneBC) {
const BookingClass* lCloneBC_ptr = *itCloneBC;
assert (lCloneBC_ptr != NULL);
// Link the booking-class to the segment-cabin
*lCloneBC_ptr);
// Link the booking-class to the segment-date
*lCloneBC_ptr);
}
}
}
}
}
// ////////////////////////////////////////////////////////////////////
SegmentCabin& CmdCloneBomManager::
cloneSegmentCabin (const SegmentCabin& iSegmentCabin) {
SegmentCabin& lCloneSegmentCabin =
// Check whether there are fare family objects
const bool hasFareFamilyList =
if (hasFareFamilyList == true) {
// Browse the fare families
const FareFamilyList_T& lFareFamilyList =
for (FareFamilyList_T::const_iterator itFF = lFareFamilyList.begin();
itFF != lFareFamilyList.end(); ++itFF) {
const FareFamily* lFF_ptr = *itFF;
assert (lFF_ptr != NULL);
// Clone the current fare-family
FareFamily& lCloneFareFamily = cloneFareFamily (*lFF_ptr);
FacBomManager::addToListAndMap (lCloneSegmentCabin, lCloneFareFamily);
FacBomManager::linkWithParent (lCloneSegmentCabin, lCloneFareFamily);
}
}
return lCloneSegmentCabin;
}
// ////////////////////////////////////////////////////////////////////
FareFamily& CmdCloneBomManager::
cloneFareFamily (const FareFamily& iFareFamily) {
FareFamily& lCloneFareFamily =
// Check whether there are booking classes objects
const bool hasBookingClassList =
if (hasBookingClassList == true) {
// Browse the list of booking classes
const BookingClassList_T& lBookingClassList =
for (BookingClassList_T::const_iterator itBookingClass =
lBookingClassList.begin();
itBookingClass != lBookingClassList.end(); ++itBookingClass) {
const BookingClass* lBC_ptr = *itBookingClass;
assert (lBC_ptr != NULL);
// Clone the current booking class
BookingClass& lCloneBookingClass = cloneBookingClass (*lBC_ptr);
FacBomManager::addToListAndMap (lCloneFareFamily, lCloneBookingClass);
FacBomManager::linkWithParent (lCloneFareFamily, lCloneBookingClass);
}
}
return lCloneFareFamily;
}
// ////////////////////////////////////////////////////////////////////
BookingClass& CmdCloneBomManager::
cloneBookingClass (const BookingClass& iBookingClass) {
BookingClass& lCloneBookingClass =
return lCloneBookingClass;
}
// ////////////////////////////////////////////////////////////////////
AirportPair& CmdCloneBomManager::
cloneAirportPair (const AirportPair& iAirportPair) {
AirportPair& lCloneAirportPair =
// Check whether there are date-period objects
const bool hasDatePeriodList =
if (hasDatePeriodList == true) {
// Browse the date-periods
const DatePeriodList_T& lDatePeriodList =
for (DatePeriodList_T::const_iterator itDatePeriod =
lDatePeriodList.begin();
itDatePeriod != lDatePeriodList.end(); ++itDatePeriod) {
const DatePeriod* lDatePeriod_ptr = *itDatePeriod;
assert (lDatePeriod_ptr != NULL);
// Clone the current date-period
DatePeriod& lCloneDatePeriod = cloneDatePeriod (*lDatePeriod_ptr);
FacBomManager::addToListAndMap (lCloneAirportPair, lCloneDatePeriod);
FacBomManager::linkWithParent (lCloneAirportPair, lCloneDatePeriod);
}
}
return lCloneAirportPair;
}
// ////////////////////////////////////////////////////////////////////
DatePeriod& CmdCloneBomManager::
cloneDatePeriod (const DatePeriod& iDatePeriod) {
DatePeriod& lCloneDatePeriod =
// Check whether there are pos-channel objects
const bool hasPosChannelList =
if (hasPosChannelList == true) {
// Browse the pos-channels
const PosChannelList_T& lPosChannelList =
for (PosChannelList_T::const_iterator itPosChannel =
lPosChannelList.begin();
itPosChannel != lPosChannelList.end(); ++itPosChannel) {
const PosChannel* lPosChannel_ptr = *itPosChannel;
assert (lPosChannel_ptr != NULL);
// Clone the current pos-channel
PosChannel& lClonePosChannel = clonePosChannel (*lPosChannel_ptr);
FacBomManager::addToListAndMap (lCloneDatePeriod, lClonePosChannel);
FacBomManager::linkWithParent (lCloneDatePeriod, lClonePosChannel);
}
}
return lCloneDatePeriod;
}
// ////////////////////////////////////////////////////////////////////
PosChannel& CmdCloneBomManager::
clonePosChannel (const PosChannel& iPosChannel) {
PosChannel& lClonePosChannel =
// Check whether there are time-period objects
const bool hasTimePeriodList =
if (hasTimePeriodList == true) {
// Browse the time-periods
const TimePeriodList_T& lTimePeriodList =
for (TimePeriodList_T::const_iterator itTimePeriod =
lTimePeriodList.begin();
itTimePeriod != lTimePeriodList.end(); ++itTimePeriod) {
const TimePeriod* lTimePeriod_ptr = *itTimePeriod;
assert (lTimePeriod_ptr != NULL);
// Clone the current time-period
TimePeriod& lCloneTimePeriod = cloneTimePeriod (*lTimePeriod_ptr);
FacBomManager::addToListAndMap (lClonePosChannel, lCloneTimePeriod);
FacBomManager::linkWithParent (lClonePosChannel, lCloneTimePeriod);
}
}
return lClonePosChannel;
}
// ////////////////////////////////////////////////////////////////////
TimePeriod& CmdCloneBomManager::
cloneTimePeriod (const TimePeriod& iTimePeriod) {
TimePeriod& lCloneTimePeriod =
// Check whether there are fare-feature objects
const bool hasFareFeaturesList =
if (hasFareFeaturesList == true) {
// Browse the fare-features
const FareFeaturesList_T& lFareFeaturesList =
for (FareFeaturesList_T::const_iterator itFF = lFareFeaturesList.begin();
itFF != lFareFeaturesList.end(); ++itFF) {
const FareFeatures* lFF_ptr = *itFF;
assert (lFF_ptr != NULL);
// Clone the current fare-feature
FareFeatures& lCloneFareFeatures =
cloneFeatures<FareFeatures> (*lFF_ptr);
FacBomManager::addToListAndMap (lCloneTimePeriod, lCloneFareFeatures);
FacBomManager::linkWithParent (lCloneTimePeriod, lCloneFareFeatures);
}
}
// Check whether there are yield-feature objects
const bool hasYieldFeaturesList =
if (hasYieldFeaturesList == true) {
// Browse the yield-features
const YieldFeaturesList_T& lYieldFeaturesList =
for (YieldFeaturesList_T::const_iterator itYF =
lYieldFeaturesList.begin();
itYF != lYieldFeaturesList.end(); ++itYF) {
const YieldFeatures* lYF_ptr = *itYF;
assert (lYF_ptr != NULL);
// Clone the current yield-feature
YieldFeatures& lCloneYieldFeatures =
cloneFeatures<YieldFeatures> (*lYF_ptr);
FacBomManager::addToListAndMap (lCloneTimePeriod, lCloneYieldFeatures);
FacBomManager::linkWithParent (lCloneTimePeriod, lCloneYieldFeatures);
}
}
return lCloneTimePeriod;
}
// ////////////////////////////////////////////////////////////////////
template <typename FEATURE_TYPE>
FEATURE_TYPE& CmdCloneBomManager::
cloneFeatures (const FEATURE_TYPE& iFeatures) {
FEATURE_TYPE& lCloneFeatures =
// Check whether there are airline-class list objects
const bool hasAirlineClassListList =
if (hasAirlineClassListList == true) {
// Browse the airline-class lists
const AirlineClassListList_T& lAirlineClassList =
for (AirlineClassListList_T::const_iterator itACList =
lAirlineClassList.begin();
itACList != lAirlineClassList.end(); ++itACList) {
const AirlineClassList* lACList_ptr = *itACList;
assert (lACList_ptr != NULL);
// Clone the current airline-class list
AirlineClassList& lCloneAirlineClassList =
cloneAirlineClassList (*lACList_ptr);
lCloneAirlineClassList);
lCloneAirlineClassList);
}
}
return lCloneFeatures;
}
// ////////////////////////////////////////////////////////////////////
AirlineClassList& CmdCloneBomManager::
cloneAirlineClassList (const AirlineClassList& iAirlineClassList) {
AirlineClassList& lCloneAirlineClassList =
return lCloneAirlineClassList;
}
// ////////////////////////////////////////////////////////////////////
FlightPeriod& CmdCloneBomManager::
cloneFlightPeriod (const FlightPeriod& iFlightPeriod) {
FlightPeriod& lCloneFlightPeriod =
// Check whether there are airline-class list objects
const bool hasSegmentPeriodList =
if (hasSegmentPeriodList == true) {
// Browse the airline-class lists
const SegmentPeriodList_T& lSegmentPeriodList =
for (SegmentPeriodList_T::const_iterator itSegmentPeriod =
lSegmentPeriodList.begin();
itSegmentPeriod != lSegmentPeriodList.end(); ++itSegmentPeriod) {
const SegmentPeriod* lSegmentPeriod_ptr = *itSegmentPeriod;
assert (lSegmentPeriod_ptr != NULL);
// Clone the current airline-class list
SegmentPeriod& lCloneSegmentPeriod =
cloneSegmentPeriod (*lSegmentPeriod_ptr);
FacBomManager::addToListAndMap (lCloneFlightPeriod,
lCloneSegmentPeriod);
FacBomManager::linkWithParent (lCloneFlightPeriod,
lCloneSegmentPeriod);
}
}
return lCloneFlightPeriod;
}
// ////////////////////////////////////////////////////////////////////
SegmentPeriod& CmdCloneBomManager::
cloneSegmentPeriod (const SegmentPeriod& iSegmentPeriod) {
SegmentPeriod& lCloneSegmentPeriod =
return lCloneSegmentPeriod;
}
}