From: <den...@us...> - 2010-01-04 20:03:17
|
Revision: 86 http://stdair.svn.sourceforge.net/stdair/?rev=86&view=rev Author: denis_arnaud Date: 2010-01-04 20:03:11 +0000 (Mon, 04 Jan 2010) Log Message: ----------- [Dev] Improved the granularity of the BomManager::display() utility. Modified Paths: -------------- trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/BomManager.hpp Modified: trunk/stdair/stdair/bom/BomManager.cpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.cpp 2010-01-04 17:13:25 UTC (rev 85) +++ trunk/stdair/stdair/bom/BomManager.cpp 2010-01-04 20:03:11 UTC (rev 86) @@ -23,66 +23,124 @@ // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const BomRoot& iBomRoot) { - // Browse the Inventory objects - const InventoryList_T lInventoryList= iBomRoot.getInventoryList (); + const InventoryList_T& lInventoryList= iBomRoot.getInventoryList (); for (InventoryList_T::iterator itInv = lInventoryList.begin(); itInv != lInventoryList.end(); ++itInv) { const Inventory& lCurrentInventory = *itInv; - oStream << "Inventory: " << lCurrentInventory.toString(); - // Browse the FlightDate objects - const FlightDateList_T lFDList = - lCurrentInventory.getFlightDateList (); - for (FlightDateList_T::iterator itFD = lFDList.begin(); - itFD != lFDList.end(); ++itFD) { - const FlightDate& lCurrentFD = *itFD; - oStream << "Flight-date: " << lCurrentFD.toString(); + // Call recursively the display() method on the children objects + display (oStream, lCurrentInventory); + } - // Browse the LegDate objects - const LegDateList_T lLDList = lCurrentFD.getLegDateList(); - for (LegDateList_T::iterator itLD = lLDList.begin(); - itLD != lLDList.end(); ++itLD) { - const LegDate& lCurrentLD = *itLD; - oStream << "Leg-date: " << lCurrentLD.toString(); - - // Browse the LegCabin objects - const LegCabinList_T lLCList = lCurrentLD.getLegCabinList(); - for (LegCabinList_T::iterator itLC = lLCList.begin(); - itLC != lLCList.end(); ++itLC) { - const LegCabin& lCurrentLC = *itLC; - oStream << "Leg-cabin: " << lCurrentLC.toString(); - } - } - - // Browse the SegmentDate objects - const SegmentDateList_T lSDList = - lCurrentFD.getSegmentDateList(); - for (SegmentDateList_T::iterator itSD = lSDList.begin(); - itSD != lSDList.end(); ++itSD) { - const SegmentDate& lCurrentSD = *itSD; - oStream << "Segment-date: " << lCurrentSD.toString(); + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, const Inventory& iInventory) { + // Inventory level + oStream << "Inventory: " << iInventory.toString(); + + // Browse the FlightDate objects + const FlightDateList_T& lFDList = iInventory.getFlightDateList (); + for (FlightDateList_T::iterator itFD = lFDList.begin(); + itFD != lFDList.end(); ++itFD) { + const FlightDate& lCurrentFD = *itFD; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentFD); + } + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const FlightDate& iFlightDate) { + // Flight-date level + oStream << "Flight-date: " << iFlightDate.toString(); + + // Browse the LegDate objects + const LegDateList_T& lLDList = iFlightDate.getLegDateList(); + for (LegDateList_T::iterator itLD = lLDList.begin(); + itLD != lLDList.end(); ++itLD) { + const LegDate& lCurrentLD = *itLD; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentLD); + } + + // Browse the SegmentDate objects + const SegmentDateList_T& lSDList = iFlightDate.getSegmentDateList(); + for (SegmentDateList_T::iterator itSD = lSDList.begin(); + itSD != lSDList.end(); ++itSD) { + const SegmentDate& lCurrentSD = *itSD; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentSD); + } + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const LegDate& iLegDate) { + // Leg-date level + oStream << "Leg-date: " << iLegDate.toString(); + + // Browse the LegCabin objects + const LegCabinList_T& lLCList = iLegDate.getLegCabinList(); + for (LegCabinList_T::iterator itLC = lLCList.begin(); + itLC != lLCList.end(); ++itLC) { + const LegCabin& lCurrentLC = *itLC; - // Browse the SegmentCabin objects - const SegmentCabinList_T lSCList = - lCurrentSD.getSegmentCabinList(); - for (SegmentCabinList_T::iterator itSC = lSCList.begin(); - itSC != lSCList.end(); ++itSC) { - const SegmentCabin& lCurrentSC = *itSC; - oStream << "Segment-cabin: " << lCurrentSC.toString(); + // Call recursively the display() method on the children objects + display (oStream, lCurrentLC); + } + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const LegCabin& iLegCabin) { + // Leg-cabin level + oStream << "Leg-cabin: " << iLegCabin.toString(); + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const SegmentDate& iSegmentDate) { + // Segment-date level + oStream << "Segment-date: " << iSegmentDate.toString(); - // Browse the BookingClass objects - const BookingClassList_T lBCList = - lCurrentSC.getBookingClassList (); - for (BookingClassList_T::iterator itBC = lBCList.begin(); - itBC != lBCList.end(); ++itBC) { - const BookingClass& lCurrentBC = *itBC; - oStream << "Booking class: " << lCurrentBC.toString(); - } - } - } - } + // Browse the SegmentCabin objects + const SegmentCabinList_T& lSCList = iSegmentDate.getSegmentCabinList(); + for (SegmentCabinList_T::iterator itSC = lSCList.begin(); + itSC != lSCList.end(); ++itSC) { + const SegmentCabin& lCurrentSC = *itSC; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentSC); } - } + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const SegmentCabin& iSegmentCabin) { + // Segment-cabin level + oStream << "Segment-cabin: " << iSegmentCabin.toString(); + + // Browse the BookingClass objects + const BookingClassList_T& lBCList = iSegmentCabin.getBookingClassList (); + for (BookingClassList_T::iterator itBC = lBCList.begin(); + itBC != lBCList.end(); ++itBC) { + const BookingClass& lCurrentBC = *itBC; + // Call recursively the display() method on the children objects + display (oStream, lCurrentBC); + } + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const BookingClass& iBookingClass) { + // Booking-class level + oStream << "Booking class: " << iBookingClass.toString(); + } + } Modified: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp 2010-01-04 17:13:25 UTC (rev 85) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-01-04 20:03:11 UTC (rev 86) @@ -16,12 +16,62 @@ /** Utility class for StdAir objects. */ class BomManager { public: + // //////////////// Display support methods ///////////////// /** Recursively display (dump in the underlying output log stream) the objects of the given BOM tree. @param std::ostream& Output stream in which the BOM tree should be logged/dumped. @param const BomRoot& Root of the BOM tree to be displayed. */ static void display (std::ostream&, const BomRoot&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const Inventory& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const Inventory&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const FlightDate& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const FlightDate&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const LegDate& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const LegDate&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const LegCabin& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const LegCabin&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const SegmentDate& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const SegmentDate&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const SegmentCabin& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const SegmentCabin&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const BookingClass& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const BookingClass&); }; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-01-12 15:16:22
|
Revision: 91 http://stdair.svn.sourceforge.net/stdair/?rev=91&view=rev Author: denis_arnaud Date: 2010-01-12 15:16:10 +0000 (Tue, 12 Jan 2010) Log Message: ----------- [Dev] Improved the recursive display() method. Modified Paths: -------------- trunk/stdair/stdair/bom/AirportDateKey.cpp trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/BomManager.hpp trunk/stdair/stdair/bom/FlightDateKey.cpp Modified: trunk/stdair/stdair/bom/AirportDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-01-07 15:53:41 UTC (rev 90) +++ trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-01-12 15:16:10 UTC (rev 91) @@ -36,7 +36,7 @@ // //////////////////////////////////////////////////////////////////// const std::string AirportDateKey_T::toString() const { std::ostringstream oStr; - oStr << _origin; + oStr << _parentKey.toString() << " " << _origin; return oStr.str(); } Modified: trunk/stdair/stdair/bom/BomManager.cpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.cpp 2010-01-07 15:53:41 UTC (rev 90) +++ trunk/stdair/stdair/bom/BomManager.cpp 2010-01-12 15:16:10 UTC (rev 91) @@ -6,6 +6,10 @@ #include <ostream> // STDAIR #include <stdair/bom/BomRoot.hpp> +#include <stdair/bom/AirlineFeatureSet.hpp> +#include <stdair/bom/AirlineFeature.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> #include <stdair/bom/Inventory.hpp> #include <stdair/bom/FlightDate.hpp> #include <stdair/bom/SegmentDate.hpp> @@ -13,16 +17,19 @@ #include <stdair/bom/SegmentCabin.hpp> #include <stdair/bom/LegCabin.hpp> #include <stdair/bom/BookingClass.hpp> -#include <stdair/bom/BomList.hpp> -#include <stdair/bom/BomMap.hpp> -#include <stdair/bom/AirlineFeatureSet.hpp> -#include <stdair/bom/AirlineFeature.hpp> +#include <stdair/bom/Network.hpp> +#include <stdair/bom/NetworkDate.hpp> +#include <stdair/bom/AirportDate.hpp> +#include <stdair/bom/OutboundPath.hpp> #include <stdair/bom/BomManager.hpp> namespace stdair { // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const BomRoot& iBomRoot) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Browse the Inventory objects const InventoryList_T& lInventoryList= iBomRoot.getInventoryList (); for (InventoryList_T::iterator itInv = lInventoryList.begin(); @@ -33,12 +40,28 @@ display (oStream, lCurrentInventory); } + // Browse the Network objects + const NetworkList_T& lNetworkList= iBomRoot.getNetworkList (); + for (NetworkList_T::iterator itInv = lNetworkList.begin(); + itInv != lNetworkList.end(); ++itInv) { + const Network& lCurrentNetwork = *itInv; + + // Call recursively the display() method on the children objects + oStream << std::endl; + display (oStream, lCurrentNetwork); + } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const Inventory& iInventory) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Inventory level - oStream << "Inventory: " << iInventory.toString(); + oStream << "Inventory: " << iInventory.describeKey() << std::endl; // Browse the FlightDate objects const FlightDateList_T& lFDList = iInventory.getFlightDateList (); @@ -49,13 +72,19 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentFD); } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const FlightDate& iFlightDate) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Flight-date level - oStream << "Flight-date: " << iFlightDate.toString(); + oStream << iFlightDate.describeKey() << std::endl; // Browse the LegDate objects const LegDateList_T& lLDList = iFlightDate.getLegDateList(); @@ -76,13 +105,19 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentSD); } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const LegDate& iLegDate) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Leg-date level - oStream << "Leg-date: " << iLegDate.toString(); + oStream << iLegDate.describeKey() << std::endl; // Browse the LegCabin objects const LegCabinList_T& lLCList = iLegDate.getLegCabinList(); @@ -93,20 +128,32 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentLC); } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const LegCabin& iLegCabin) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Leg-cabin level - oStream << "Leg-cabin: " << iLegCabin.toString(); + oStream << iLegCabin.describeKey() << std::endl; + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const SegmentDate& iSegmentDate) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Segment-date level - oStream << "Segment-date: " << iSegmentDate.toString(); + oStream << iSegmentDate.describeKey() << std::endl; // Browse the SegmentCabin objects const SegmentCabinList_T& lSCList = iSegmentDate.getSegmentCabinList(); @@ -117,16 +164,22 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentSC); } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const SegmentCabin& iSegmentCabin) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Segment-cabin level - oStream << "Segment-cabin: " << iSegmentCabin.toString(); + oStream << iSegmentCabin.describeKey() << std::endl; // Browse the BookingClass objects - const BookingClassList_T& lBCList = iSegmentCabin.getBookingClassList (); + const BookingClassList_T& lBCList = iSegmentCabin.getBookingClassList(); for (BookingClassList_T::iterator itBC = lBCList.begin(); itBC != lBCList.end(); ++itBC) { const BookingClass& lCurrentBC = *itBC; @@ -134,13 +187,110 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentBC); } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const BookingClass& iBookingClass) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Booking-class level - oStream << "Booking class: " << iBookingClass.toString(); + oStream << iBookingClass.describeKey() << std::endl; + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const Network& iNetwork) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + + oStream << "Network: " << std::endl; + + int j = 1; + const NetworkDateList_T& lNetworkDateList = iNetwork.getNetworkDateList(); + for (NetworkDateList_T::iterator itNetworkDate = + lNetworkDateList.begin(); + itNetworkDate != lNetworkDateList.end(); ++itNetworkDate, ++j) { + const NetworkDate& lCurrentNetworkDate = *itNetworkDate; + + + // Call recursively the display() method on the children objects + display (oStream, lCurrentNetworkDate); + } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); + } + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const NetworkDate& iNetworkDate) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + + oStream << iNetworkDate.describeKey() << std::endl; + + const AirportDateList_T& lAirportDateList= iNetworkDate.getAirportDateList(); + for (AirportDateList_T::iterator itAirportDate = lAirportDateList.begin(); + itAirportDate != lAirportDateList.end(); ++itAirportDate) { + const AirportDate& lCurrentAirportDate = *itAirportDate; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentAirportDate); + } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const AirportDate& iAirportDate) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + + oStream << iAirportDate.describeKey() << std::endl; + + const OutboundPathList_T& lOutboundPathList = + iAirportDate.getOutboundPathList(); + for (OutboundPathList_T::iterator itPath = lOutboundPathList.begin(); + itPath != lOutboundPathList.end(); ++itPath) { + const OutboundPath& lCurrentOutboundPath = *itPath; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentOutboundPath); + } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const OutboundPath& iOutboundPath) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + + oStream << iOutboundPath.describeKey() << std::endl; + + const SegmentDateList_T& lSegmentDateList = + iOutboundPath.getSegmentDateList(); + for (SegmentDateList_T::iterator itSegmentDate = lSegmentDateList.begin(); + itSegmentDate != lSegmentDateList.end(); ++itSegmentDate) { + const SegmentDate& lCurrentSegmentDate = *itSegmentDate; + + oStream << lCurrentSegmentDate.describeKey() << std::endl; + } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); + } + } Modified: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp 2010-01-07 15:53:41 UTC (rev 90) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-01-12 15:16:10 UTC (rev 91) @@ -18,7 +18,10 @@ class SegmentDate; class SegmentCabin; class BookingClass; - + class Network; + class NetworkDate; + class AirportDate; + class OutboundPath; /** Utility class for StdAir objects. */ class BomManager { @@ -79,6 +82,34 @@ logged/dumped. @param const BookingClass& Root of the BOM tree to be displayed. */ static void display (std::ostream&, const BookingClass&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const Network& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const Network&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const NetworkDate& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const NetworkDate&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const AirportDate& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const AirportDate&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const OutboundPath& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const OutboundPath&); }; } Modified: trunk/stdair/stdair/bom/FlightDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateKey.cpp 2010-01-07 15:53:41 UTC (rev 90) +++ trunk/stdair/stdair/bom/FlightDateKey.cpp 2010-01-12 15:16:10 UTC (rev 91) @@ -34,7 +34,7 @@ // //////////////////////////////////////////////////////////////////// const std::string FlightDateKey_T::toString() const { std::ostringstream oStr; - oStr << _flightNumber << ", " << _flightDate; + oStr << _parentKey.toString() << _flightNumber << " " << _flightDate; return oStr.str(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-01-14 17:33:01
|
Revision: 92 http://stdair.svn.sourceforge.net/stdair/?rev=92&view=rev Author: denis_arnaud Date: 2010-01-14 17:32:54 +0000 (Thu, 14 Jan 2010) Log Message: ----------- [Dev] Added a constructor to the BookingRequestStruct object. Modified Paths: -------------- trunk/stdair/stdair/bom/BookingRequestStruct.cpp trunk/stdair/stdair/bom/BookingRequestStruct.hpp Modified: trunk/stdair/stdair/bom/BookingRequestStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingRequestStruct.cpp 2010-01-12 15:16:10 UTC (rev 91) +++ trunk/stdair/stdair/bom/BookingRequestStruct.cpp 2010-01-14 17:32:54 UTC (rev 92) @@ -12,6 +12,14 @@ namespace stdair { // ////////////////////////////////////////////////////////////////////// + BookingRequestStruct::BookingRequestStruct (const AirportCode_T& iOrigin, + const AirportCode_T& iDestination, + const Date_T& iDepartureDate, + const PassengerType_T& iPaxType, + const NbOfSeats_T& iPartySize) { + } + + // ////////////////////////////////////////////////////////////////////// void BookingRequestStruct::toStream (std::ostream& ioOut) const { ioOut << describe(); } Modified: trunk/stdair/stdair/bom/BookingRequestStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingRequestStruct.hpp 2010-01-12 15:16:10 UTC (rev 91) +++ trunk/stdair/stdair/bom/BookingRequestStruct.hpp 2010-01-14 17:32:54 UTC (rev 92) @@ -82,7 +82,13 @@ /** Display of the structure. */ const std::string describe() const; + public: + // /////////////// Constructors and Destructors ///////////////// + BookingRequestStruct (const AirportCode_T&, const AirportCode_T&, + const Date_T&, const PassengerType_T&, + const NbOfSeats_T&); + private: // /////////////// Attributes ///////////////// /** Origin. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-02-03 14:10:01
|
Revision: 112 http://stdair.svn.sourceforge.net/stdair/?rev=112&view=rev Author: quannaus Date: 2010-02-03 14:09:48 +0000 (Wed, 03 Feb 2010) Log Message: ----------- [dev] Added some 'get' functions. Modified Paths: -------------- trunk/stdair/stdair/bom/AirportDateKey.cpp trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/BookingClassContent.cpp trunk/stdair/stdair/bom/BookingClassContent.hpp trunk/stdair/stdair/bom/BookingClassKey.hpp trunk/stdair/stdair/bom/BookingClassTypes.hpp trunk/stdair/stdair/bom/BookingRequestStruct.cpp trunk/stdair/stdair/bom/Network.cpp trunk/stdair/stdair/bom/Network.hpp trunk/stdair/stdair/bom/NetworkDate.cpp trunk/stdair/stdair/bom/NetworkDate.hpp trunk/stdair/stdair/bom/SegmentCabinKey.hpp trunk/stdair/stdair/bom/TravelSolutionStruct.cpp trunk/stdair/stdair/bom/TravelSolutionStruct.hpp trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/TravelSolutionTypes.hpp Modified: trunk/stdair/stdair/bom/AirportDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-02-03 14:09:48 UTC (rev 112) @@ -36,7 +36,7 @@ // //////////////////////////////////////////////////////////////////// const std::string AirportDateKey_T::toString() const { std::ostringstream oStr; - oStr << _parentKey.toString() << " " << _origin; + oStr << _origin; return oStr.str(); } Modified: trunk/stdair/stdair/bom/BookingClass.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.hpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/BookingClass.hpp 2010-02-03 14:09:48 UTC (rev 112) @@ -37,89 +37,8 @@ BOM content child type. */ typedef BookingClass ContentChild_T; - public: - // /////////// Getters ///////////// - /** Get the FareFamily (parent class). */ - // FareFamily* getFareFamily() const { -// return _fareFamily; -// } - // ////// Getters from the parent class /////// -// /** Get the airline code (from the parent class). */ -// const AirlineCode_T& getAirlineCode() const; - -// /** Get the flight number (from the parent class). */ -// const FlightNumber_T& getFlightNumber() const; - -// /** Get the flight-date (from the parent class). */ -// const Date_T& getFlightDateDate() const; - -// /** Get the board point (from the parent class). */ -// const AirportCode_T& getBoardPoint () const; - -// /** Get the off point (from the parent class). */ -// const AirportCode_T& getOffPoint () const; - -// /** Get the board date (from the parent class). */ -// const Date_T& getBoardDate () const; - -// /** Get the cabin code (from the parent class). */ -// const CabinCode_T& getCabinCode () const; - -// /** Get the board time (from the parent class). */ -// const Duration_T& getBoardTime () const; - -// /** Get the off date (from the parent class). */ -// const Date_T& getOffDate () const; - -// /** Get the off time (from the parent class). */ -// const Duration_T& getOffTime () const; - -// /** Get the elapsed time (from the parent class). */ -// const Duration_T& getElapsedTime() const; - -// /** Get the distance (from the parent class). */ -// const Distance_T& getDistance() const; - -// /** Get the date off set (from the parent class). */ -// const DateOffSet_T getDateOffSet () const; - -// /** Get the time off set between board and off points (from the -// parent class). */ -// const Duration_T getTimeOffSet() const; - -// /** Retrieve, if existing, theOnD corresponding to the -// given OnDKey. -// <br>If not existing, return the NULL pointer. */ -// OnD* getOnD (const OnDKey_T& iOnDKey) const; - -// /** Get the size of the OnD list. */ -// const unsigned int getOnDListSize () const { -// return _onDList.size(); -// } - -// /** Get the list of OnDs related to this class. */ -// const OnDList_T& getOnDList() const { -// return _onDList; -// } - public: - // ///////// Setters ////////// - /** Set the Fare family (parent class). */ -// void setFareFamily (FareFamily& ioFareFamily) { -// _fareFamily = &ioFareFamily; -// } - - /** Reset the number of bookings to its intial state. */ - //void reset (); - -// /** Reset the booking fare. */ -// void resetFare(); - -// /** Reset the booking yield. */ -// void resetYield(); - - public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ @@ -140,46 +59,6 @@ at the same level). */ const std::string describeShortKey() const; - /** Give a description of the structure (for display purposes). */ - //const std::string describe() const; - - /** Get a string describing the solution (Fare, MatchIndicator...). */ - //const std::string describeSolution() const; - - public: - // ///////// Business Methods ////////// - /** Update the number of bookings. */ -// bool updateInventoryForReservation (const NbOfBookings_T&); - -// /** Update the number of cancellations. */ -// bool updateInventoryForCancellation (const NbOfCancellations_T&); - -// /** Update the number of no-shows. */ -// bool updateInventoryForNoShow (const NbOfNoShows_T&); - - -// /** Update the revenue of the booking. */ -// bool updateRevenue (const NbOfBookings_T&, const Fare_T&, -// const AnalysisStatus_T&); - -// /** Add the current censorship flag into the flag list. */ -// void addCurrentCensorshipFlagToTheFlagList(); - -// /** Build the Class-Segment code (for example:B-NCE-BKK->BNCEBKK). */ -// const std::string buildClassSegmentCode() const; - -// /** Insert a new OnD reference. */ -// void addOnD (OnD&); - -// /** Calculate the ratio of booking for this booking only -// (without OnD bookings). */ -// const BookingRatio_T calculateNetProductRatio(); - - protected: - /** Update some statistics of the SegmentCabin parent object.*/ -// void updateParentStatistics (const Revenue_T&, -// const NbOfBookings_T&) const; - private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { @@ -202,11 +81,6 @@ /** Reference structure. */ BomStructure_T& _bookingClassStructure; - /** Parent class: FareFamily. */ -// FareFamily* _fareFamily; - -// /** List of OnD references related to this bookingClass. */ -// OnDList_T _onDList; }; } Modified: trunk/stdair/stdair/bom/BookingClassContent.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassContent.cpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/BookingClassContent.cpp 2010-02-03 14:09:48 UTC (rev 112) @@ -41,17 +41,22 @@ BookingClassContent::~BookingClassContent () { } - // ////////////////////////////////////////////////////////////////////// + // //////////////////////////////////////////////////////////////////// void BookingClassContent::setRemainingDemandMean(NbOfBookings_T& iMean) { _remainingDemandMean = iMean; _remainingProductDemandMean = iMean; } - // ////////////////////////////////////////////////////////////////////// + // //////////////////////////////////////////////////////////////////// void BookingClassContent::setRemainingDemandSD(NbOfBookings_T& iSD) { _remainingDemandSD = iSD; _remainingProductDemandSD = iSD; } + // //////////////////////////////////////////////////////////////////// + const AirlineCode_T BookingClassContent::getAirlineCode () const { + return _key.getAirlineCode(); + } + } Modified: trunk/stdair/stdair/bom/BookingClassContent.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassContent.hpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/BookingClassContent.hpp 2010-02-03 14:09:48 UTC (rev 112) @@ -142,6 +142,9 @@ return _remainingProductDemandSD; } + /** Get the airline code. */ + const AirlineCode_T getAirlineCode () const; + public: // /////////// Setters //////////// /** Set the booking limit. */ Modified: trunk/stdair/stdair/bom/BookingClassKey.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassKey.hpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/BookingClassKey.hpp 2010-02-03 14:09:48 UTC (rev 112) @@ -27,8 +27,15 @@ ~BookingClassKey_T (); // /////////// Getters ////////// - /** Get the cabin code. */ - const ClassCode_T& getClassCode () const; + /** Get the class code. */ + const ClassCode_T& getClassCode () const { + return _classCode; + } + + /** Get the airline code. */ + const AirlineCode_T getAirlineCode () const { + return _parentKey.getAirlineCode(); + } // /////////// Setters ///////////// void setParentKey (const ParentKey_T& iParentKey) { Modified: trunk/stdair/stdair/bom/BookingClassTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassTypes.hpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/BookingClassTypes.hpp 2010-02-03 14:09:48 UTC (rev 112) @@ -31,6 +31,10 @@ /** Define the booking class map. */ typedef BomMap_T<BookingClass> BookingClassMap_T; + + /** Define the STL list of booking classes. */ + typedef std::vector<BookingClass*> BookingClassSTLList_T; + } #endif // __STDAIR_BOM_BOOKINGCLASSTYPES_HPP Modified: trunk/stdair/stdair/bom/BookingRequestStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingRequestStruct.cpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/BookingRequestStruct.cpp 2010-02-03 14:09:48 UTC (rev 112) @@ -16,7 +16,10 @@ const AirportCode_T& iDestination, const Date_T& iDepartureDate, const PassengerType_T& iPaxType, - const NbOfSeats_T& iPartySize) { + const NbOfSeats_T& iPartySize) + : _origin (iOrigin), _destination (iDestination), + _departureDate (iDepartureDate), _paxType (iPaxType), + _partySize (iPartySize) { } // ////////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/Network.cpp =================================================================== --- trunk/stdair/stdair/bom/Network.cpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/Network.cpp 2010-02-03 14:09:48 UTC (rev 112) @@ -14,7 +14,7 @@ // //////////////////////////////////////////////////////////////////// Network::Network (const BomKey_T& iKey, - BomStructure_T& ioNetworkStructure) + BomStructure_T& ioNetworkStructure) : NetworkContent (iKey), _networkStructure (ioNetworkStructure) { } @@ -59,10 +59,26 @@ } // ////////////////////////////////////////////////////////////////////// - NetworkDate* Network:: - getNetworkDate (const NetworkDateKey_T& iKey) const { + NetworkDate* Network::getNetworkDate (const NetworkDateKey_T& iKey) const { return _networkStructure.getContentChild (iKey); } + // ////////////////////////////////////////////////////////////////////// + NetworkDate* Network::getNetworkDate (const Date_T& iDate) const { + NetworkDate* oNetworkDate_ptr = NULL; + + NetworkDateMap_T lNetworkDateMap = getNetworkDateMap (); + + std::ostringstream ostr; + ostr << iDate; + NetworkDateMap_T::iterator itNetworkDate = lNetworkDateMap.find (ostr.str()); + + if (itNetworkDate != lNetworkDateMap.end()) { + oNetworkDate_ptr = itNetworkDate->second; + } + + return oNetworkDate_ptr; + } + } Modified: trunk/stdair/stdair/bom/Network.hpp =================================================================== --- trunk/stdair/stdair/bom/Network.hpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/Network.hpp 2010-02-03 14:09:48 UTC (rev 112) @@ -72,9 +72,14 @@ NetworkDateMap_T getNetworkDateMap () const; /** Retrieve, if existing, the NetworkDate corresponding to the - given network number and network date (NetworkDate key). + given NetworkDate key. <br>If not existing, return the NULL pointer. */ NetworkDate* getNetworkDate (const NetworkDateKey_T&) const; + + /** Retrieve, if existing, the NetworkDate corresponding to the + given Date . + <br>If not existing, return the NULL pointer. */ + NetworkDate* getNetworkDate (const Date_T&) const; private: Modified: trunk/stdair/stdair/bom/NetworkDate.cpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.cpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/NetworkDate.cpp 2010-02-03 14:09:48 UTC (rev 112) @@ -14,7 +14,7 @@ // //////////////////////////////////////////////////////////////////// NetworkDate::NetworkDate (const BomKey_T& iKey, - BomStructure_T& ioNetworkDateStructure) + BomStructure_T& ioNetworkDateStructure) : NetworkDateContent (iKey), _networkDateStructure (ioNetworkDateStructure) { } @@ -63,6 +63,21 @@ getAirportDate (const AirportDateKey_T& iKey) const { return _networkDateStructure.getContentChild (iKey); } + + // ////////////////////////////////////////////////////////////////////// + AirportDate* NetworkDate::getAirportDate (const AirportCode_T& iCode) const { + AirportDate* oAirportDate_ptr = NULL; + + AirportDateMap_T lAirportDateMap = getAirportDateMap (); + + AirportDateMap_T::iterator itAirportDate = lAirportDateMap.find (iCode); + + if (itAirportDate != lAirportDateMap.end()) { + oAirportDate_ptr = itAirportDate->second; + } + + return oAirportDate_ptr; + } } Modified: trunk/stdair/stdair/bom/NetworkDate.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.hpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/NetworkDate.hpp 2010-02-03 14:09:48 UTC (rev 112) @@ -76,6 +76,11 @@ given airport-date key. <br>If not existing, return the NULL pointer. */ AirportDate* getAirportDate (const AirportDateKey_T&) const; + + /** Retrieve, if existing, the AirportDate corresponding to the + given airport-code. + <br>If not existing, return the NULL pointer. */ + AirportDate* getAirportDate (const AirportCode_T&) const; private: /** Retrieve the BOM structure object. */ Modified: trunk/stdair/stdair/bom/SegmentCabinKey.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabinKey.hpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/SegmentCabinKey.hpp 2010-02-03 14:09:48 UTC (rev 112) @@ -38,6 +38,11 @@ return _cabinCode; } + /** Get the airline code. */ + const AirlineCode_T getAirlineCode () const { + return _parentKey.getAirlineCode(); + } + // /////////// Setters ///////////// void setParentKey (const ParentKey_T& iParentKey) { _parentKey = iParentKey; Modified: trunk/stdair/stdair/bom/TravelSolutionStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.cpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.cpp 2010-02-03 14:09:48 UTC (rev 112) @@ -11,7 +11,38 @@ namespace stdair { + // //////////////////////////////////////////////////////////////////// + TravelSolutionStruct::TravelSolutionStruct () + : _outboundPath_ptr (NULL) { + assert (false); + } + + // //////////////////////////////////////////////////////////////////// + TravelSolutionStruct:: + TravelSolutionStruct (const TravelSolutionStruct& iTravelSolutionStruct) + : _outboundPath_ptr (iTravelSolutionStruct._outboundPath_ptr), + _bookingClassList (iTravelSolutionStruct._bookingClassList) { + } + + // //////////////////////////////////////////////////////////////////// + TravelSolutionStruct:: + TravelSolutionStruct (OutboundPath& ioOutboundPath, + const BookingClassSTLList_T& iBookingClassList) + : _outboundPath_ptr (&ioOutboundPath), + _bookingClassList (iBookingClassList) { + } + + // //////////////////////////////////////////////////////////////////// + TravelSolutionStruct::~TravelSolutionStruct () { + } + // ////////////////////////////////////////////////////////////////////// + OutboundPath& TravelSolutionStruct::getOutboundPath() const { + assert (_outboundPath_ptr != NULL); + return *_outboundPath_ptr; + } + + // ////////////////////////////////////////////////////////////////////// void TravelSolutionStruct::toStream (std::ostream& ioOut) const { ioOut << describe(); } Modified: trunk/stdair/stdair/bom/TravelSolutionStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-02-03 14:09:48 UTC (rev 112) @@ -7,15 +7,28 @@ // STL #include <iosfwd> #include <string> +#include <vector> // StdAir #include <stdair/bom/StructAbstract.hpp> +#include <stdair/bom/BookingClassTypes.hpp> namespace stdair { - + // Forward declarations + class OutboundPath; + /** Structure holding the elements of a travel solution. */ struct TravelSolutionStruct : public StructAbstract { public: - + // /////////// Getters /////////////// + /** Get the OutboundPath. */ + OutboundPath& getOutboundPath() const; + + /** Get the list of booking classes. */ + const BookingClassSTLList_T& getBookingClassList () const { + return _bookingClassList; + } + + public: // /////////// Display support method ///////////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ @@ -28,9 +41,25 @@ /** Display of the structure. */ const std::string describe() const; - + + // //////////// Constructors & Destructor /////////////// + public: + /** Main constructor. */ + TravelSolutionStruct (OutboundPath&, const BookingClassSTLList_T&); + /** Destructor. */ + ~TravelSolutionStruct (); + /** Default copy constructor. */ + TravelSolutionStruct (const TravelSolutionStruct&); + /** Default constructor, not to be used. */ + TravelSolutionStruct (); + private: + // Attributes + /** The outbound path associated to this solution.*/ + OutboundPath* _outboundPath_ptr; + /** The list of booking classes which make the travel solution. */ + BookingClassSTLList_T _bookingClassList; }; } Copied: trunk/stdair/stdair/bom/TravelSolutionTypes.hpp (from rev 111, trunk/stdair/stdair/bom/BookingClassTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/TravelSolutionTypes.hpp 2010-02-03 14:09:48 UTC (rev 112) @@ -0,0 +1,22 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_TRAVELSOLUTIONTYPES_HPP +#define __STDAIR_BOM_TRAVELSOLUTIONTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <map> +#include <vector> + +namespace stdair { + + // Forward declarations. + struct TravelSolutionStruct; + + /** Define the booking class list. */ + typedef std::vector<TravelSolutionStruct> TravelSolutionList_T; + +} +#endif // __STDAIR_BOM_TRAVELSOLUTIONTYPES_HPP + Modified: trunk/stdair/stdair/bom/sources.mk =================================================================== --- trunk/stdair/stdair/bom/sources.mk 2010-01-29 16:03:38 UTC (rev 111) +++ trunk/stdair/stdair/bom/sources.mk 2010-02-03 14:09:48 UTC (rev 112) @@ -83,6 +83,7 @@ $(top_srcdir)/stdair/bom/OptimizerStruct.hpp \ $(top_srcdir)/stdair/bom/DoWStruct.hpp \ $(top_srcdir)/stdair/bom/TravelSolutionStruct.hpp \ + $(top_srcdir)/stdair/bom/TravelSolutionTypes.hpp \ $(top_srcdir)/stdair/bom/BookingRequestStruct.hpp \ $(top_srcdir)/stdair/bom/BomManager.hpp bom_cc_sources = \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-02-03 15:11:12
|
Revision: 113 http://stdair.svn.sourceforge.net/stdair/?rev=113&view=rev Author: quannaus Date: 2010-02-03 15:11:00 +0000 (Wed, 03 Feb 2010) Log Message: ----------- [dev] Some small changes in the display. Modified Paths: -------------- trunk/stdair/stdair/bom/BookingClass.cpp trunk/stdair/stdair/bom/FlightDateKey.cpp Modified: trunk/stdair/stdair/bom/BookingClass.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.cpp 2010-02-03 14:09:48 UTC (rev 112) +++ trunk/stdair/stdair/bom/BookingClass.cpp 2010-02-03 15:11:00 UTC (rev 113) @@ -44,12 +44,12 @@ // ////////////////////////////////////////////////////////////////////// const std::string BookingClass::describeKey() const { - return _bookingClassStructure.describeKey(); + return _key.describe(); } // ////////////////////////////////////////////////////////////////////// const std::string BookingClass::describeShortKey() const { - return _bookingClassStructure.describeShortKey(); + return _key.toString(); } } Modified: trunk/stdair/stdair/bom/FlightDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateKey.cpp 2010-02-03 14:09:48 UTC (rev 112) +++ trunk/stdair/stdair/bom/FlightDateKey.cpp 2010-02-03 15:11:00 UTC (rev 113) @@ -34,7 +34,7 @@ // //////////////////////////////////////////////////////////////////// const std::string FlightDateKey_T::toString() const { std::ostringstream oStr; - oStr << _parentKey.toString() << _flightNumber << " " << _flightDate; + oStr << _flightNumber << ", " << _flightDate; return oStr.str(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-02-18 18:28:48
|
Revision: 157 http://stdair.svn.sourceforge.net/stdair/?rev=157&view=rev Author: denis_arnaud Date: 2010-02-18 18:28:42 +0000 (Thu, 18 Feb 2010) Log Message: ----------- [Dev] Added a few display methods (it may be improved easily). Modified Paths: -------------- trunk/stdair/stdair/bom/TravelSolutionStruct.cpp trunk/stdair/stdair/bom/TravelSolutionStruct.hpp Modified: trunk/stdair/stdair/bom/TravelSolutionStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.cpp 2010-02-18 16:49:09 UTC (rev 156) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.cpp 2010-02-18 18:28:42 UTC (rev 157) @@ -7,6 +7,7 @@ #include <ostream> #include <sstream> // StdAir +#include <stdair/bom/OutboundPath.hpp> #include <stdair/bom/TravelSolutionStruct.hpp> namespace stdair { @@ -53,7 +54,30 @@ // ////////////////////////////////////////////////////////////////////// const std::string TravelSolutionStruct::describe() const { - return ""; + std::ostringstream oStr; + if (_outboundPath_ptr != NULL) { + oStr << *_outboundPath_ptr; + } + + return oStr.str(); } + // ////////////////////////////////////////////////////////////////////// + const std::string TravelSolutionStruct::describeKey() const { + std::string oString; + if (_outboundPath_ptr != NULL) { + oString = _outboundPath_ptr->describeKey(); + } + return oString; + } + + // ////////////////////////////////////////////////////////////////////// + const std::string TravelSolutionStruct::describeShortKey() const { + std::string oString; + if (_outboundPath_ptr != NULL) { + oString = _outboundPath_ptr->describeShortKey(); + } + return oString; + } + } Modified: trunk/stdair/stdair/bom/TravelSolutionStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-02-18 16:49:09 UTC (rev 156) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-02-18 18:28:42 UTC (rev 157) @@ -42,6 +42,14 @@ /** Display of the structure. */ const std::string describe() const; + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const; + public: // //////////// Constructors & Destructor /////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-02-18 19:57:23
|
Revision: 158 http://stdair.svn.sourceforge.net/stdair/?rev=158&view=rev Author: denis_arnaud Date: 2010-02-18 19:57:17 +0000 (Thu, 18 Feb 2010) Log Message: ----------- [Dev] Just improved a little bit the pretty print function for the segment-dates. Modified Paths: -------------- trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/BomManager.hpp Modified: trunk/stdair/stdair/bom/BomManager.cpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.cpp 2010-02-18 18:28:42 UTC (rev 157) +++ trunk/stdair/stdair/bom/BomManager.cpp 2010-02-18 19:57:17 UTC (rev 158) @@ -115,21 +115,11 @@ csvBPVDisplay (oStream, iFlightDate); // Display the segment-cabins - // csvSegmentCabinDisplay (oStream, iFlightDate); + csvSegmentCabinDisplay (oStream, iFlightDate); // Display the booking classes // csvClassDisplay (oStream, iFlightDate); - // Browse the SegmentDate objects - const SegmentDateList_T& lSDList = iFlightDate.getSegmentDateList(); - for (SegmentDateList_T::iterator itSD = lSDList.begin(); - itSD != lSDList.end(); ++itSD) { - const SegmentDate& lCurrentSD = *itSD; - - // Call recursively the display() method on the children objects - display (oStream, lCurrentSD); - } - // Reset formatting flags of the given output stream oStream.flags (oldFlags); } @@ -266,24 +256,51 @@ } // ////////////////////////////////////////////////////////////////////// - void BomManager::display (std::ostream& oStream, - const SegmentDate& iSegmentDate) { + void BomManager::csvSegmentCabinDisplay (std::ostream& oStream, + const FlightDate& iFlightDate) { // Store current formatting flags of the given output stream std::ios::fmtflags oldFlags = oStream.flags(); - // Segment-date level - oStream << iSegmentDate.describeKey() << std::endl; + // Display the header + oStream << "******************************************" << std::endl; + oStream << "SegmentCabins:" << std::endl + << "--------------" << std::endl; + oStream << "Segment, Cabin, Dates, Times, Dist, SS, Rev, Fare, URev, RPK, " + << std::endl; - // Browse the SegmentCabin objects - const SegmentCabinList_T& lSCList = iSegmentDate.getSegmentCabinList(); - for (SegmentCabinList_T::iterator itSC = lSCList.begin(); - itSC != lSCList.end(); ++itSC) { - const SegmentCabin& lCurrentSC = *itSC; + // Browse the SegmentDate objects + const SegmentDateList_T& lSDList = iFlightDate.getSegmentDateList(); + for (SegmentDateList_T::iterator itSD = lSDList.begin(); + itSD != lSDList.end(); ++itSD) { + const SegmentDate& lCurrentSD = *itSD; + + // Browse the SegmentCabin objects + const SegmentCabinList_T& lSCList = lCurrentSD.getSegmentCabinList(); + for (SegmentCabinList_T::iterator itSC = lSCList.begin(); + itSC != lSCList.end(); ++itSC) { + const SegmentCabin& lCurrentSC = *itSC; + + oStream << lCurrentSD.getBoardingPoint() << "-" + << lCurrentSD.getOffPoint() << ", " + << lCurrentSC.getCabinCode() << ", " + << lCurrentSD.getBoardingDate() << " -> " + << lCurrentSD.getOffDate() << " / " + << lCurrentSD.getDateOffSet() << ", " + << lCurrentSD.getBoardingTime() << " -> " + << lCurrentSD.getOffTime() << " (" + << lCurrentSD.getTimeOffSet() << ") / " + << lCurrentSD.getElapsedTime() << ", " + << lCurrentSD.getDistance() << ", " + << lCurrentSD.getBookingCounter() << ", " + << lCurrentSD.getRevenue() << ", " + << lCurrentSD.getAverageFare() << ", " + << lCurrentSD.getUnitRevenue() << ", " + << lCurrentSD.getRPK() << ", " + << std::endl; + } + } + oStream << "******************************************" << std::endl; - // Call recursively the display() method on the children objects - display (oStream, lCurrentSC); - } - // Reset formatting flags of the given output stream oStream.flags (oldFlags); } Modified: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp 2010-02-18 18:28:42 UTC (rev 157) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-02-18 19:57:17 UTC (rev 158) @@ -76,7 +76,7 @@ @param std::ostream& Output stream in which the BOM tree should be logged/dumped. @param const SegmentDate& Root of the BOM tree to be displayed. */ - static void display (std::ostream&, const SegmentDate&); + static void csvSegmentCabinDisplay (std::ostream&, const FlightDate&); /** Recursively display (dump in the underlying output log stream) the objects of the given BOM tree. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-04-09 15:31:44
|
Revision: 173 http://stdair.svn.sourceforge.net/stdair/?rev=173&view=rev Author: quannaus Date: 2010-04-09 15:31:37 +0000 (Fri, 09 Apr 2010) Log Message: ----------- [Dev] Added some attributes for test. Modified Paths: -------------- trunk/stdair/stdair/bom/BookingClassContent.hpp trunk/stdair/stdair/bom/BucketContent.cpp trunk/stdair/stdair/bom/BucketContent.hpp trunk/stdair/stdair/bom/BucketKey.cpp trunk/stdair/stdair/bom/BucketKey.hpp trunk/stdair/stdair/bom/LegCabinContent.hpp trunk/stdair/stdair/bom/sources.mk Modified: trunk/stdair/stdair/bom/BookingClassContent.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassContent.hpp 2010-04-09 15:07:22 UTC (rev 172) +++ trunk/stdair/stdair/bom/BookingClassContent.hpp 2010-04-09 15:31:37 UTC (rev 173) @@ -248,6 +248,22 @@ /** Destructor. */ virtual ~BookingClassContent(); + public: + // for AIRINV Test + stdair::SubclassCode_T _subclassCode; + stdair::AuthorizationLevel_T _cumulatedProtection; + stdair::AuthorizationLevel_T _protection; + stdair::OverbookingRate_T _noShowPercentage; + stdair::OverbookingRate_T _overbookingPercentage; + stdair::NbOfBookings_T _groupNbOfBookings; + stdair::NbOfBookings_T _groupPendingNbOfBookings; + stdair::NbOfBookings_T _staffNbOfBookings; + stdair::NbOfBookings_T _wlNbOfBookings; + stdair::NbOfBookings_T _etb; + stdair::Availability_T _netClassAvailability; + stdair::Availability_T _segmentAvailability; + stdair::Availability_T _netRevenueAvailability; + protected: // Attributes /** The key of both structure and content objects. */ Modified: trunk/stdair/stdair/bom/BucketContent.cpp =================================================================== --- trunk/stdair/stdair/bom/BucketContent.cpp 2010-04-09 15:07:22 UTC (rev 172) +++ trunk/stdair/stdair/bom/BucketContent.cpp 2010-04-09 15:31:37 UTC (rev 173) @@ -12,46 +12,12 @@ // //////////////////////////////////////////////////////////////////// BucketContent::BucketContent (const BomKey_T& iKey) - : _key (iKey), - _nbOfBookings (DEFAULT_CLASS_NB_OF_BOOKINGS), - _totalNbOfBookings (DEFAULT_CLASS_TOTAL_NB_OF_BOOKINGS), - _lastDCPTotalNbOfBookings (DEFAULT_CLASS_TOTAL_NB_OF_BOOKINGS), - _unconstrainedDemand (DEFAULT_CLASS_UNCONSTRAINED_DEMAND), - _nbOfCancellations (DEFAULT_CLASS_NB_OF_CANCELLATIONS), - _nbOfNoShows (DEFAULT_CLASS_NB_OF_NOSHOWS), - _availability (DEFAULT_CLASS_AVAILABILITY), - _classRevenue (DEFAULT_REVENUE_VALUE), - _currentCensorshipFlag (DEFAULT_CLASS_CENSORSHIPFLAG), - _censorshipFlagList (DEFAULT_CLASS_CENSORSHIPFLAG_LIST), - _bookingLimit (DEFAULT_CLASS_BOOKING_LIMIT), - _authorizationLevel(DEFAULT_CLASS_AUTHORIZATION_LEVEL), - _MAX (DEFAULT_CLASS_MAX_AUTHORIZATION_LEVEL), - _MIN (DEFAULT_CLASS_MIN_AUTHORIZATION_LEVEL), - _overbookingRate (1 + DEFAULT_CLASS_OVERBOOKING_RATE), - _fare (DEFAULT_CLASS_FARE_VALUE), - _adjustedYield (DEFAULT_YIELD_VALUE), - _yield (DEFAULT_YIELD_VALUE), - _remainingDemandMean (DEFAULT_CLASS_REMAINING_DEMAND_MEAN), - _remainingProductDemandMean (DEFAULT_CLASS_REMAINING_DEMAND_MEAN), - _remainingDemandSD (DEFAULT_CLASS_REMAINING_DEMAND_STANDARD_DEVIATION), - _remainingProductDemandSD (DEFAULT_CLASS_REMAINING_DEMAND_STANDARD_DEVIATION) { + : _key (iKey) { } // //////////////////////////////////////////////////////////////////// BucketContent::~BucketContent () { } - // //////////////////////////////////////////////////////////////////// - void BucketContent::setRemainingDemandMean(NbOfBookings_T& iMean) { - _remainingDemandMean = iMean; - _remainingProductDemandMean = iMean; - } - - // //////////////////////////////////////////////////////////////////// - void BucketContent::setRemainingDemandSD(NbOfBookings_T& iSD) { - _remainingDemandSD = iSD; - _remainingProductDemandSD = iSD; - } - } Modified: trunk/stdair/stdair/bom/BucketContent.hpp =================================================================== --- trunk/stdair/stdair/bom/BucketContent.hpp 2010-04-09 15:07:22 UTC (rev 172) +++ trunk/stdair/stdair/bom/BucketContent.hpp 2010-04-09 15:31:37 UTC (rev 173) @@ -23,199 +23,8 @@ const BomKey_T& getKey() const { return _key; } - - /** Get the booking code (part of the primary key). */ - const ClassCode_T& getClassCode() const { - return _key.getClassCode(); - } - /** Get the number of bookings of the bookingClass. */ - const NbOfBookings_T& getNbOfBookings() const { - return _nbOfBookings; - } - - /** Get the number of bookings (without cancellation counted) - of the bookingClass. */ - const NbOfBookings_T& getTotalNbOfBookings() const { - return _totalNbOfBookings; - } - - /** Get the number of bookings at the last DCP(without - cancellation counted) of the bookingClass. */ - const NbOfBookings_T& getLastDCPTotalNbOfBookings() const { - return _lastDCPTotalNbOfBookings; - } - - /** Get the unconstrained demand (last DCP) of the bookingClass. */ - const NbOfBookings_T& getUnconstrainedDemand () const { - return _unconstrainedDemand; - } - - /** Get the number of cancellations of the bookingClass. */ - const NbOfCancellations_T& getNbOfCancellations() const { - return _nbOfCancellations; - } - - /** Get the number of no-shows of the bookingClass. */ - const NbOfNoShows_T& getNbOfNoShows() const { - return _nbOfNoShows; - } - - /** Get the overbooking rate dedicated to the booking. */ - const OverbookingRate_T& getOverbookingRate() const { - return _overbookingRate; - } - - /** Get the list of censorship flags. */ - const CensorshipFlagList_T& getCensorshipFlagList() const { - return _censorshipFlagList; - } - - /** Get the current censorship flag. */ - const CensorshipFlag_T& getCurrentCensorshipFlag() const { - return _currentCensorshipFlag; - } - - /** Get the protection value. */ - const BookingLimit_T& getBookingLimit() const { - return _bookingLimit; - } - - /** Get the authorisation level value. */ - const AuthorizationLevel_T& getAuthorizationLevel () const { - return _authorizationLevel; - } - - /** Get the MAX value of AU. */ - const AuthorizationLevel_T& getMAX () const { - return _MAX; - } - - /** Get the MIN value of AU. */ - const AuthorizationLevel_T& getMIN () const { - return _MIN; - } - - /** Get the availability number. */ - const Availability_T& getAvailability() const { - return _availability; - } - - /** Get the revenue amount. */ - const Revenue_T& getRevenue() const { - return _classRevenue; - } - - /** Get the fare current value. */ - const Fare_T& getFare() const { - return _fare; - } - - /** Get the adjusted yield current value. */ - const Yield_T& getAdjustedYield() const { - return _adjustedYield; - } - - /** Get the yield current value. */ - const Yield_T& getYield() const { - return _yield; - } - - /** Get the remaining demand mean. */ - const NbOfBookings_T& getRemainingDemandMean() const { - return _remainingDemandMean; - } - - /** Get the remaining demand mean for the net booking product. */ - const NbOfBookings_T& getRemainingProductDemandMean() const { - return _remainingProductDemandMean; - } - - /** Get the remaining demand standard deviation. */ - const NbOfBookings_T& getRemainingDemandSD() const { - return _remainingDemandSD; - } - - /** Get the remaining demand standard deviation - for the net booking product. */ - const NbOfBookings_T& getRemainingProductDemandSD() const { - return _remainingProductDemandSD; - } - public: - // /////////// Setters //////////// - /** Set the booking limit. */ - void setBookingLimit (BookingLimit_T& iBookingLimit) { - _bookingLimit = iBookingLimit; - } - - /** Set the authorization level. */ - void setAuthorizationLevel (AuthorizationLevel_T& iAuthorizationLevel) { - _authorizationLevel = iAuthorizationLevel; - } - - /** Set the MAX value of AU. */ - void setMAX (const AuthorizationLevel_T& iMAX) { - _MAX = iMAX; - } - - /** Set the MIN value of AU. */ - void setMIN (const AuthorizationLevel_T& iMIN) { - _MIN = iMIN; - } - - /** Set the Availability number. */ - void setAvailability (Availability_T& iAvailability) { - _availability = iAvailability; - } - - /** Set the censorship flag status. */ - void setCensorshipFlagStatus (bool iFlagStatus) { - _currentCensorshipFlag = iFlagStatus; - } - - /** Set the fare value. */ - void setFare(Fare_T& iFare) { - _fare = iFare; - } - - /** Set the adjusted fare value. */ - void setAdjustedYield(Yield_T& iYield) { - _adjustedYield = iYield; - } - - /** Set the yield value. */ - void setYield(Yield_T& iYield) { - _yield = iYield; - } - - /** Set the unconstrained demand. */ - void setUnconstrainedDemand (NbOfBookings_T& iDemand) { - _unconstrainedDemand = iDemand; - } - - /** Set the total bookings for the DCP. */ - void setDCPTotalNbOfBookings (NbOfBookings_T& iBookings) { - _lastDCPTotalNbOfBookings = iBookings; - } - - /** Set the remaining demand mean. */ - void setRemainingDemandMean (NbOfBookings_T&); - - /** Set the remaining demand mean for the net booking product. */ - void setRemainingProductDemandMean (NbOfBookings_T& iMean) { - _remainingProductDemandMean = iMean; - } - - /** Set the remaining demand standard deviation. */ - void setRemainingDemandSD (NbOfBookings_T&); - - /** Set the remaining demand standard deviation. */ - void setRemainingProductDemandSD (NbOfBookings_T& iSD) { - _remainingProductDemandSD = iSD; - } - - public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ @@ -245,83 +54,16 @@ /** Destructor. */ virtual ~BucketContent(); - protected: + public: // Attributes /** The key of both structure and content objects. */ BomKey_T _key; - - /** Number of current bookings in the booking. */ - NbOfBookings_T _nbOfBookings; + // test AIRINV + stdair::Yield_T _yieldRangeUpperValue; + stdair::CabinCapacity_T _availability; + stdair::NbOfSeats_T _nbOfSeats; + stdair::SeatIndex_T _seatIndex; - /** Total number of bookings (without substraction of cancellation). */ - NbOfBookings_T _totalNbOfBookings; - - /** Total number of bookings at the last DCP (without - substraction of cancellation). */ - NbOfBookings_T _lastDCPTotalNbOfBookings; - - /** Unconstraining demnd value (last RMS Computation).*/ - NbOfBookings_T _unconstrainedDemand; - - /** Number of cancelled demands. */ - NbOfCancellations_T _nbOfCancellations; - - /** Number of no-shows. */ - NbOfNoShows_T _nbOfNoShows; - - /** Number of available seats. */ - Availability_T _availability; - - /** Total Revenue of the booking. */ - Revenue_T _classRevenue; - - /** Current Censorship flag which indicates whether the demand - is censored. */ - CensorshipFlag_T _currentCensorshipFlag; - - /** List of censorship flags which indicates whether the demand - is censored (one flag per DCP). */ - CensorshipFlagList_T _censorshipFlagList; - - /** Value of the booking limit of the booking. */ - BookingLimit_T _bookingLimit; - - /** Value of the authorization level of the booking. */ - AuthorizationLevel_T _authorizationLevel; - - /** MAX of Authorization Level (AU). */ - AuthorizationLevel_T _MAX; - - /** MIN of Authorization Level (AU). */ - AuthorizationLevel_T _MIN; - - /** Rate of allowed overbooking. */ - OverbookingRate_T _overbookingRate; - - /** Current Fare value of the booking. */ - Fare_T _fare; - - /** Current Adjusted Fare value of the booking. */ - Yield_T _adjustedYield; - - /** Current Yield value of the booking. */ - Yield_T _yield; - - /** Temporary attributes just for the forecaster prototype. */ - /** Remaining demand mean for the whole booking. */ - NbOfBookings_T _remainingDemandMean; - - /** Remaining demand mean for the product corresponding to this booking - (excluding (OnDs)). */ - NbOfBookings_T _remainingProductDemandMean; - - /** Remaining demand standrad deviation for the whole booking. */ - NbOfBookings_T _remainingDemandSD; - - /** Remaining demand standard deviation for the product - corresponding to this booking (excluding (OnDs)). */ - NbOfBookings_T _remainingProductDemandSD; - }; } Modified: trunk/stdair/stdair/bom/BucketKey.cpp =================================================================== --- trunk/stdair/stdair/bom/BucketKey.cpp 2010-04-09 15:07:22 UTC (rev 172) +++ trunk/stdair/stdair/bom/BucketKey.cpp 2010-04-09 15:31:37 UTC (rev 173) @@ -7,8 +7,7 @@ namespace stdair { // //////////////////////////////////////////////////////////////////// - BucketKey_T::BucketKey_T (const ClassCode_T& iClassCode) - : _classCode (iClassCode) { + BucketKey_T::BucketKey_T () { } // //////////////////////////////////////////////////////////////////// @@ -27,7 +26,6 @@ // //////////////////////////////////////////////////////////////////// const std::string BucketKey_T::toString() const { std::ostringstream oStr; - oStr << _classCode; return oStr.str(); } Modified: trunk/stdair/stdair/bom/BucketKey.hpp =================================================================== --- trunk/stdair/stdair/bom/BucketKey.hpp 2010-04-09 15:07:22 UTC (rev 172) +++ trunk/stdair/stdair/bom/BucketKey.hpp 2010-04-09 15:31:37 UTC (rev 173) @@ -21,16 +21,11 @@ public: // /////////// Construction /////////// /** Constructor. */ - BucketKey_T (const ClassCode_T& iClassCode); + BucketKey_T (); /** Destructor. */ ~BucketKey_T (); - // /////////// Getters ////////// - /** Get the class code. */ - const ClassCode_T& getClassCode () const { - return _classCode; - } // /////////// Setters ///////////// void setParentKey (const ParentKey_T& iParentKey) { @@ -60,9 +55,6 @@ // Attributes /** Leg-cabin key.*/ ParentKey_T _parentKey; - - /** Cabin code. */ - ClassCode_T _classCode; }; } Modified: trunk/stdair/stdair/bom/LegCabinContent.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabinContent.hpp 2010-04-09 15:07:22 UTC (rev 172) +++ trunk/stdair/stdair/bom/LegCabinContent.hpp 2010-04-09 15:31:37 UTC (rev 173) @@ -120,6 +120,21 @@ /** Destructor. */ virtual ~LegCabinContent(); + public: + // Test AIRINV + stdair::CapacityAdjustment_T _adjustment; + stdair::CapacityAdjustment_T _dcsRegrade; + stdair::AuthorizationLevel_T _au; + stdair::UPR_T _upr; + stdair::NbOfBookings_T _nbOfBookings; + stdair::Availability_T _nav; + stdair::Availability_T _gav; + stdair::OverbookingRate_T _acp; + stdair::NbOfBookings_T _etb; + stdair::NbOfBookings_T _staffNbOfBookings; + stdair::NbOfBookings_T _wlNbOfBookings; + stdair::NbOfBookings_T _groupNbOfBookings; + protected: // Attributes /** The key of both structure and content objects. */ Modified: trunk/stdair/stdair/bom/sources.mk =================================================================== --- trunk/stdair/stdair/bom/sources.mk 2010-04-09 15:07:22 UTC (rev 172) +++ trunk/stdair/stdair/bom/sources.mk 2010-04-09 15:31:37 UTC (rev 173) @@ -125,7 +125,6 @@ $(top_srcdir)/stdair/bom/SegmentCabinKey.cpp \ $(top_srcdir)/stdair/bom/BookingClassKey.cpp \ $(top_srcdir)/stdair/bom/BucketKey.cpp \ - $(top_srcdir)/stdair/bom/BucketKey.cpp \ $(top_srcdir)/stdair/bom/NetworkKey.cpp \ $(top_srcdir)/stdair/bom/NetworkDateKey.cpp \ $(top_srcdir)/stdair/bom/AirportDateKey.cpp \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-04-22 12:08:46
|
Revision: 178 http://stdair.svn.sourceforge.net/stdair/?rev=178&view=rev Author: quannaus Date: 2010-04-22 12:08:40 +0000 (Thu, 22 Apr 2010) Log Message: ----------- [dev] Init all the pointers to children holder to NULL. Modified Paths: -------------- trunk/stdair/stdair/bom/AirlineFeature.cpp trunk/stdair/stdair/bom/AirlineFeature.hpp trunk/stdair/stdair/bom/AirportDate.cpp trunk/stdair/stdair/bom/AirportDate.hpp trunk/stdair/stdair/bom/BomRoot.cpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/BookingClass.cpp trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/Bucket.cpp trunk/stdair/stdair/bom/Bucket.hpp trunk/stdair/stdair/bom/DemandStream.cpp trunk/stdair/stdair/bom/DemandStream.hpp trunk/stdair/stdair/bom/FlightDate.cpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/LegCabin.cpp trunk/stdair/stdair/bom/LegCabin.hpp trunk/stdair/stdair/bom/LegDate.cpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/Network.cpp trunk/stdair/stdair/bom/Network.hpp trunk/stdair/stdair/bom/NetworkDate.cpp trunk/stdair/stdair/bom/NetworkDate.hpp trunk/stdair/stdair/bom/OutboundPath.cpp trunk/stdair/stdair/bom/OutboundPath.hpp trunk/stdair/stdair/bom/SegmentCabin.cpp trunk/stdair/stdair/bom/SegmentCabin.hpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentDate.hpp trunk/stdair/stdair/bom/Structure.hpp trunk/stdair/stdair/bom/YieldStore.cpp trunk/stdair/stdair/bom/YieldStore.hpp Modified: trunk/stdair/stdair/bom/AirlineFeature.cpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -24,6 +24,10 @@ } // //////////////////////////////////////////////////////////////////// + void AirlineFeature::init () { + } + + // //////////////////////////////////////////////////////////////////// void AirlineFeature:: init (const ForecasterMode_T& iForecastMode, const HistoricalDataLimit_T& iHistoricalDataLimit, Modified: trunk/stdair/stdair/bom/AirlineFeature.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -63,12 +63,15 @@ // ///////////////// Constructors and destructors ///////////////// /** Constructors are private so as to force the usage of the Factory layer. */ + /** Constructors. */ + AirlineFeature (const Key_T&, Structure_T&); + /** Destructor. */ + ~AirlineFeature(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ AirlineFeature (); AirlineFeature (const AirlineFeature&); - AirlineFeature (const Key_T&, Structure_T&); - /** Destructor. */ - virtual ~AirlineFeature(); protected: Modified: trunk/stdair/stdair/bom/AirportDate.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/AirportDate.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -20,6 +20,11 @@ } // //////////////////////////////////////////////////////////////////// + void AirportDate::init () { + _structure.initChildrenHolder<OutboundPath>(); + } + + // //////////////////////////////////////////////////////////////////// void AirportDate::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/AirportDate.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/AirportDate.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -76,7 +76,9 @@ /** Constructors. */ AirportDate (const Key_T&, Structure_T&); /** Destructor. */ - virtual ~AirportDate(); + ~AirportDate(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ AirportDate (); AirportDate (const AirportDate&); Modified: trunk/stdair/stdair/bom/BomRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/BomRoot.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -11,6 +11,7 @@ // //////////////////////////////////////////////////////////////////// BomRoot::BomRoot (const Key_T& iKey, Structure_T& ioBomRootStructure) : BomRootContent (iKey), _structure (ioBomRootStructure) { + init(); } // //////////////////////////////////////////////////////////////////// @@ -18,6 +19,15 @@ } // //////////////////////////////////////////////////////////////////// + void BomRoot::init() { + _structure.initChildrenHolder<Inventory>(); + _structure.initChildrenHolder<Network>(); + _structure.initChildrenHolder<AirlineFeature>(); + _structure.initChildrenHolder<DemandStream>(); + _structure.initChildrenHolder<YieldStore>(); + } + + // //////////////////////////////////////////////////////////////////// InventoryList_T BomRoot::getInventoryList () const { return _structure.getChildrenHolder<Inventory>(); } Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -115,6 +115,8 @@ BomRoot (const Key_T&, Structure_T&); /** Destructor. */ ~BomRoot(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ BomRoot (); BomRoot (const BomRoot&); Modified: trunk/stdair/stdair/bom/BookingClass.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/BookingClass.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -20,6 +20,10 @@ } // //////////////////////////////////////////////////////////////////// + void BookingClass::init () { + } + + // //////////////////////////////////////////////////////////////////// void BookingClass::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/BookingClass.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/BookingClass.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -60,7 +60,9 @@ /** Constructors. */ BookingClass (const Key_T&, Structure_T&); /** Destructor. */ - virtual ~BookingClass(); + ~BookingClass(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ BookingClass (); BookingClass (const BookingClass&); Modified: trunk/stdair/stdair/bom/Bucket.cpp =================================================================== --- trunk/stdair/stdair/bom/Bucket.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/Bucket.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -16,6 +16,10 @@ // //////////////////////////////////////////////////////////////////// Bucket::~Bucket () { } + + // //////////////////////////////////////////////////////////////////// + void Bucket::init () { + } // //////////////////////////////////////////////////////////////////// const std::string Bucket::describeKey() const { Modified: trunk/stdair/stdair/bom/Bucket.hpp =================================================================== --- trunk/stdair/stdair/bom/Bucket.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/Bucket.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -55,7 +55,9 @@ /** Constructors. */ Bucket (const Key_T& iKey, Structure_T& ioStructure); /** Destructor. */ - ~Bucket(); + ~Bucket(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ Bucket (); Bucket (const Bucket&); Modified: trunk/stdair/stdair/bom/DemandStream.cpp =================================================================== --- trunk/stdair/stdair/bom/DemandStream.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/DemandStream.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -41,4 +41,9 @@ // //////////////////////////////////////////////////////////////////// DemandStream::~DemandStream () { } + + // //////////////////////////////////////////////////////////////////// + void DemandStream::init () { + } + } Modified: trunk/stdair/stdair/bom/DemandStream.hpp =================================================================== --- trunk/stdair/stdair/bom/DemandStream.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/DemandStream.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -67,11 +67,13 @@ const RandomSeed_T& iRequestDateTimeSeed, const RandomSeed_T& iDemandCharacteristicsSeed, Structure_T&); + /** Destructor. */ + ~DemandStream (); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ DemandStream (); DemandStream (const DemandStream&); - /** Destructor. */ - ~DemandStream (); protected: Modified: trunk/stdair/stdair/bom/FlightDate.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/FlightDate.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -21,6 +21,12 @@ } // //////////////////////////////////////////////////////////////////// + void FlightDate::init() { + _structure.initChildrenHolder<SegmentDate>(); + _structure.initChildrenHolder<LegDate>(); + } + + // //////////////////////////////////////////////////////////////////// void FlightDate::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -84,6 +84,8 @@ FlightDate (const Key_T&, Structure_T&); /** Destructor. */ ~FlightDate(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ FlightDate (); FlightDate (const FlightDate&); Modified: trunk/stdair/stdair/bom/Inventory.cpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/Inventory.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -19,6 +19,11 @@ } // //////////////////////////////////////////////////////////////////// + void Inventory::init () { + _structure.initChildrenHolder<FlightDate> (); + } + + // //////////////////////////////////////////////////////////////////// void Inventory::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/Inventory.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -86,6 +86,8 @@ Inventory (const Key_T&, Structure_T&); /** Destructor. */ ~Inventory(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ Inventory (); Inventory (const Inventory&); Modified: trunk/stdair/stdair/bom/LegCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/LegCabin.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/LegCabin.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -18,6 +18,12 @@ } // //////////////////////////////////////////////////////////////////// + void LegCabin::init () { + _structure.initChildrenHolder<Bucket> (); + _structure.initChildrenHolder<SegmentCabin> (); + } + + // //////////////////////////////////////////////////////////////////// void LegCabin::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/LegCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabin.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/LegCabin.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -68,7 +68,9 @@ /** Constructors. */ LegCabin (const Key_T& iKey, Structure_T&); /** Destructor. */ - virtual ~LegCabin(); + ~LegCabin(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ LegCabin (); LegCabin (const LegCabin&); Modified: trunk/stdair/stdair/bom/LegDate.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/LegDate.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -18,6 +18,12 @@ } // //////////////////////////////////////////////////////////////////// + void LegDate::init () { + _structure.initChildrenHolder<LegCabin> (); + _structure.initChildrenHolder<SegmentDate> (); + } + + // //////////////////////////////////////////////////////////////////// void LegDate::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/LegDate.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -75,6 +75,8 @@ LegDate (const Key_T&, Structure_T&); /** Destructor. */ ~LegDate(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ LegDate (); LegDate (const LegDate&); Modified: trunk/stdair/stdair/bom/Network.cpp =================================================================== --- trunk/stdair/stdair/bom/Network.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/Network.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -19,6 +19,11 @@ } // //////////////////////////////////////////////////////////////////// + void Network::init () { + _structure.initChildrenHolder<NetworkDate>(); + } + + // //////////////////////////////////////////////////////////////////// void Network::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/Network.hpp =================================================================== --- trunk/stdair/stdair/bom/Network.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/Network.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -71,7 +71,9 @@ /** Constructors. */ Network (const Key_T&, Structure_T&); /** Destructor. */ - virtual ~Network(); + ~Network(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ Network (); Network (const Network&); Modified: trunk/stdair/stdair/bom/NetworkDate.cpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/NetworkDate.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -19,6 +19,11 @@ } // //////////////////////////////////////////////////////////////////// + void NetworkDate::init () { + _structure.initChildrenHolder<AirportDate>(); + } + + // //////////////////////////////////////////////////////////////////// void NetworkDate::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/NetworkDate.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/NetworkDate.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -71,7 +71,9 @@ /** Constructors. */ NetworkDate (const Key_T&, Structure_T&); /** Destructor. */ - virtual ~NetworkDate(); + ~NetworkDate(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ NetworkDate (); NetworkDate (const NetworkDate&); Modified: trunk/stdair/stdair/bom/OutboundPath.cpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPath.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/OutboundPath.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -20,6 +20,11 @@ } // //////////////////////////////////////////////////////////////////// + void OutboundPath::init () { + _structure.initChildrenHolder<SegmentDate>(); + } + + // //////////////////////////////////////////////////////////////////// void OutboundPath::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/OutboundPath.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPath.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/OutboundPath.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -131,6 +131,8 @@ OutboundPath (const Key_T&, Structure_T&); /** Destructor. */ ~OutboundPath(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ OutboundPath (); OutboundPath (const OutboundPath&); Modified: trunk/stdair/stdair/bom/SegmentCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -19,6 +19,12 @@ } // //////////////////////////////////////////////////////////////////// + void SegmentCabin::init () { + _structure.initChildrenHolder<BookingClass> (); + _structure.initChildrenHolder<LegCabin> (); + } + + // //////////////////////////////////////////////////////////////////// void SegmentCabin::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/SegmentCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -70,6 +70,8 @@ SegmentCabin (const Key_T&, Structure_T&); /** Destructor. */ ~SegmentCabin(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ SegmentCabin (); SegmentCabin (const SegmentCabin&); Modified: trunk/stdair/stdair/bom/SegmentDate.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/SegmentDate.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -20,6 +20,12 @@ } // //////////////////////////////////////////////////////////////////// + void SegmentDate::init () { + _structure.initChildrenHolder<SegmentCabin>(); + _structure.initChildrenHolder<LegDate>(); + } + + // //////////////////////////////////////////////////////////////////// void SegmentDate::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } Modified: trunk/stdair/stdair/bom/SegmentDate.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/SegmentDate.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -87,6 +87,8 @@ SegmentDate (const Key_T&, Structure_T&); /** Destructor. */ ~SegmentDate(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ SegmentDate (); SegmentDate (const SegmentDate&); Modified: trunk/stdair/stdair/bom/Structure.hpp =================================================================== --- trunk/stdair/stdair/bom/Structure.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/Structure.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -108,6 +108,15 @@ return *lChild_ptr; } + // /////////// Business method //////////// + /** Initialise the pointer of children holder to NULL. */ + template <typename CHILD> + void initChildrenHolder() { + BomChildrenHolderImp<CHILD>*& lHolder_ptr = + boost::fusion::at_key<CHILD> (_holderMap); + lHolder_ptr = NULL; + } + public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. Modified: trunk/stdair/stdair/bom/YieldStore.cpp =================================================================== --- trunk/stdair/stdair/bom/YieldStore.cpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/YieldStore.cpp 2010-04-22 12:08:40 UTC (rev 178) @@ -20,4 +20,8 @@ YieldStore::~YieldStore () { } + // //////////////////////////////////////////////////////////////////// + void YieldStore::init () { + } + } Modified: trunk/stdair/stdair/bom/YieldStore.hpp =================================================================== --- trunk/stdair/stdair/bom/YieldStore.hpp 2010-04-22 11:03:11 UTC (rev 177) +++ trunk/stdair/stdair/bom/YieldStore.hpp 2010-04-22 12:08:40 UTC (rev 178) @@ -54,12 +54,15 @@ protected: /** Constructors are private so as to force the usage of the Factory layer. */ + /** Constructors. */ + YieldStore (const Key_T& iKey, Structure_T& ioStructure); + /** Destructor. */ + ~YieldStore(); + /** Initialise all the pointers of children holder to NULL. */ + void init(); /** Default constructors. */ YieldStore (); YieldStore (const YieldStore&); - YieldStore (const Key_T& iKey, Structure_T& ioStructure); - /** Destructor. */ - virtual ~YieldStore(); private: // Attributes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-04-22 12:17:48
|
Revision: 179 http://stdair.svn.sourceforge.net/stdair/?rev=179&view=rev Author: quannaus Date: 2010-04-22 12:17:42 +0000 (Thu, 22 Apr 2010) Log Message: ----------- [dev] Initialise all the pointers to children holder to NULL. Modified Paths: -------------- trunk/stdair/stdair/bom/AirlineFeature.cpp trunk/stdair/stdair/bom/AirportDate.cpp trunk/stdair/stdair/bom/BookingClass.cpp trunk/stdair/stdair/bom/Bucket.cpp trunk/stdair/stdair/bom/DemandStream.cpp trunk/stdair/stdair/bom/FlightDate.cpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/LegCabin.cpp trunk/stdair/stdair/bom/LegDate.cpp trunk/stdair/stdair/bom/Network.cpp trunk/stdair/stdair/bom/NetworkDate.cpp trunk/stdair/stdair/bom/OutboundPath.cpp trunk/stdair/stdair/bom/SegmentCabin.cpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/YieldStore.cpp Modified: trunk/stdair/stdair/bom/AirlineFeature.cpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -17,6 +17,7 @@ Structure_T& ioAirlineFeatureStructure) : AirlineFeatureContent (iKey), _structure (ioAirlineFeatureStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/AirportDate.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/AirportDate.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -13,6 +13,7 @@ AirportDate::AirportDate (const Key_T& iKey, Structure_T& ioAirportStructure) : AirportDateContent (iKey), _structure (ioAirportStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/BookingClass.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/BookingClass.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -13,6 +13,7 @@ Structure_T& ioBookingClassStructure) : BookingClassContent (iKey), _structure (ioBookingClassStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/Bucket.cpp =================================================================== --- trunk/stdair/stdair/bom/Bucket.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/Bucket.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -11,6 +11,7 @@ // //////////////////////////////////////////////////////////////////// Bucket::Bucket (const Key_T& iKey, Structure_T& ioBucketStructure) : BucketContent (iKey), _structure (ioBucketStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/DemandStream.cpp =================================================================== --- trunk/stdair/stdair/bom/DemandStream.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/DemandStream.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -36,6 +36,7 @@ iDemandDistribution, iNumberOfRequestsSeed, iRequestDateTimeSeed, iDemandCharacteristicsSeed), _structure (ioDemandStreamStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/FlightDate.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/FlightDate.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -14,6 +14,7 @@ FlightDate::FlightDate (const Key_T& iKey, Structure_T& ioFlightStructure) : FlightDateContent (iKey), _structure (ioFlightStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/Inventory.cpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/Inventory.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -12,6 +12,7 @@ Inventory::Inventory (const Key_T& iKey, Structure_T& ioInventoryStructure) : InventoryContent (iKey), _structure (ioInventoryStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/LegCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/LegCabin.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/LegCabin.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -11,6 +11,7 @@ // //////////////////////////////////////////////////////////////////// LegCabin::LegCabin (const Key_T& iKey, Structure_T& ioLegStructure) : LegCabinContent (iKey), _structure (ioLegStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/LegDate.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/LegDate.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -11,6 +11,7 @@ // //////////////////////////////////////////////////////////////////// LegDate::LegDate (const Key_T& iKey, Structure_T& ioLegStructure) : LegDateContent (iKey), _structure (ioLegStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/Network.cpp =================================================================== --- trunk/stdair/stdair/bom/Network.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/Network.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -12,6 +12,7 @@ Network::Network (const Key_T& iKey, Structure_T& ioNetworkStructure) : NetworkContent (iKey), _structure (ioNetworkStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/NetworkDate.cpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/NetworkDate.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -12,6 +12,7 @@ NetworkDate::NetworkDate (const Key_T& iKey, Structure_T& ioNetworkDateStructure) : NetworkDateContent (iKey), _structure (ioNetworkDateStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/OutboundPath.cpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPath.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/OutboundPath.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -13,6 +13,7 @@ Structure_T& ioOutboundPathStructure) : OutboundPathContent (iKey), _structure (ioOutboundPathStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/SegmentCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -12,6 +12,7 @@ SegmentCabin::SegmentCabin (const Key_T& iKey, Structure_T& ioSegmentStructure) : SegmentCabinContent (iKey), _structure (ioSegmentStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/SegmentDate.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/SegmentDate.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -13,6 +13,7 @@ SegmentDate::SegmentDate (const Key_T& iKey, Structure_T& ioSegmentStructure) : SegmentDateContent (iKey), _structure (ioSegmentStructure) { + init (); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/YieldStore.cpp =================================================================== --- trunk/stdair/stdair/bom/YieldStore.cpp 2010-04-22 12:08:40 UTC (rev 178) +++ trunk/stdair/stdair/bom/YieldStore.cpp 2010-04-22 12:17:42 UTC (rev 179) @@ -14,6 +14,7 @@ YieldStore::YieldStore (const Key_T& iKey, Structure_T& ioYieldStoreStructure) : YieldStoreContent (iKey), _structure (ioYieldStoreStructure) { + init (); } // //////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-04-22 12:26:02
|
Revision: 180 http://stdair.svn.sourceforge.net/stdair/?rev=180&view=rev Author: quannaus Date: 2010-04-22 12:25:56 +0000 (Thu, 22 Apr 2010) Log Message: ----------- [Dev] Fixed the forgotten 'return' statement. Modified Paths: -------------- trunk/stdair/stdair/bom/FlightDateContent.hpp trunk/stdair/stdair/bom/InventoryContent.hpp trunk/stdair/stdair/bom/NetworkContent.hpp trunk/stdair/stdair/bom/NetworkDateContent.hpp trunk/stdair/stdair/bom/OutboundPathContent.hpp trunk/stdair/stdair/bom/SegmentDateContent.hpp Modified: trunk/stdair/stdair/bom/FlightDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateContent.hpp 2010-04-22 12:17:42 UTC (rev 179) +++ trunk/stdair/stdair/bom/FlightDateContent.hpp 2010-04-22 12:25:56 UTC (rev 180) @@ -121,7 +121,7 @@ /** Get a string describing the short key (differentiating two objects at the same level). */ - const std::string describeShortKey() const { _key.toString(); } + const std::string describeShortKey() const { return _key.toString(); } protected: /** Default constructors. */ Modified: trunk/stdair/stdair/bom/InventoryContent.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryContent.hpp 2010-04-22 12:17:42 UTC (rev 179) +++ trunk/stdair/stdair/bom/InventoryContent.hpp 2010-04-22 12:25:56 UTC (rev 180) @@ -32,7 +32,7 @@ /** Get a string describing the short key (differentiating two objects at the same level). */ - const std::string describeShortKey() const { _key.toString(); } + const std::string describeShortKey() const { return _key.toString(); } public: // ////////// Getters //////////// Modified: trunk/stdair/stdair/bom/NetworkContent.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkContent.hpp 2010-04-22 12:17:42 UTC (rev 179) +++ trunk/stdair/stdair/bom/NetworkContent.hpp 2010-04-22 12:25:56 UTC (rev 180) @@ -39,7 +39,7 @@ /** Get a string describing the short key (differentiating two objects at the same level). */ - const std::string describeShortKey() const { _key.toString(); } + const std::string describeShortKey() const { return _key.toString(); } protected: /** Default constructors. */ Modified: trunk/stdair/stdair/bom/NetworkDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDateContent.hpp 2010-04-22 12:17:42 UTC (rev 179) +++ trunk/stdair/stdair/bom/NetworkDateContent.hpp 2010-04-22 12:25:56 UTC (rev 180) @@ -39,7 +39,7 @@ /** Get a string describing the short key (differentiating two objects at the same level). */ - const std::string describeShortKey() const { _key.toString(); } + const std::string describeShortKey() const { return _key.toString(); } protected: /** Default constructors. */ Modified: trunk/stdair/stdair/bom/OutboundPathContent.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPathContent.hpp 2010-04-22 12:17:42 UTC (rev 179) +++ trunk/stdair/stdair/bom/OutboundPathContent.hpp 2010-04-22 12:25:56 UTC (rev 180) @@ -95,7 +95,7 @@ /** Get a string describing the whole key (differentiating two objects at any level). */ - const std::string describeShortKey() const { _key.toString(); } + const std::string describeShortKey() const { return _key.toString(); } protected: Modified: trunk/stdair/stdair/bom/SegmentDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateContent.hpp 2010-04-22 12:17:42 UTC (rev 179) +++ trunk/stdair/stdair/bom/SegmentDateContent.hpp 2010-04-22 12:25:56 UTC (rev 180) @@ -173,7 +173,7 @@ /** Get a string describing the short key (differentiating two objects at the same level). */ - const std::string describeShortKey() const { _key.toString(); } + const std::string describeShortKey() const { return _key.toString(); } protected: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-05-03 09:13:57
|
Revision: 187 http://stdair.svn.sourceforge.net/stdair/?rev=187&view=rev Author: quannaus Date: 2010-05-03 09:13:50 +0000 (Mon, 03 May 2010) Log Message: ----------- [dev] Removed some unnecessary statistical attributes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/FlightDateContent.cpp trunk/stdair/stdair/bom/FlightDateContent.hpp trunk/stdair/stdair/bom/InventoryContent.hpp trunk/stdair/stdair/bom/LegDateContent.cpp trunk/stdair/stdair/bom/LegDateContent.hpp trunk/stdair/stdair/bom/SegmentDateContent.cpp trunk/stdair/stdair/bom/SegmentDateContent.hpp Modified: trunk/stdair/stdair/bom/BomManager.cpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.cpp 2010-05-03 08:42:00 UTC (rev 186) +++ trunk/stdair/stdair/bom/BomManager.cpp 2010-05-03 09:13:50 UTC (rev 187) @@ -97,15 +97,7 @@ << std::endl << std::endl; oStream << iFlightDate.getFlightNumber() - << " (" << iFlightDate.getFlightDate() << "), " - << iFlightDate.getBookingCounter() << ", " - << iFlightDate.getRevenue() << ", " - << iFlightDate.getAverageFare() << ", " - << iFlightDate.getASK() << ", " - << iFlightDate.getYield() << ", " - << iFlightDate.getRPK() << ", " - << iFlightDate.getUnitRevenue() << ", " - << iFlightDate.getLoadFactor() << ", " << std::endl; + << " (" << iFlightDate.getFlightDate() << std::endl; oStream << "******************************************" << std::endl; // Display the leg-dates @@ -160,9 +152,6 @@ << lCurrentLD.getElapsedTime() << ", " << lCurrentLD.getDistance() << ", " << lCurrentLD.getCapacity() << ", " - << lCurrentLD.getASK() << ", " - << lCurrentLD.getSoldSeat() << ", " - << lCurrentLD.getLoadFactor() << ", " << std::endl; } oStream << "******************************************" << std::endl; @@ -294,11 +283,6 @@ << lCurrentSD.getTimeOffSet() << ") / " << lCurrentSD.getElapsedTime() << ", " << lCurrentSD.getDistance() << ", " - << lCurrentSD.getBookingCounter() << ", " - << lCurrentSD.getRevenue() << ", " - << lCurrentSD.getAverageFare() << ", " - << lCurrentSD.getUnitRevenue() << ", " - << lCurrentSD.getRPK() << ", " << std::endl; } } Modified: trunk/stdair/stdair/bom/FlightDateContent.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateContent.cpp 2010-05-03 08:42:00 UTC (rev 186) +++ trunk/stdair/stdair/bom/FlightDateContent.cpp 2010-05-03 09:13:50 UTC (rev 187) @@ -4,22 +4,13 @@ // STL #include <cassert> // STDAIR -#include <stdair/basic/BasConst_General.hpp> #include <stdair/bom/FlightDateContent.hpp> namespace stdair { // //////////////////////////////////////////////////////////////////// FlightDateContent::FlightDateContent (const Key_T& iKey) - : _key (iKey), - _bookingCounter (DEFAULT_CLASS_NB_OF_BOOKINGS), - _flightRevenue (DEFAULT_REVENUE_VALUE), - _flightAverageFare (DEFAULT_FARE_VALUE), - _flightASK (DEFAULT_DISTANCE_VALUE), - _flightYield (DEFAULT_REVENUE_VALUE), - _flightRPK (DEFAULT_DISTANCE_VALUE), - _flightUnitRevenue (DEFAULT_REVENUE_VALUE), - _flightLoadFactor (DEFAULT_REVENUE_VALUE) { + : _key (iKey) { } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/FlightDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateContent.hpp 2010-05-03 08:42:00 UTC (rev 186) +++ trunk/stdair/stdair/bom/FlightDateContent.hpp 2010-05-03 09:13:50 UTC (rev 187) @@ -33,80 +33,8 @@ const Date_T& getFlightDate() const { return _key.getFlightDate(); } - - /** Get the booking counter. */ - const NbOfBookings_T& getBookingCounter () const { - return _bookingCounter; - } - /** Get the total flight revenue. */ - const Revenue_T& getRevenue () const { - return _flightRevenue; - } - - /** Get the flight average fare. */ - const Fare_T& getAverageFare() const { - return _flightAverageFare; - } - - /** Get the Availability Seat Kilometer for this flight. */ - const Distance_T& getASK() const { - return _flightASK; - } - - /** Get the yield value for this flight. */ - const Revenue_T& getYield () const { - return _flightYield; - } - - /** Get the Revenue Passanger Kilometer for this flight. */ - const Distance_T& getRPK() const { - return _flightRPK; - } - - /** Get the unit revenue value for this flight. */ - const Revenue_T& getUnitRevenue () const { - return _flightUnitRevenue; - } - - /** Get the load factor value for this flight. */ - const Revenue_T& getLoadFactor () const { - return _flightLoadFactor; - } - public: - // ///////// Setters ////////// - /** Set the revenue amount. */ - void setRevenue (const Revenue_T& iFlightRevenue) { - _flightRevenue = iFlightRevenue; - } - - /** Set the Revenue Passanger Kilometer. */ - void setRPK (const Distance_T& iFlightRPK) { - _flightRPK = iFlightRPK; - } - - /** Set the unit revenue. */ - void setUnitRevenue (const Revenue_T& iFlightURevenue) { - _flightUnitRevenue = iFlightURevenue; - } - - /** Set the average flight fare. */ - void setAverageFare(Fare_T iFAFare) { - _flightAverageFare = iFAFare; - } - - /** Set the yield. */ - void setYield (const Revenue_T& iFlightYield) { - _flightYield = iFlightYield; - } - - /** Set the load factor. */ - void setLoadFactor (const Revenue_T& iFlightLF) { - _flightLoadFactor = iFlightLF; - } - - public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ @@ -134,31 +62,6 @@ // Attributes /** The key of both structure and content objects. */ Key_T _key; - - /** Counter of all bookings into this flight. */ - NbOfBookings_T _bookingCounter; - - /** Total amount of money earn with flight bookings. */ - Revenue_T _flightRevenue; - - /** Value of the average fare of this flight.*/ - Fare_T _flightAverageFare; - - /** Value of the Available Seat Kilometer for this flight.*/ - Distance_T _flightASK; - - /** Value of the Yield (Revenue/ASK). */ - Revenue_T _flightYield; - - /** Value of the Revenue Passanger Kilometer for this flight.*/ - Distance_T _flightRPK; - - /** Value of the Unit Revenue (Revenue/RPK). */ - Revenue_T _flightUnitRevenue; - - /** Value of the Load Factor (ASK/RPK). */ - Revenue_T _flightLoadFactor; - }; } Modified: trunk/stdair/stdair/bom/InventoryContent.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryContent.hpp 2010-05-03 08:42:00 UTC (rev 186) +++ trunk/stdair/stdair/bom/InventoryContent.hpp 2010-05-03 09:13:50 UTC (rev 187) @@ -36,124 +36,27 @@ public: // ////////// Getters //////////// - /** Get the airline code. */ - const AirlineCode_T& getAirlineCode () const { - return _key.getAirlineCode(); - } - /** Get the inventory key. */ const Key_T& getKey() const { return _key; } - - /** Get the booking counter. */ - const NbOfBookings_T& getBookingCounter () const { - return _bookingCounter; + + /** Get the airline code. */ + const AirlineCode_T& getAirlineCode () const { + return _key.getAirlineCode(); } - /** Get the total inventory revenue. */ - const Revenue_T& getRevenue () const { - return _inventoryRevenue; - } - - /** Get the inventory average fare. */ - const Fare_T& getAverageFare() const { - return _inventoryAverageFare; - } - - /** Get the Availability Seat Kilometer for the inventory. */ - const Distance_T& getASK() const { - return _inventoryASK; - } - - /** Get the yield value for the inventory. */ - const Revenue_T& getYield () const { - return _inventoryYield; - } - - /** Get the Revenue Passanger Kilometer for the whole inventory. */ - const Distance_T& getRPK() const { - return _inventoryRPK; - } - - /** Get the unit revenue value for the whole inventory. */ - const Revenue_T& getUnitRevenue () const { - return _inventoryUnitRevenue; - } - - /** Get the load factor value for this inventory. */ - const Revenue_T& getLoadFactor () const { - return _inventoryLoadFactor; - } - - public: - // ///////// Setters ////////// - /** Set the revenue amount. */ - void setRevenue (const Revenue_T& iInventoryRevenue) { - _inventoryRevenue = iInventoryRevenue; - } - - /** Set the Revenue Passanger Kilometer. */ - void setRPK (const Distance_T& iInventoryRPK) { - _inventoryRPK = iInventoryRPK; - } - - /** Set the unit revenue. */ - void setUnitRevenue (const Revenue_T& iInventoryURevenue) { - _inventoryUnitRevenue = iInventoryURevenue; - } - - /** Set the average fare. */ - void setAverageFare(Fare_T iIAFare) { - _inventoryAverageFare = iIAFare; - } - - /** Set the yield. */ - void setYield (const Revenue_T& iInvYield) { - _inventoryYield = iInvYield; - } - - /** Set the load factor. */ - void setLoadFactor (const Revenue_T& iInventoryLF) { - _inventoryLoadFactor = iInventoryLF; - } - protected: /** Default constructors. */ InventoryContent (const Key_T&); InventoryContent (const InventoryContent&); /** Destructor. */ - virtual ~InventoryContent(); + ~InventoryContent(); protected: // Attributes /** The key of both structure and content objects. */ Key_T _key; - - /** Counter of all bookings into the inventory. */ - NbOfBookings_T _bookingCounter; - - /** Total amount of money earn with all flight bookings - for one airline. */ - Revenue_T _inventoryRevenue; - - /** Value of the average fare of the inventory.*/ - Fare_T _inventoryAverageFare; - - /** Value of the Available Seat Kilometer for this Inventory.*/ - Distance_T _inventoryASK; - - /** Value of the Yield (Revenue/ASK). */ - Revenue_T _inventoryYield; - - /** Value of the Revenue Passanger Kilometer for the whole inventory.*/ - Distance_T _inventoryRPK; - - /** Value of the Unit Revenue (Revenue/RPK). */ - Revenue_T _inventoryUnitRevenue; - - /** Value of the Load Factor (ASK/RPK). */ - Revenue_T _inventoryLoadFactor; }; } Modified: trunk/stdair/stdair/bom/LegDateContent.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDateContent.cpp 2010-05-03 08:42:00 UTC (rev 186) +++ trunk/stdair/stdair/bom/LegDateContent.cpp 2010-05-03 09:13:50 UTC (rev 187) @@ -13,9 +13,7 @@ LegDateContent::LegDateContent (const Key_T& iKey) \ : _key (iKey), _distance (DEFAULT_DISTANCE_VALUE), - _capacity (DEFAULT_CABIN_CAPACITY), - _legSoldSeat (DEFAULT_CLASS_NB_OF_BOOKINGS), - _legLoadFactor (DEFAULT_REVENUE_VALUE) { + _capacity (DEFAULT_CABIN_CAPACITY) { } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/LegDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateContent.hpp 2010-05-03 08:42:00 UTC (rev 186) +++ trunk/stdair/stdair/bom/LegDateContent.hpp 2010-05-03 09:13:50 UTC (rev 187) @@ -69,21 +69,6 @@ return _capacity; } - /** Get the Availability Seat Kilometer for this leg. */ - const Distance_T& getASK() const { - return _legASK; - } - - /** Get the number of sold seat. */ - const NbOfBookings_T& getSoldSeat () const { - return _legSoldSeat; - } - - /** Get the load factor value for this leg. */ - const Revenue_T& getLoadFactor () const { - return _legLoadFactor; - } - /** Get the date off set (off date - boarding date). */ const DateOffSet_T getDateOffSet () const { return _offDate - _boardingDate; @@ -122,11 +107,6 @@ _offTime = iOffTime; } - /** Set the number of sold seat. */ - void setSoldSeat (const NbOfBookings_T& iLSoldSeat) { - _legSoldSeat = iLSoldSeat; - } - /** Set the elapsed time. */ void setElapsedTime (const Duration_T&); @@ -155,7 +135,7 @@ LegDateContent (const Key_T&); LegDateContent (const LegDateContent&); /** Destructor. */ - virtual ~LegDateContent(); + ~LegDateContent(); protected: // Attributes @@ -185,16 +165,6 @@ /** Capacity of the leg. */ CabinCapacity_T _capacity; - - /** Value of the Available Seat Kilometer for this leg.*/ - Distance_T _legASK; - - /** Sold seat into the leg. */ - NbOfBookings_T _legSoldSeat; - - /** Value of the Load Factor (ASK/RPK) or - (sold seats/ capacity) for the leg level. */ - Revenue_T _legLoadFactor; }; } Modified: trunk/stdair/stdair/bom/SegmentDateContent.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateContent.cpp 2010-05-03 08:42:00 UTC (rev 186) +++ trunk/stdair/stdair/bom/SegmentDateContent.cpp 2010-05-03 09:13:50 UTC (rev 187) @@ -11,12 +11,7 @@ // //////////////////////////////////////////////////////////////////// SegmentDateContent::SegmentDateContent (const Key_T& iKey) - : _key (iKey), - _bookingCounter (DEFAULT_CLASS_NB_OF_BOOKINGS), - _segmentRevenue (DEFAULT_REVENUE_VALUE), - _segmentAverageFare (DEFAULT_FARE_VALUE), - _segmentUnitRevenue (DEFAULT_REVENUE_VALUE), - _segmentRPK (DEFAULT_DISTANCE_VALUE) { + : _key (iKey) { } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/SegmentDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateContent.hpp 2010-05-03 08:42:00 UTC (rev 186) +++ trunk/stdair/stdair/bom/SegmentDateContent.hpp 2010-05-03 09:13:50 UTC (rev 187) @@ -34,31 +34,6 @@ return _key.getOffPoint(); } - /** Get the booking counter. */ - const NbOfBookings_T& getBookingCounter() const { - return _bookingCounter; - } - - /** Get the total segment revenue. */ - const Revenue_T& getRevenue () const { - return _segmentRevenue; - } - - /** Get the segment average fare. */ - const Fare_T& getAverageFare() const { - return _segmentAverageFare; - } - - /** Get the unit revenue value for this segment. */ - const Revenue_T& getUnitRevenue () const { - return _segmentUnitRevenue; - } - - /** Get the Revenue Passanger Kilometer for this segment. */ - const Distance_T& getRPK() const { - return _segmentRPK; - } - /** Get the boarding date. */ const Date_T& getBoardingDate () const { return _boardingDate; @@ -102,11 +77,6 @@ public: // ///////// Setters ////////// - /** Set the revenue amount. */ - void setRevenue (const Revenue_T& iSegmentRevenue) { - _segmentRevenue = iSegmentRevenue; - } - /** Set the boarding date. */ void setBoardingDate (const Date_T& iBoardingDate) { _boardingDate = iBoardingDate; @@ -132,26 +102,6 @@ _elapsedTime = iElapsedTime; } - /** Set the total number of bookings. */ - void setBookingCounter (const NbOfBookings_T& iBookCounter) { - _bookingCounter = iBookCounter; - } - - /** Set the average segment fare. */ - void setAverageSegmentFare(Fare_T iSAFare) { - _segmentAverageFare = iSAFare; - } - - /** Set the Revenue Passanger Kilometer. */ - void setRPK (const Distance_T& iSegmentRPK) { - _segmentRPK = iSegmentRPK; - } - - /** Set the Unit Revenue. */ - void setUnitRevenue (const Revenue_T& iSegmentURevenue) { - _segmentUnitRevenue = iSegmentURevenue; - } - /** Set the distance. */ void setDistance (const Distance_T& iDistance) { _distance = iDistance; @@ -187,22 +137,7 @@ // Attributes /** The key of both structure and content objects. */ Key_T _key; - - /** Counter of all bookings into this segment. */ - NbOfBookings_T _bookingCounter; - /** Total amount of money earn with segment bookings. */ - Revenue_T _segmentRevenue; - - /** Value of the average fare of this segment date.*/ - Fare_T _segmentAverageFare; - - /** Value of the Unit Revenue (Revenue/ASK). */ - Revenue_T _segmentUnitRevenue; - - /** Value of the Revenue Passanger Kilometer for this segment date.*/ - Distance_T _segmentRPK; - /** Boarding Date. */ Date_T _boardingDate; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-06-27 13:20:32
|
Revision: 198 http://stdair.svn.sourceforge.net/stdair/?rev=198&view=rev Author: denis_arnaud Date: 2010-06-27 13:20:26 +0000 (Sun, 27 Jun 2010) Log Message: ----------- [Dev] Added pragma directives to support Boost versions lower than 1.35 (e.g., for RedHat/CentOS 5). Modified Paths: -------------- trunk/stdair/stdair/bom/AirlineFeature.hpp trunk/stdair/stdair/bom/BomContent.hpp trunk/stdair/stdair/bom/DemandStream.hpp trunk/stdair/stdair/bom/OutboundPath.hpp Modified: trunk/stdair/stdair/bom/AirlineFeature.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-06-27 13:01:09 UTC (rev 197) +++ trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-06-27 13:20:26 UTC (rev 198) @@ -4,7 +4,9 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#include <boost/fusion/include/map.hpp> +// StdAir #include <stdair/bom/AirlineFeatureContent.hpp> #include <stdair/bom/AirlineFeatureTypes.hpp> Modified: trunk/stdair/stdair/bom/BomContent.hpp =================================================================== --- trunk/stdair/stdair/bom/BomContent.hpp 2010-06-27 13:01:09 UTC (rev 197) +++ trunk/stdair/stdair/bom/BomContent.hpp 2010-06-27 13:20:26 UTC (rev 198) @@ -7,8 +7,6 @@ // STL #include <iosfwd> #include <string> -// BOOST Fusion -#include <boost/fusion/include/map.hpp> // STDAIR #include <stdair/STDAIR_Types.hpp> Modified: trunk/stdair/stdair/bom/DemandStream.hpp =================================================================== --- trunk/stdair/stdair/bom/DemandStream.hpp 2010-06-27 13:01:09 UTC (rev 197) +++ trunk/stdair/stdair/bom/DemandStream.hpp 2010-06-27 13:20:26 UTC (rev 198) @@ -4,7 +4,9 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#include <boost/fusion/include/map.hpp> +// StdAir #include <stdair/bom/DemandStreamContent.hpp> #include <stdair/bom/DemandStreamTypes.hpp> Modified: trunk/stdair/stdair/bom/OutboundPath.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPath.hpp 2010-06-27 13:01:09 UTC (rev 197) +++ trunk/stdair/stdair/bom/OutboundPath.hpp 2010-06-27 13:20:26 UTC (rev 198) @@ -4,7 +4,9 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#include <boost/fusion/include/map.hpp> +// StdAir #include <stdair/bom/OutboundPathContent.hpp> #include <stdair/bom/OutboundPathTypes.hpp> #include <stdair/bom/SegmentDateTypes.hpp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-06-27 14:27:17
|
Revision: 199 http://stdair.svn.sourceforge.net/stdair/?rev=199&view=rev Author: denis_arnaud Date: 2010-06-27 14:27:11 +0000 (Sun, 27 Jun 2010) Log Message: ----------- [Dev] Added pragma directives to support Boost versions lower than 1.35 (e.g., for RedHat/CentOS 5). Modified Paths: -------------- trunk/stdair/stdair/bom/AirlineFeature.hpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/OutboundPath.hpp trunk/stdair/stdair/bom/Structure.hpp Modified: trunk/stdair/stdair/bom/AirlineFeature.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-06-27 13:20:26 UTC (rev 198) +++ trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-06-27 14:27:11 UTC (rev 199) @@ -5,7 +5,11 @@ // Import section // ////////////////////////////////////////////////////////////////////// // Boost Fusion +#if BOOST_VERSION >= 103500 #include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 // StdAir #include <stdair/bom/AirlineFeatureContent.hpp> #include <stdair/bom/AirlineFeatureTypes.hpp> @@ -36,7 +40,11 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-06-27 13:20:26 UTC (rev 198) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-06-27 14:27:11 UTC (rev 199) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/BomRootContent.hpp> #include <stdair/bom/BomRootTypes.hpp> #include <stdair/bom/InventoryTypes.hpp> @@ -53,6 +59,7 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<Inventory, InventoryHolder_T*>, boost::fusion::pair<Network, NetworkHolder_T*>, @@ -60,6 +67,9 @@ boost::fusion::pair<DemandStream, DemandStreamHolder_T*>, boost::fusion::pair<YieldStore, YieldStoreHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2010-06-27 13:20:26 UTC (rev 198) +++ trunk/stdair/stdair/bom/Inventory.hpp 2010-06-27 14:27:11 UTC (rev 199) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/InventoryContent.hpp> #include <stdair/bom/InventoryTypes.hpp> #include <stdair/bom/FlightDateTypes.hpp> @@ -38,9 +44,13 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<FlightDate, FlightDateHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/OutboundPath.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPath.hpp 2010-06-27 13:20:26 UTC (rev 198) +++ trunk/stdair/stdair/bom/OutboundPath.hpp 2010-06-27 14:27:11 UTC (rev 199) @@ -5,7 +5,11 @@ // Import section // ////////////////////////////////////////////////////////////////////// // Boost Fusion +#if BOOST_VERSION >= 103500 #include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 // StdAir #include <stdair/bom/OutboundPathContent.hpp> #include <stdair/bom/OutboundPathTypes.hpp> @@ -38,9 +42,13 @@ typedef std::multimap<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<SegmentDate, SegmentDateHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/Structure.hpp =================================================================== --- trunk/stdair/stdair/bom/Structure.hpp 2010-06-27 13:20:26 UTC (rev 198) +++ trunk/stdair/stdair/bom/Structure.hpp 2010-06-27 14:27:11 UTC (rev 199) @@ -6,9 +6,12 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> -// BOOST Fusion +// Boost Fusion +#include <boost/version.hpp> +#if BOOST_VERSION >= 103500 #include <boost/fusion/include/map.hpp> #include <boost/fusion/sequence/intrinsic/at_key.hpp> +#endif // BOOST_VERSION >= 103500 // STDAIR #include <stdair/bom/BomStructure.hpp> @@ -64,8 +67,16 @@ /** The the holder which corresponds to the CHILD type. */ template <typename CHILD> BomChildrenHolderImp<CHILD>& getChildrenHolder () const { + +#if BOOST_VERSION >= 103500 BomChildrenHolderImp<CHILD>* lHolder_ptr = boost::fusion::at_key<CHILD> (_holderMap); + +#else // BOOST_VERSION >= 103500 + BomChildrenHolderImp<CHILD>* lHolder_ptr = NULL; + +#endif // BOOST_VERSION >= 103500 + assert (lHolder_ptr != NULL); return *lHolder_ptr; } @@ -77,9 +88,15 @@ CHILD* getChildPtr (const MapKey_T& iKey) const { CHILD* oContentChild_ptr = NULL; +#if BOOST_VERSION >= 103500 BomChildrenHolderImp<CHILD>* lHolder_ptr = boost::fusion::at_key<CHILD> (_holderMap); +#else // BOOST_VERSION >= 103500 + BomChildrenHolderImp<CHILD>* lHolder_ptr = NULL; + +#endif // BOOST_VERSION >= 103500 + if (lHolder_ptr != NULL) { // Look for the child in the map, then in the multimap BomMap_T<CHILD> lChildrenMap (*lHolder_ptr); @@ -116,9 +133,12 @@ /** Initialise the pointer of children holder to NULL. */ template <typename CHILD> void initChildrenHolder() { + +#if BOOST_VERSION >= 103500 BomChildrenHolderImp<CHILD>*& lHolder_ptr = boost::fusion::at_key<CHILD> (_holderMap); lHolder_ptr = NULL; +#endif // BOOST_VERSION >= 103500 } public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-06-28 08:59:43
|
Revision: 201 http://stdair.svn.sourceforge.net/stdair/?rev=201&view=rev Author: denis_arnaud Date: 2010-06-28 08:59:37 +0000 (Mon, 28 Jun 2010) Log Message: ----------- [Dev] Added pragma directives to support Boost versions lower than 1.35 (e.g., for RedHat/CentOS 5). Modified Paths: -------------- trunk/stdair/stdair/bom/Network.hpp trunk/stdair/stdair/bom/YieldStore.hpp Modified: trunk/stdair/stdair/bom/Network.hpp =================================================================== --- trunk/stdair/stdair/bom/Network.hpp 2010-06-28 08:53:24 UTC (rev 200) +++ trunk/stdair/stdair/bom/Network.hpp 2010-06-28 08:59:37 UTC (rev 201) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/NetworkContent.hpp> #include <stdair/bom/NetworkTypes.hpp> #include <stdair/bom/NetworkDateTypes.hpp> @@ -36,9 +42,13 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<NetworkDate, NetworkDateHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/YieldStore.hpp =================================================================== --- trunk/stdair/stdair/bom/YieldStore.hpp 2010-06-28 08:53:24 UTC (rev 200) +++ trunk/stdair/stdair/bom/YieldStore.hpp 2010-06-28 08:59:37 UTC (rev 201) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/YieldStoreContent.hpp> #include <stdair/bom/YieldStoreTypes.hpp> @@ -34,7 +40,11 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-06-28 10:10:37
|
Revision: 203 http://stdair.svn.sourceforge.net/stdair/?rev=203&view=rev Author: denis_arnaud Date: 2010-06-28 09:28:02 +0000 (Mon, 28 Jun 2010) Log Message: ----------- [Dev] Added pragma directives to support Boost versions lower than 1.35 (e.g., for RedHat/CentOS 5). Modified Paths: -------------- trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/Bucket.hpp trunk/stdair/stdair/bom/DemandStream.hpp trunk/stdair/stdair/bom/FlightPeriod.hpp trunk/stdair/stdair/bom/LegCabin.hpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/SegmentCabin.hpp trunk/stdair/stdair/bom/SegmentDate.hpp Modified: trunk/stdair/stdair/bom/BookingClass.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.hpp 2010-06-28 09:16:58 UTC (rev 202) +++ trunk/stdair/stdair/bom/BookingClass.hpp 2010-06-28 09:28:02 UTC (rev 203) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/BookingClassContent.hpp> #include <stdair/bom/BookingClassTypes.hpp> @@ -34,7 +40,11 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// // /////////////// Getters //////////////// Modified: trunk/stdair/stdair/bom/Bucket.hpp =================================================================== --- trunk/stdair/stdair/bom/Bucket.hpp 2010-06-28 09:16:58 UTC (rev 202) +++ trunk/stdair/stdair/bom/Bucket.hpp 2010-06-28 09:28:02 UTC (rev 203) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/BucketContent.hpp> #include <stdair/bom/BucketTypes.hpp> @@ -33,7 +39,11 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/DemandStream.hpp =================================================================== --- trunk/stdair/stdair/bom/DemandStream.hpp 2010-06-28 09:16:58 UTC (rev 202) +++ trunk/stdair/stdair/bom/DemandStream.hpp 2010-06-28 09:28:02 UTC (rev 203) @@ -5,7 +5,11 @@ // Import section // ////////////////////////////////////////////////////////////////////// // Boost Fusion +#if BOOST_VERSION >= 103500 #include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 // StdAir #include <stdair/bom/DemandStreamContent.hpp> #include <stdair/bom/DemandStreamTypes.hpp> @@ -35,7 +39,11 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/FlightPeriod.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightPeriod.hpp 2010-06-28 09:16:58 UTC (rev 202) +++ trunk/stdair/stdair/bom/FlightPeriod.hpp 2010-06-28 09:28:02 UTC (rev 203) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/FlightPeriodContent.hpp> #include <stdair/bom/FlightPeriodTypes.hpp> #include <stdair/bom/SegmentPeriodTypes.hpp> @@ -38,9 +44,13 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<SegmentPeriod, SegmentPeriodHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/LegCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabin.hpp 2010-06-28 09:16:58 UTC (rev 202) +++ trunk/stdair/stdair/bom/LegCabin.hpp 2010-06-28 09:28:02 UTC (rev 203) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/LegCabinContent.hpp> #include <stdair/bom/LegCabinTypes.hpp> #include <stdair/bom/BucketTypes.hpp> @@ -38,10 +44,14 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<Bucket, BucketHolder_T*>, boost::fusion::pair<SegmentCabin, SegmentCabinHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp 2010-06-28 09:16:58 UTC (rev 202) +++ trunk/stdair/stdair/bom/LegDate.hpp 2010-06-28 09:28:02 UTC (rev 203) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/LegDateContent.hpp> #include <stdair/bom/LegDateTypes.hpp> #include <stdair/bom/LegCabinTypes.hpp> @@ -38,10 +44,14 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<LegCabin, LegCabinHolder_T*>, boost::fusion::pair<SegmentDate, SegmentDateHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/SegmentCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-06-28 09:16:58 UTC (rev 202) +++ trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-06-28 09:28:02 UTC (rev 203) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/SegmentCabinContent.hpp> #include <stdair/bom/SegmentCabinTypes.hpp> #include <stdair/bom/BookingClassTypes.hpp> @@ -38,10 +44,14 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<BookingClass, BookingClassHolder_T*>, boost::fusion::pair<LegCabin, LegCabinHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/SegmentDate.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.hpp 2010-06-28 09:16:58 UTC (rev 202) +++ trunk/stdair/stdair/bom/SegmentDate.hpp 2010-06-28 09:28:02 UTC (rev 203) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/SegmentDateContent.hpp> #include <stdair/bom/SegmentDateTypes.hpp> #include <stdair/bom/LegDateTypes.hpp> @@ -38,10 +44,14 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<SegmentCabin, SegmentCabinHolder_T*>, boost::fusion::pair<LegDate, LegDateHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-06-28 10:35:59
|
Revision: 204 http://stdair.svn.sourceforge.net/stdair/?rev=204&view=rev Author: denis_arnaud Date: 2010-06-28 10:35:53 +0000 (Mon, 28 Jun 2010) Log Message: ----------- [Dev] Added pragma directives to support Boost versions lower than 1.35 (e.g., for RedHat/CentOS 5). Modified Paths: -------------- trunk/stdair/stdair/bom/AirportDate.hpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/NetworkDate.hpp trunk/stdair/stdair/bom/OriginDestinationSet.hpp trunk/stdair/stdair/bom/ReachableUniverse.hpp trunk/stdair/stdair/bom/SegmentPathPeriod.hpp Modified: trunk/stdair/stdair/bom/AirportDate.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.hpp 2010-06-28 09:28:02 UTC (rev 203) +++ trunk/stdair/stdair/bom/AirportDate.hpp 2010-06-28 10:35:53 UTC (rev 204) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/AirportDateContent.hpp> #include <stdair/bom/AirportDateTypes.hpp> #include <stdair/bom/OutboundPathTypes.hpp> @@ -36,9 +42,13 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<OutboundPath, OutboundPathHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2010-06-28 09:28:02 UTC (rev 203) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2010-06-28 10:35:53 UTC (rev 204) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/FlightDateContent.hpp> #include <stdair/bom/FlightDateTypes.hpp> #include <stdair/bom/SegmentDateTypes.hpp> @@ -40,10 +46,14 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<LegDate, LegDateHolder_T*>, boost::fusion::pair<SegmentDate, SegmentDateHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/NetworkDate.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.hpp 2010-06-28 09:28:02 UTC (rev 203) +++ trunk/stdair/stdair/bom/NetworkDate.hpp 2010-06-28 10:35:53 UTC (rev 204) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/NetworkDateContent.hpp> #include <stdair/bom/NetworkDateTypes.hpp> #include <stdair/bom/AirportDateTypes.hpp> @@ -36,9 +42,13 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<AirportDate, AirportDateHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/OriginDestinationSet.hpp =================================================================== --- trunk/stdair/stdair/bom/OriginDestinationSet.hpp 2010-06-28 09:28:02 UTC (rev 203) +++ trunk/stdair/stdair/bom/OriginDestinationSet.hpp 2010-06-28 10:35:53 UTC (rev 204) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/OriginDestinationSetContent.hpp> #include <stdair/bom/OriginDestinationSetTypes.hpp> #include <stdair/bom/SegmentPathPeriodTypes.hpp> @@ -36,9 +42,13 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<SegmentPathPeriod, SegmentPathPeriodHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/ReachableUniverse.hpp =================================================================== --- trunk/stdair/stdair/bom/ReachableUniverse.hpp 2010-06-28 09:28:02 UTC (rev 203) +++ trunk/stdair/stdair/bom/ReachableUniverse.hpp 2010-06-28 10:35:53 UTC (rev 204) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/ReachableUniverseContent.hpp> #include <stdair/bom/ReachableUniverseTypes.hpp> #include <stdair/bom/SegmentPathPeriodTypes.hpp> @@ -38,9 +44,13 @@ typedef std::map<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<OriginDestinationSet, OriginDestinationSetHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/SegmentPathPeriod.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentPathPeriod.hpp 2010-06-28 09:28:02 UTC (rev 203) +++ trunk/stdair/stdair/bom/SegmentPathPeriod.hpp 2010-06-28 10:35:53 UTC (rev 204) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#if BOOST_VERSION >= 103500 +#include <boost/fusion/include/map.hpp> +#else // BOOST_VERSION >= 103500 +#include <boost/mpl/map.hpp> +#endif // BOOST_VERSION >= 103500 +// StdAir #include <stdair/bom/SegmentPathPeriodContent.hpp> #include <stdair/bom/SegmentPathPeriodTypes.hpp> #include <stdair/bom/SegmentPeriodTypes.hpp> @@ -36,9 +42,13 @@ typedef std::multimap<const MapKey_T, const Structure_T*> Map_T; /** Define the list of children holder types. */ +#if BOOST_VERSION >= 103500 typedef boost::fusion::map< boost::fusion::pair<SegmentPeriod, SegmentPeriodHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-08-24 14:57:29
|
Revision: 279 http://stdair.svn.sourceforge.net/stdair/?rev=279&view=rev Author: quannaus Date: 2010-08-24 14:57:23 +0000 (Tue, 24 Aug 2010) Log Message: ----------- [dev] added the checker for children list and map initialisation. Modified Paths: -------------- trunk/stdair/stdair/bom/BomManager.hpp trunk/stdair/stdair/bom/RelationShip.hpp Modified: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp 2010-08-21 20:10:15 UTC (rev 278) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-08-24 14:57:23 UTC (rev 279) @@ -20,6 +20,12 @@ template <typename CHILD, typename PARENT> static std::map<const MapKey_T, CHILD*>& getMap (const PARENT&); + /** Check if the list/map of children has been initialised. */ + template <typename CHILD, typename PARENT> + static bool hasList (const PARENT&); + template <typename CHILD, typename PARENT> + static bool hasMap (const PARENT&); + /** Getter of the PARENT given the CHILD. */ template <typename PARENT, typename CHILD> static PARENT& getParent (const CHILD&); @@ -47,6 +53,18 @@ } // //////////////////////////////////////////////////////////////////// + template <typename CHILD, typename PARENT> + bool BomManager::hasList (const PARENT& iParent) { + return RelationShip<PARENT, CHILD>::instance().hasChildrenList (iParent); + } + + // //////////////////////////////////////////////////////////////////// + template <typename CHILD, typename PARENT> + bool BomManager::hasMap (const PARENT& iParent) { + return RelationShip<PARENT, CHILD>::instance().hasChildrenMap (iParent); + } + + // //////////////////////////////////////////////////////////////////// template <typename PARENT, typename CHILD> PARENT& BomManager::getParent (const CHILD& iChild) { return RelationShip<PARENT, CHILD>::instance().getParent (iChild); Modified: trunk/stdair/stdair/bom/RelationShip.hpp =================================================================== --- trunk/stdair/stdair/bom/RelationShip.hpp 2010-08-21 20:10:15 UTC (rev 278) +++ trunk/stdair/stdair/bom/RelationShip.hpp 2010-08-24 14:57:23 UTC (rev 279) @@ -28,11 +28,8 @@ // Internal type definitions. typedef std::list<CHILD*> ChildrenList_T; typedef std::map<const MapKey_T, CHILD*> ChildrenMap_T; - typedef std::multimap<const MapKey_T, CHILD*> ChildrenMultimap_T; typedef std::map<const PARENT*, ChildrenList_T> ParentChildrentList_T; typedef std::map<const PARENT*, ChildrenMap_T> ParentChildrentMap_T; - typedef std::map<const PARENT*, - ChildrenMultimap_T> ParentChildrentMultimap_T; typedef std::map<const CHILD*, PARENT*> ChildParentMap_T; // ////////////////////////////////////////////////////////////////// @@ -47,7 +44,6 @@ /** Getter of the children conainter given the PARENT pointer. */ ChildrenList_T& getChildrenList (const PARENT&); ChildrenMap_T& getChildrenMap (const PARENT&); - ChildrenMultimap_T& getChildrenMultimap (const PARENT&); /** Getter of the PARENT given the CHILD. */ PARENT& getParent (const CHILD&); @@ -59,13 +55,15 @@ /** Return the CHILD corresponding the the given string key. */ CHILD& getChild (const PARENT&, const MapKey_T&); + /** Check if the list/map of children has been initialised. */ + bool hasChildrenList (const PARENT&); + bool hasChildrenMap (const PARENT&); + private: /** Add the given CHILD to the children containter of the given PARENT. */ void addChildToTheList (const PARENT&, CHILD&); void addChildToTheMap (const PARENT&, CHILD&); void addChildToTheMap (const PARENT&, CHILD&, const MapKey_T&); - void addChildToTheMultimap (const PARENT&, CHILD&); - void addChildToTheMultimap (const PARENT&, CHILD&, const MapKey_T&); /** Link the CHILD with the PARENT. */ void linkWithParent (PARENT&, const CHILD&); @@ -82,7 +80,6 @@ /** The containers of relation ships. */ ParentChildrentList_T _parentChildrenList; ParentChildrentMap_T _parentChildrenMap; - ParentChildrentMultimap_T _parentChildrenMultimap; ChildParentMap_T _childParentMap; }; @@ -135,21 +132,29 @@ } // //////////////////////////////////////////////////////////////////// - template <typename PARENT, typename CHILD> - typename RelationShip<PARENT, CHILD>::ChildrenMultimap_T& - RelationShip<PARENT, CHILD>::getChildrenMultimap (const PARENT& iParent) { - ParentChildrentMultimap_T& lParentChildrenMultimap = - instance()._parentChildrenMultimap; - typename ParentChildrentMultimap_T::iterator itMultimap = - lParentChildrenMultimap.find (&iParent); + template <typename PARENT, typename CHILD> bool RelationShip<PARENT, CHILD>:: + hasChildrenList (const PARENT& iParent) { + ParentChildrentList_T& lParentChildrenList = instance()._parentChildrenList; + typename ParentChildrentList_T::iterator itList = + lParentChildrenList.find (&iParent); - if (itMultimap == lParentChildrenMultimap.end()) { - STDAIR_LOG_ERROR ("Cannot find the multimap within: " - << iParent.describeKey()); - throw NonInitialisedContainerException (); + if (itList == lParentChildrenList.end()) { + return false; } + return true; + } - return itMultimap->second; + // //////////////////////////////////////////////////////////////////// + template <typename PARENT, typename CHILD> bool RelationShip<PARENT, CHILD>:: + hasChildrenMap (const PARENT& iParent) { + ParentChildrentMap_T& lParentChildrenMap = instance()._parentChildrenMap; + typename ParentChildrentMap_T::iterator itMap = + lParentChildrenMap.find (&iParent); + + if (itMap == lParentChildrenMap.end()) { + return false; + } + return true; } // //////////////////////////////////////////////////////////////////// @@ -171,8 +176,7 @@ template <typename PARENT, typename CHILD> CHILD* RelationShip<PARENT, CHILD>:: getChildPtr (const PARENT& iParent, const MapKey_T& iKey) { - // Look for the child in the map, then the multimap. - // 1. Map + ParentChildrentMap_T lParentChildrenMap = instance()._parentChildrenMap; typename ParentChildrentMap_T::iterator itMap = lParentChildrenMap.find (&iParent); @@ -186,23 +190,6 @@ return oChild_ptr; } } - - // 2. Multimap - ParentChildrentMultimap_T lParentChildrenMultimap = - instance()._parentChildrenMultimap; - typename ParentChildrentMultimap_T::iterator itMultimap = - lParentChildrenMultimap.find (&iParent); - - if (itMultimap != lParentChildrenMultimap.end()) { - ChildrenMultimap_T& lChildrenMultimap = itMultimap->second; - typename ChildrenMultimap_T::iterator itChild = - lChildrenMultimap.find (iKey); - if (itChild != lChildrenMultimap.end()) { - CHILD* oChild_ptr = itChild->second; - assert (oChild_ptr); - return oChild_ptr; - } - } return NULL; } @@ -211,8 +198,7 @@ template <typename PARENT, typename CHILD> CHILD& RelationShip<PARENT, CHILD>:: getChild (const PARENT& iParent, const MapKey_T& iKey) { - // Look for the child in the map, then the multimap. - // 1. Map + ParentChildrentMap_T lParentChildrenMap = instance()._parentChildrenMap; typename ParentChildrentMap_T::iterator itMap = lParentChildrenMap.find (&iParent); @@ -227,23 +213,6 @@ } } - // 2. Multimap - ParentChildrentMultimap_T lParentChildrenMultimap = - instance()._parentChildrenMultimap; - typename ParentChildrentMultimap_T::iterator itMultimap = - lParentChildrenMultimap.find (&iParent); - - if (itMultimap != lParentChildrenMultimap.end()) { - ChildrenMultimap_T& lChildrenMultimap = itMultimap->second; - typename ChildrenMultimap_T::iterator itChild = - lChildrenMultimap.find (iKey); - if (itChild != lChildrenMultimap.end()) { - CHILD* oChild_ptr = itChild->second; - assert (oChild_ptr); - return *oChild_ptr; - } - } - throw NonInitialisedRelationShip (); } @@ -289,27 +258,6 @@ // //////////////////////////////////////////////////////////////////// template <typename PARENT, typename CHILD> void RelationShip<PARENT, CHILD>:: - addChildToTheMultimap (const PARENT& iParent, CHILD& ioChild) { - ParentChildrentMultimap_T& lParentChildrenMultimap = - instance()._parentChildrenMultimap; - - const MapKey_T& lKey = ioChild.describeKey (); - bool insertionSucceeded = lParentChildrenMultimap[&iParent]. - insert (typename ChildrenMultimap_T::value_type (lKey, &ioChild)).second; - } - - // //////////////////////////////////////////////////////////////////// - template <typename PARENT, typename CHILD> void RelationShip<PARENT, CHILD>:: - addChildToTheMultimap (const PARENT& iParent, CHILD& ioChild, - const MapKey_T& iKey) { - ParentChildrentMultimap_T& lParentChildrenMultimap = - instance()._parentChildrenMultimap; - bool insertionSucceeded = lParentChildrenMultimap[&iParent]. - insert (typename ChildrenMultimap_T::value_type (iKey, &ioChild)).second; - } - - // //////////////////////////////////////////////////////////////////// - template <typename PARENT, typename CHILD> void RelationShip<PARENT, CHILD>:: linkWithParent (PARENT& ioParent, const CHILD& iChild) { instance()._childParentMap[&iChild] = &ioParent; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-09-03 08:17:05
|
Revision: 300 http://stdair.svn.sourceforge.net/stdair/?rev=300&view=rev Author: quannaus Date: 2010-09-03 08:16:59 +0000 (Fri, 03 Sep 2010) Log Message: ----------- [dev] some changes for the improvement of airsched. Modified Paths: -------------- trunk/stdair/stdair/bom/BomManager.hpp trunk/stdair/stdair/bom/RelationShip.hpp Modified: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp 2010-08-29 20:54:34 UTC (rev 299) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-09-03 08:16:59 UTC (rev 300) @@ -22,6 +22,14 @@ template <typename CHILD, typename PARENT> static std::map<const MapKey_T, CHILD*>& getMap (const PARENT&); + /** Get the map of parent and children holder. */ + template <typename PARENT, typename CHILD> + static const std::map<const PARENT*, + std::list<CHILD*> >& getParentChildrenList(); + template <typename PARENT, typename CHILD> + static const std::map<const PARENT*, + std::map<const MapKey_T, CHILD*> >& getParentChildrenMap(); + /** Check if the list/map of children has been initialised. */ template <typename CHILD, typename PARENT> static bool hasList (const PARENT&); @@ -38,10 +46,16 @@ If such a CHILD does not exist, return NULL. */ template <typename CHILD, typename PARENT> static CHILD* getChildPtr (const PARENT&, const MapKey_T&); + template <typename BOM> + static BOM* const getObjectPtr (const std::map<const MapKey_T, BOM*>&, + const MapKey_T&); /** Return the CHILD corresponding the the given string key. */ template <typename CHILD, typename PARENT> static CHILD& getChild (const PARENT&, const MapKey_T&); + template <typename BOM> + static BOM& getObject (const std::map<const MapKey_T, BOM*>&, + const MapKey_T&); }; // //////////////////////////////////////////////////////////////////// @@ -65,6 +79,20 @@ } // //////////////////////////////////////////////////////////////////// + template <typename PARENT, typename CHILD> + const std::map<const PARENT*, std::list<CHILD*> >& BomManager:: + getParentChildrenList() { + return RelationShip<PARENT, CHILD>::instance().getParentChildrenList(); + } + + // //////////////////////////////////////////////////////////////////// + template <typename PARENT, typename CHILD> + const std::map<const PARENT*, std::map<const MapKey_T, CHILD*> >& BomManager:: + getParentChildrenMap() { + return RelationShip<PARENT, CHILD>::instance().getParentChildrenMap(); + } + + // //////////////////////////////////////////////////////////////////// template <typename CHILD, typename PARENT> bool BomManager::hasList (const PARENT& iParent) { return RelationShip<PARENT, CHILD>::instance().hasChildrenList (iParent); @@ -100,6 +128,30 @@ CHILD& BomManager::getChild (const PARENT& iParent, const MapKey_T& iKey) { return RelationShip<PARENT, CHILD>::instance().getChild (iParent, iKey); } + + // //////////////////////////////////////////////////////////////////// + template <typename BOM> + BOM* const BomManager::getObjectPtr (const std::map<const MapKey_T,BOM*>& iMap, + const MapKey_T& iKey) { + typename std::map<const MapKey_T, BOM*>::const_iterator it = iMap.find (iKey); + if (it == iMap.end()) { + return NULL; + } + BOM* const oBom_ptr = it->second; + assert (oBom_ptr != NULL); + return oBom_ptr; + } + + // //////////////////////////////////////////////////////////////////// + template <typename BOM> + BOM& BomManager::getObject (const std::map<const MapKey_T, BOM*>& iMap, + const MapKey_T& iKey) { + typename std::map<const MapKey_T, BOM*>::const_iterator it = iMap.find (iKey); + assert (it != iMap.end()); + BOM* const oBom_ptr = it->second; + assert (oBom_ptr != NULL); + return *oBom_ptr; + } } #endif // __STDAIR_BOM_BOMMANAGER_HPP Modified: trunk/stdair/stdair/bom/RelationShip.hpp =================================================================== --- trunk/stdair/stdair/bom/RelationShip.hpp 2010-08-29 20:54:34 UTC (rev 299) +++ trunk/stdair/stdair/bom/RelationShip.hpp 2010-09-03 08:16:59 UTC (rev 300) @@ -49,6 +49,10 @@ ChildrenDetailedList_T& getChildrenDetailedList (const PARENT&); ChildrenMap_T& getChildrenMap (const PARENT&); + /** Getter of the attribute holders. */ + const ParentChildrentList_T& getParentChildrenList (); + const ParentChildrentMap_T& getParentChildrenMap (); + /** Getter of the PARENT given the CHILD. */ PARENT& getParent (const CHILD&); @@ -157,6 +161,20 @@ } // //////////////////////////////////////////////////////////////////// + template <typename PARENT, typename CHILD> + const typename RelationShip<PARENT, CHILD>::ParentChildrentList_T& + RelationShip<PARENT, CHILD>::getParentChildrenList () { + return instance()._parentChildrenList; + } + + // //////////////////////////////////////////////////////////////////// + template <typename PARENT, typename CHILD> + const typename RelationShip<PARENT, CHILD>::ParentChildrentMap_T& + RelationShip<PARENT, CHILD>::getParentChildrenMap () { + return instance()._parentChildrenMap; + } + + // //////////////////////////////////////////////////////////////////// template <typename PARENT, typename CHILD> bool RelationShip<PARENT, CHILD>:: hasChildrenList (const PARENT& iParent) { ParentChildrentList_T& lParentChildrenList = instance()._parentChildrenList; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gsa...@us...> - 2010-10-13 16:04:06
|
Revision: 342 http://stdair.svn.sourceforge.net/stdair/?rev=342&view=rev Author: gsabatier Date: 2010-10-13 16:04:00 +0000 (Wed, 13 Oct 2010) Log Message: ----------- Added the FareFamily class Modified Paths: -------------- trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/FareFamily.cpp trunk/stdair/stdair/bom/FareFamily.hpp trunk/stdair/stdair/bom/FareFamilyKey.cpp trunk/stdair/stdair/bom/FareFamilyKey.hpp trunk/stdair/stdair/bom/FareFamilyTypes.hpp Added: trunk/stdair/stdair/bom/FareFamily.cpp =================================================================== --- trunk/stdair/stdair/bom/FareFamily.cpp (rev 0) +++ trunk/stdair/stdair/bom/FareFamily.cpp 2010-10-13 16:04:00 UTC (rev 342) @@ -0,0 +1,30 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/basic/BasConst_Yield.hpp> +#include <stdair/bom/FareFamily.hpp> + +namespace stdair { + + + // //////////////////////////////////////////////////////////////////// + FareFamily::FareFamily (const Key_T& iKey) : _key (iKey), _parent (NULL) { + } + + // //////////////////////////////////////////////////////////////////// + FareFamily::~FareFamily () { + } + + // //////////////////////////////////////////////////////////////////// + std::string FareFamily::toString() const { + std::ostringstream oStr; + oStr << describeKey(); + return oStr.str(); + } + +} + + Added: trunk/stdair/stdair/bom/FareFamily.hpp =================================================================== --- trunk/stdair/stdair/bom/FareFamily.hpp (rev 0) +++ trunk/stdair/stdair/bom/FareFamily.hpp 2010-10-13 16:04:00 UTC (rev 342) @@ -0,0 +1,71 @@ +#ifndef __STDAIR_BOM_FAREFAMILY_HPP +#define __STDAIR_BOM_FAREFAMILY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomAbstract.hpp> +#include <stdair/bom/FareFamilyKey.hpp> +#include <stdair/bom/FareFamilyTypes.hpp> + +namespace stdair { + + /** Class representing the actual attributes for a family fare. */ + class FareFamily : public BomAbstract { + template <typename BOM> friend class FacBom; + friend class FacBomManager; + + public: + // Type definitions. + /** Definition allowing to retrieve the associated BOM key type. */ + typedef FareFamilyKey Key_T; + + public: + // /////////// Getters //////////// + /** Get the family fare key. */ + const Key_T& getKey() const { return _key; } + + /** Get the family fare code (part of the primary key). */ + const FamilyCode_T& getFamilyCode() const { return _key.getFamilyCode(); } + + /** Get the parent object. */ + BomAbstract* const getParent() const { return _parent; } + + /** Get the map of children holders. */ + const HolderMap_T& getHolderMap() const { return _holderMap; } + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { ioOut << toString(); } + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn) { } + + /** Get the serialised version of the Business Object. */ + std::string toString() const; + + /** Get a string describing the key. */ + const std::string describeKey() const { return _key.toString(); } + + protected: + /** Default constructors. */ + FareFamily (const Key_T&); + FareFamily (const FareFamily&); + /** Destructor. */ + ~FareFamily(); + + public: + // Attributes + Key_T _key; + BomAbstract* _parent; + HolderMap_T _holderMap; + + }; + +} +#endif // __STDAIR_BOM_FAREFAMILY_HPP + Added: trunk/stdair/stdair/bom/FareFamilyKey.cpp =================================================================== --- trunk/stdair/stdair/bom/FareFamilyKey.cpp (rev 0) +++ trunk/stdair/stdair/bom/FareFamilyKey.cpp 2010-10-13 16:04:00 UTC (rev 342) @@ -0,0 +1,34 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/FareFamilyKey.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + FareFamilyKey::FareFamilyKey (const FamilyCode_T& iFamilyCode) + : _familyCode (iFamilyCode) { + } + + // //////////////////////////////////////////////////////////////////// + FareFamilyKey::~FareFamilyKey () { + } + + // //////////////////////////////////////////////////////////////////// + void FareFamilyKey::toStream (std::ostream& ioOut) const { + ioOut << "FareFamilyKey: " << toString() << std::endl; + } + + // //////////////////////////////////////////////////////////////////// + void FareFamilyKey::fromStream (std::istream& ioIn) { + } + + // //////////////////////////////////////////////////////////////////// + const std::string FareFamilyKey::toString() const { + std::ostringstream oStr; + oStr << _familyCode; + return oStr.str(); + } + +} Added: trunk/stdair/stdair/bom/FareFamilyKey.hpp =================================================================== --- trunk/stdair/stdair/bom/FareFamilyKey.hpp (rev 0) +++ trunk/stdair/stdair/bom/FareFamilyKey.hpp 2010-10-13 16:04:00 UTC (rev 342) @@ -0,0 +1,49 @@ +#ifndef __STDAIR_BOM_FAREFAMILYKEY_HPP +#define __STDAIR_BOM_FAREFAMILYKEY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/KeyAbstract.hpp> + +namespace stdair { + /** Key of fare family. */ + struct FareFamilyKey : public KeyAbstract { + + public: + // /////////// Construction /////////// + /** Constructor. */ + FareFamilyKey (const FamilyCode_T& iFamilyCode); + /** Destructor. */ + ~FareFamilyKey (); + + // /////////// Getters ////////// + /** Get the family code. */ + const FamilyCode_T& getFamilyCode () const { + return _familyCode; + } + + // /////////// Display support methods ///////// + /** Dump a Business Object Key into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** Read a Business Object Key from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn); + + /** Get the serialised version of the Business Object Key. + <br>That string is unique, at the level of a given Business Object, + when among children of a given parent Business Object. + */ + const std::string toString() const; + + private: + // Attributes + /** Family code. */ + FamilyCode_T _familyCode; + }; + +} +#endif // __STDAIR_BOM_FAREFAMILYKEY_HPP Added: trunk/stdair/stdair/bom/FareFamilyTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/FareFamilyTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/FareFamilyTypes.hpp 2010-10-13 16:04:00 UTC (rev 342) @@ -0,0 +1,25 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_FAREFAMILYTYPES_HPP +#define __STDAIR_BOM_FAREFAMILYTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <map> +#include <list> +// STDAIR +#include <stdair/STDAIR_Types.hpp> + +namespace stdair { + + // Forward declarations. + class FareFamily; + + /** Define the fare family list. */ + typedef std::list<FareFamily*> FareFamilyList_T; + + /** Define the fare family map. */ + typedef std::map<const MapKey_T, FareFamily*> FareFamilyMap_T; +} +#endif // __STDAIR_BOM_FAREFAMILYTYPES_HPP Modified: trunk/stdair/stdair/bom/sources.mk =================================================================== --- trunk/stdair/stdair/bom/sources.mk 2010-10-13 13:28:20 UTC (rev 341) +++ trunk/stdair/stdair/bom/sources.mk 2010-10-13 16:04:00 UTC (rev 342) @@ -11,6 +11,7 @@ $(top_srcdir)/stdair/bom/LegCabinKey.hpp \ $(top_srcdir)/stdair/bom/SegmentDateKey.hpp \ $(top_srcdir)/stdair/bom/SegmentCabinKey.hpp \ + $(top_srcdir)/stdair/bom/FareFamilyKey.hpp \ $(top_srcdir)/stdair/bom/BookingClassKey.hpp \ $(top_srcdir)/stdair/bom/BucketKey.hpp \ $(top_srcdir)/stdair/bom/FlightPeriodKey.hpp \ @@ -21,6 +22,7 @@ $(top_srcdir)/stdair/bom/SegmentDateTypes.hpp \ $(top_srcdir)/stdair/bom/LegDateTypes.hpp \ $(top_srcdir)/stdair/bom/SegmentCabinTypes.hpp \ + $(top_srcdir)/stdair/bom/FareFamilyTypes.hpp \ $(top_srcdir)/stdair/bom/LegCabinTypes.hpp \ $(top_srcdir)/stdair/bom/BookingClassTypes.hpp \ $(top_srcdir)/stdair/bom/BucketTypes.hpp \ @@ -38,6 +40,7 @@ $(top_srcdir)/stdair/bom/SegmentDate.hpp \ $(top_srcdir)/stdair/bom/LegDate.hpp \ $(top_srcdir)/stdair/bom/SegmentCabin.hpp \ + $(top_srcdir)/stdair/bom/FareFamily.hpp \ $(top_srcdir)/stdair/bom/LegCabin.hpp \ $(top_srcdir)/stdair/bom/BookingClass.hpp \ $(top_srcdir)/stdair/bom/Bucket.hpp \ @@ -64,6 +67,7 @@ $(top_srcdir)/stdair/bom/LegCabinKey.cpp \ $(top_srcdir)/stdair/bom/SegmentDateKey.cpp \ $(top_srcdir)/stdair/bom/SegmentCabinKey.cpp \ + $(top_srcdir)/stdair/bom/FareFamilyKey.cpp \ $(top_srcdir)/stdair/bom/BookingClassKey.cpp \ $(top_srcdir)/stdair/bom/BucketKey.cpp \ $(top_srcdir)/stdair/bom/FlightPeriodKey.cpp \ @@ -75,6 +79,7 @@ $(top_srcdir)/stdair/bom/SegmentDate.cpp \ $(top_srcdir)/stdair/bom/LegDate.cpp \ $(top_srcdir)/stdair/bom/SegmentCabin.cpp \ + $(top_srcdir)/stdair/bom/FareFamily.cpp \ $(top_srcdir)/stdair/bom/LegCabin.cpp \ $(top_srcdir)/stdair/bom/BookingClass.cpp \ $(top_srcdir)/stdair/bom/Bucket.cpp \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |