From: <den...@us...> - 2010-08-08 16:01:14
|
Revision: 262 http://stdair.svn.sourceforge.net/stdair/?rev=262&view=rev Author: denis_arnaud Date: 2010-08-08 16:01:06 +0000 (Sun, 08 Aug 2010) Log Message: ----------- [Dev] Made the code compatible with g++ 4.1 and Boost 1.33 compilation (though, there is still some work to replace the corresponding Boost features). Modified Paths: -------------- trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/DemandStreamContent.cpp trunk/stdair/stdair/bom/DoWStruct.cpp trunk/stdair/stdair/bom/SegmentPathPeriodKey.cpp trunk/stdair/stdair/bom/SegmentPeriodContent.cpp trunk/stdair/stdair/factory/FacBomContent.hpp Modified: trunk/stdair/stdair/bom/BomManager.cpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.cpp 2010-08-07 19:21:59 UTC (rev 261) +++ trunk/stdair/stdair/bom/BomManager.cpp 2010-08-08 16:01:06 UTC (rev 262) @@ -5,6 +5,7 @@ #include <cassert> #include <ostream> // StdAir +#include <stdair/STDAIR_Types.hpp> #include <stdair/basic/BasConst_BomManager.hpp> #include <stdair/bom/BomSource.hpp> #include <stdair/bom/BookingRequestStruct.hpp> @@ -109,20 +110,20 @@ for (LegDateList_T::iterator itLD = lLDList.begin(); itLD != lLDList.end(); ++itLD) { const LegDate& lCurrentLD = *itLD; - - oStream << iFlightDate.getFlightNumber() - << " (" << iFlightDate.getFlightDate() << "), " - << lCurrentLD.getBoardingPoint() << "-" - << lCurrentLD.getOffPoint() << ", " - << lCurrentLD.getBoardingDate() << " -> " - << lCurrentLD.getOffDate() << " / " - << lCurrentLD.getDateOffset() << ", " - << lCurrentLD.getBoardingTime() << " -> " - << lCurrentLD.getOffTime() << " (" - << lCurrentLD.getTimeOffset() << ") / " - << lCurrentLD.getElapsedTime() << ", " - << lCurrentLD.getDistance() << ", " - << lCurrentLD.getCapacity() << ", " + const DateOffset_T lDateOffset = lCurrentLD.getDateOffset(); + oStream << iFlightDate.getFlightNumber(); + oStream << " (" << iFlightDate.getFlightDate() << "), "; + oStream << lCurrentLD.getBoardingPoint() << "-"; + oStream << lCurrentLD.getOffPoint() << ", "; + oStream << lCurrentLD.getBoardingDate() << " -> "; + oStream << lCurrentLD.getOffDate() << " / "; + oStream << lDateOffset.days() << ", "; + oStream << lCurrentLD.getBoardingTime() << " -> "; + oStream << lCurrentLD.getOffTime() << " ("; + oStream << lCurrentLD.getTimeOffset() << ") / "; + oStream << lCurrentLD.getElapsedTime() << ", "; + oStream << lCurrentLD.getDistance() << ", "; + oStream << lCurrentLD.getCapacity() << ", " << std::endl; } oStream << "******************************************" << std::endl; @@ -243,13 +244,14 @@ for (SegmentCabinList_T::iterator itSC = lSCList.begin(); itSC != lSCList.end(); ++itSC) { const SegmentCabin& lCurrentSC = *itSC; + const DateOffset_T lDateOffset = lCurrentSD.getDateOffset(); oStream << lCurrentSD.getBoardingPoint() << "-" << lCurrentSD.getOffPoint() << ", " << lCurrentSC.getCabinCode() << ", " << lCurrentSD.getBoardingDate() << " -> " << lCurrentSD.getOffDate() << " / " - << lCurrentSD.getDateOffset() << ", " + << lDateOffset.days() << ", " << lCurrentSD.getBoardingTime() << " -> " << lCurrentSD.getOffTime() << " (" << lCurrentSD.getTimeOffset() << ") / " Modified: trunk/stdair/stdair/bom/DemandStreamContent.cpp =================================================================== --- trunk/stdair/stdair/bom/DemandStreamContent.cpp 2010-08-07 19:21:59 UTC (rev 261) +++ trunk/stdair/stdair/bom/DemandStreamContent.cpp 2010-08-08 16:01:06 UTC (rev 262) @@ -6,10 +6,8 @@ #include <iosfwd> #include <ostream> #include <sstream> -// Boost -#include <boost/math/distributions/normal.hpp> // Math -#include <math.h> +#include <cmath> // STDAIR #include <stdair/basic/BasConst_General.hpp> #include <stdair/bom/DemandStreamContent.hpp> Modified: trunk/stdair/stdair/bom/DoWStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/DoWStruct.cpp 2010-08-07 19:21:59 UTC (rev 261) +++ trunk/stdair/stdair/bom/DoWStruct.cpp 2010-08-08 16:01:06 UTC (rev 262) @@ -80,7 +80,7 @@ // //////////////////////////////////////////////////////////////////// void DoWStruct_T::setDayOfWeek (const unsigned short i, const bool iBool) { - assert (i >= 0 && i < 7); + assert (i < 7); _dowList.at (i) = iBool; } Modified: trunk/stdair/stdair/bom/SegmentPathPeriodKey.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentPathPeriodKey.cpp 2010-08-07 19:21:59 UTC (rev 261) +++ trunk/stdair/stdair/bom/SegmentPathPeriodKey.cpp 2010-08-08 16:01:06 UTC (rev 262) @@ -51,7 +51,8 @@ for (DateOffsetList_T::const_iterator itOffset = _boardingDateOffsetList.begin(); itOffset != _boardingDateOffsetList.end(); ++itOffset) { - oStr << *itOffset << ", "; + const DateOffset_T& lDateOffset = *itOffset; + oStr << lDateOffset.days() << ", "; } oStr << _nbOfAirlines ; Modified: trunk/stdair/stdair/bom/SegmentPeriodContent.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentPeriodContent.cpp 2010-08-07 19:21:59 UTC (rev 261) +++ trunk/stdair/stdair/bom/SegmentPeriodContent.cpp 2010-08-08 16:01:06 UTC (rev 262) @@ -11,7 +11,7 @@ // //////////////////////////////////////////////////////////////////// SegmentPeriodContent::SegmentPeriodContent (const Key_T& iKey) - : _key (iKey) { + : _key (iKey), _boardingDateOffset (0), _offDateOffset (0) { } // //////////////////////////////////////////////////////////////////// @@ -23,9 +23,9 @@ addCabinBookingClassList (const CabinCode_T& iCabinCode, const ClassList_String_T& iClassCodeList) { const bool insert = _cabinBookingClassMap. - insert (CabinBookingClassMap_T::value_type (iCabinCode, iClassCodeList)).second; - assert (insert == true); + insert (CabinBookingClassMap_T::value_type (iCabinCode, + iClassCodeList)).second; + assert (insert == true); } } - Modified: trunk/stdair/stdair/factory/FacBomContent.hpp =================================================================== --- trunk/stdair/stdair/factory/FacBomContent.hpp 2010-08-07 19:21:59 UTC (rev 261) +++ trunk/stdair/stdair/factory/FacBomContent.hpp 2010-08-08 16:01:06 UTC (rev 262) @@ -10,6 +10,10 @@ #include <boost/version.hpp> #if BOOST_VERSION >= 103500 #include <boost/fusion/include/at_key.hpp> +#else // BOOST_VERSION >= 103500 +/** \todo Find a better alternative for boost::fusion::at_key() + for Boost 1.33 */ +#include <boost/spirit/fusion/iterator/next.hpp> #endif // BOOST_VERSION >= 103500 // StdAir #include <stdair/STDAIR_Types.hpp> @@ -124,6 +128,7 @@ template <typename PARENT, typename CHILD> static void cloneChildrenHolder (PARENT& ioParent, const PARENT& iReferenceParent) { +#if BOOST_VERSION >= 103500 // Clone the list of children. typedef BomChildrenHolderImp<CHILD> CHILDREN_HOLDER_T; CHILDREN_HOLDER_T*& lChildrenHolder_ptr = @@ -135,6 +140,7 @@ FacBomStructure:: cloneChildrenHolder (lChildrenHolder_ptr, *lReferenceChildrenHolder_ptr); +#endif // BOOST_VERSION >= 103500 } private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |