You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
(51) |
Nov
(8) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(32) |
Feb
(47) |
Mar
(6) |
Apr
(19) |
May
(7) |
Jun
(19) |
Jul
(39) |
Aug
(51) |
Sep
(39) |
Oct
(18) |
Nov
(10) |
Dec
(27) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <den...@us...> - 2009-10-14 14:33:48
|
Revision: 45 http://stdair.svn.sourceforge.net/stdair/?rev=45&view=rev Author: denis_arnaud Date: 2009-10-14 14:33:39 +0000 (Wed, 14 Oct 2009) Log Message: ----------- [Test] Added tests on the inheritance mechanism. Modified Paths: -------------- trunk/stdair/configure.ac trunk/stdair/test/Makefile.am Added Paths: ----------- trunk/stdair/test/inheritance/ trunk/stdair/test/inheritance/Makefile.am trunk/stdair/test/inheritance/inherit.cpp Modified: trunk/stdair/configure.ac =================================================================== --- trunk/stdair/configure.ac 2009-10-13 07:52:49 UTC (rev 44) +++ trunk/stdair/configure.ac 2009-10-14 14:33:39 UTC (rev 45) @@ -4,7 +4,7 @@ AC_COPYRIGHT([Copyright (C) 2007-2009 Denis Arnaud <den...@us...>]) AC_INIT([STDAIR],[0.1.0],[den...@us...],[stdair]) AC_CONFIG_HEADER([stdair/config.h]) -AC_CONFIG_SRCDIR([stdair/bom/BomKey.cpp]) +AC_CONFIG_SRCDIR([stdair/bom/BomKey.hpp]) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE AM_PATH_CPPUNIT(1.10) @@ -202,6 +202,7 @@ doc/sourceforge/howto_release_stdair.html test/Makefile test/com/Makefile + test/inheritance/Makefile test/mpl/Makefile test/mpl/book/Makefile) AC_OUTPUT Modified: trunk/stdair/test/Makefile.am =================================================================== --- trunk/stdair/test/Makefile.am 2009-10-13 07:52:49 UTC (rev 44) +++ trunk/stdair/test/Makefile.am 2009-10-14 14:33:39 UTC (rev 45) @@ -4,7 +4,7 @@ MAINTAINERCLEANFILES = Makefile.in ## -SUBDIRS = com mpl +SUBDIRS = com inheritance mpl EXTRA_DIST = ## Property changes on: trunk/stdair/test/inheritance ___________________________________________________________________ Added: svn:ignore + .deps .libs Makefile Makefile.in inherit Added: svn:propedit + Added: trunk/stdair/test/inheritance/Makefile.am =================================================================== --- trunk/stdair/test/inheritance/Makefile.am (rev 0) +++ trunk/stdair/test/inheritance/Makefile.am 2009-10-14 14:33:39 UTC (rev 45) @@ -0,0 +1,14 @@ +## test/inheritance sub-directory +include $(top_srcdir)/Makefile.common + +MAINTAINERCLEANFILES = Makefile.in + +SUBDIRS = + +check_PROGRAMS = inherit + +inherit_SOURCES = inherit.cpp +inherit_CXXFLAGS = $(BOOST_CFLAGS) +inherit_LDADD = $(BOOST_LIB) + +EXTRA_DIST = Added: trunk/stdair/test/inheritance/inherit.cpp =================================================================== --- trunk/stdair/test/inheritance/inherit.cpp (rev 0) +++ trunk/stdair/test/inheritance/inherit.cpp 2009-10-14 14:33:39 UTC (rev 45) @@ -0,0 +1,81 @@ +// STL +#include <cassert> +#include <iostream> +#include <string> + +// //////////////////////////////////// +typedef unsigned int Size_T; +typedef std::pair<Size_T, Size_T> RectangleSize_T; + +// //////////////////////////////////// +/** Rectangle */ +struct Rectangle { + + /** Constructor */ + Rectangle (const Size_T& iWidth, const Size_T& iHeight) + : _width (iWidth), _height (iHeight) { } + /** Destructor */ + virtual ~Rectangle () { } + + /** Get the size. */ + RectangleSize_T getSize() const { + return RectangleSize_T (_width, _height); + } + + /** Display. When the object is actually inherits from Rectangle, + the display() method actually called is the one of the + inheriting object. */ + virtual void display () const { + std::cout << "Hello, I am a rectangle of size (" << _width << " x " + << _height << ")" << std::endl; + } + + // //////// Attributes ///////// + /** Width, Height */ + Size_T _width; + Size_T _height; +}; + +/** Square */ +struct Square : public Rectangle { + + /** Constructor */ + Square (const Size_T& iWidth) : Rectangle (iWidth, iWidth) { } + /** Destructor */ + virtual ~Square () { } + + /** Get the size. That method overshadows the Rectangle::getSize() one. */ + Size_T getSize() const { + return _width; + } + + /** Display */ + void display () const { + std::cout << "Hello, I am a square of size (" << _width << ")" + << std::endl; + } +}; + + +// ////////// M A I N ////////////// +int main (int argc, char* argv[]) { + + Square lSquare (10); + lSquare.display(); + const Size_T& lSquareSize = lSquare.getSize(); + std::cout << " and my size is: " << lSquareSize << std::endl; + + Rectangle& lRectangle = lSquare; + lRectangle.display(); + const RectangleSize_T& lRectangleSize = lRectangle.getSize(); + std::cout << " and my size is: " << lRectangleSize.first << " x " + << lRectangleSize.second << std::endl; + + Rectangle lRectangleCopy = lSquare; + lRectangleCopy.display(); + const RectangleSize_T& lRectangleCopySize = lRectangleCopy.getSize(); + std::cout << " and my size is: " << lRectangleCopySize.first << " x " + << lRectangleCopySize.second << std::endl; + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-13 07:52:57
|
Revision: 44 http://stdair.svn.sourceforge.net/stdair/?rev=44&view=rev Author: quannaus Date: 2009-10-13 07:52:49 +0000 (Tue, 13 Oct 2009) Log Message: ----------- [Dev] Some changed in the BomContentList and BomContentMap implementation. Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp trunk/stdair/stdair/bom/BookingClassList.cpp trunk/stdair/stdair/bom/BookingClassList.hpp trunk/stdair/stdair/bom/BookingClassMap.cpp trunk/stdair/stdair/bom/BookingClassMap.hpp trunk/stdair/stdair/bom/FlightDate.cpp trunk/stdair/stdair/bom/FlightDateList.cpp trunk/stdair/stdair/bom/FlightDateList.hpp trunk/stdair/stdair/bom/FlightDateMap.cpp trunk/stdair/stdair/bom/FlightDateMap.hpp trunk/stdair/stdair/bom/FlightDateStructure.hpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/InventoryList.cpp trunk/stdair/stdair/bom/InventoryList.hpp trunk/stdair/stdair/bom/InventoryMap.cpp trunk/stdair/stdair/bom/InventoryMap.hpp trunk/stdair/stdair/bom/InventoryStructure.hpp trunk/stdair/stdair/bom/LegCabinList.cpp trunk/stdair/stdair/bom/LegCabinList.hpp trunk/stdair/stdair/bom/LegCabinMap.cpp trunk/stdair/stdair/bom/LegCabinMap.hpp trunk/stdair/stdair/bom/LegDate.cpp trunk/stdair/stdair/bom/LegDateList.cpp trunk/stdair/stdair/bom/LegDateList.hpp trunk/stdair/stdair/bom/LegDateMap.cpp trunk/stdair/stdair/bom/LegDateMap.hpp trunk/stdair/stdair/bom/LegDateStructure.hpp trunk/stdair/stdair/bom/SegmentCabin.cpp trunk/stdair/stdair/bom/SegmentCabinList.cpp trunk/stdair/stdair/bom/SegmentCabinList.hpp trunk/stdair/stdair/bom/SegmentCabinMap.cpp trunk/stdair/stdair/bom/SegmentCabinMap.hpp trunk/stdair/stdair/bom/SegmentCabinStructure.hpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentDateList.cpp trunk/stdair/stdair/bom/SegmentDateList.hpp trunk/stdair/stdair/bom/SegmentDateMap.cpp trunk/stdair/stdair/bom/SegmentDateMap.hpp trunk/stdair/stdair/bom/SegmentDateStructure.hpp Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -79,7 +79,7 @@ // /////////// Iteration methods ////////// /** Initialise the internal iterators on bom objects: return the iterator at the begining of the list. */ - ListIterator_T listBegin () { + ListIterator_T listBegin () const { return ListIterator_T(_bomChildrenOrderedList.begin()); } Modified: trunk/stdair/stdair/bom/BookingClassList.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassList.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/BookingClassList.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -4,9 +4,7 @@ // STL #include <cassert> // STDAIR -#include <stdair/bom/SegmentCabinStructure.hpp> -#include <stdair/bom/SegmentDate.hpp> -#include <stdair/bom/SegmentCabin.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/BookingClass.hpp> #include <stdair/bom/BookingClassList.hpp> @@ -14,14 +12,14 @@ // //////////////////////////////////////////////////////////////////// BookingClassList_T:: - BookingClassList_T (const SegmentCabinStructure_T& iSegmentCabinStructure) - : _segmentCabinStructure (iSegmentCabinStructure) { + BookingClassList_T (const BookingClassHolder_T& iBookingClassHolder) + : _bookingClassHolder (iBookingClassHolder) { } // //////////////////////////////////////////////////////////////////// BookingClassList_T:: - BookingClassList_T (const BookingClassList_T& iSCList) - : _segmentCabinStructure (iSCList._segmentCabinStructure) { + BookingClassList_T (const BookingClassList_T& iBCList) + : _bookingClassHolder (iBCList._bookingClassHolder) { } // //////////////////////////////////////////////////////////////////// @@ -30,22 +28,22 @@ // ////////////////////////////////////////////////////////////////////// BookingClassList_T::iterator BookingClassList_T::begin () const { - return _segmentCabinStructure.bookingClassListBegin (); + return _bookingClassHolder.listBegin (); } // ////////////////////////////////////////////////////////////////////// BookingClassList_T::iterator BookingClassList_T::end () const { - return _segmentCabinStructure.bookingClassListEnd (); + return _bookingClassHolder.listEnd (); } // ////////////////////////////////////////////////////////////////////// BookingClassList_T::reverse_iterator BookingClassList_T::rbegin () const { - return _segmentCabinStructure.bookingClassListRBegin (); + return _bookingClassHolder.listRBegin (); } // ////////////////////////////////////////////////////////////////////// BookingClassList_T::reverse_iterator BookingClassList_T::rend () const { - return _segmentCabinStructure.bookingClassListREnd (); + return _bookingClassHolder.listREnd (); } } Modified: trunk/stdair/stdair/bom/BookingClassList.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassList.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/BookingClassList.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -5,14 +5,16 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/SegmentCabinTypes.hpp> #include <stdair/bom/BookingClassTypes.hpp> namespace stdair { -// Forward declarations + + // Forward declarations template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - - /** Structure which handles the iterators for a segment-cabin list. */ + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class BookingClass; + + /** Structure which handles the iterators for a booking class list. */ struct BookingClassList_T { public: @@ -20,28 +22,31 @@ // See the explanations, within the stdair::BomContentRoot class, for all // the iterator types specified below // ///////////////////////////////////////////////////////////////////////// - /** Define the segment-cabin list iterators. */ + /** Define the booking class list iterators. */ typedef BomIterator_T<BookingClass, BookingClassStructureList_T::const_iterator> iterator; typedef BomIterator_T<BookingClass, BookingClassStructureList_T::const_reverse_iterator> reverse_iterator; // ///////////////////////////////////////////////////////////////////////// - + + /** Define the booking class holder. */ + typedef BomChildrenHolderImp<BookingClass> BookingClassHolder_T; + public: // /////////// Iteration methods ////////// - /** Initialise the internal iterator on segment cabin: + /** Initialise the internal iterator on flight date: return the iterator at the begining of the list. */ iterator begin () const; - /** Initialise the internal iterator on segment cabin: + /** Initialise the internal iterator on flight date: return the iterator at the end of the list. */ iterator end () const; - /** Initialise the internal reverse iterator on segment cabin: + /** Initialise the internal reverse iterator on flight date: return the reverse iterator at the rbegining of the list. */ reverse_iterator rbegin () const; - /** Initialise the internal reverse iterator on segment cabin: + /** Initialise the internal reverse iterator on flight date: return the reverse iterator at the end of the list. */ reverse_iterator rend () const; @@ -49,7 +54,7 @@ /** Default constructors. */ BookingClassList_T (); BookingClassList_T (const BookingClassList_T&); - BookingClassList_T (const SegmentCabinStructure_T&); + BookingClassList_T (const BookingClassHolder_T&); /** Destructor. */ virtual ~BookingClassList_T(); @@ -57,7 +62,7 @@ private: // Attributes /** Reference structure. */ - const SegmentCabinStructure_T& _segmentCabinStructure; + const BookingClassHolder_T& _bookingClassHolder; }; } Modified: trunk/stdair/stdair/bom/BookingClassMap.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassMap.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/BookingClassMap.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -4,9 +4,7 @@ // STL #include <cassert> // STDAIR -#include <stdair/bom/SegmentCabinStructure.hpp> -#include <stdair/bom/SegmentDate.hpp> -#include <stdair/bom/SegmentCabin.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/BookingClass.hpp> #include <stdair/bom/BookingClassMap.hpp> @@ -14,14 +12,14 @@ // //////////////////////////////////////////////////////////////////// BookingClassMap_T:: - BookingClassMap_T (const SegmentCabinStructure_T& iSegmentCabinStructure) - : _segmentCabinStructure (iSegmentCabinStructure) { + BookingClassMap_T (const BookingClassHolder_T& iBookingClassHolder) + : _bookingClassHolder (iBookingClassHolder) { } // //////////////////////////////////////////////////////////////////// BookingClassMap_T:: - BookingClassMap_T (const BookingClassMap_T& iSCMap) - : _segmentCabinStructure (iSCMap._segmentCabinStructure) { + BookingClassMap_T (const BookingClassMap_T& iBCMap) + : _bookingClassHolder (iBCMap._bookingClassHolder) { } // //////////////////////////////////////////////////////////////////// @@ -30,22 +28,22 @@ // ////////////////////////////////////////////////////////////////////// BookingClassMap_T::iterator BookingClassMap_T::begin () const { - return _segmentCabinStructure.bookingClassMapBegin (); + return _bookingClassHolder.mapBegin (); } // ////////////////////////////////////////////////////////////////////// BookingClassMap_T::iterator BookingClassMap_T::end () const { - return _segmentCabinStructure.bookingClassMapEnd (); + return _bookingClassHolder.mapEnd (); } // ////////////////////////////////////////////////////////////////////// BookingClassMap_T::reverse_iterator BookingClassMap_T::rbegin () const { - return _segmentCabinStructure.bookingClassMapRBegin (); + return _bookingClassHolder.mapRBegin (); } // ////////////////////////////////////////////////////////////////////// BookingClassMap_T::reverse_iterator BookingClassMap_T::rend () const { - return _segmentCabinStructure.bookingClassMapREnd (); + return _bookingClassHolder.mapREnd (); } } Modified: trunk/stdair/stdair/bom/BookingClassMap.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassMap.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/BookingClassMap.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -5,14 +5,16 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/SegmentCabinTypes.hpp> #include <stdair/bom/BookingClassTypes.hpp> namespace stdair { -// Forward declarations + + // Forward declarations template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - - /** Structure which handles the iterators for a segment-cabin map. */ + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class BookingClass; + + /** Structure which handles the iterators for a booking class map. */ struct BookingClassMap_T { public: @@ -20,28 +22,31 @@ // See the explanations, within the stdair::BomContentRoot class, for all // the iterator types specified below // ///////////////////////////////////////////////////////////////////////// - /** Define the segment-cabin map iterators. */ + /** Define the booking class map iterators. */ typedef BomIterator_T<BookingClass, BookingClassStructureMap_T::const_iterator> iterator; typedef BomIterator_T<BookingClass, BookingClassStructureMap_T::const_reverse_iterator> reverse_iterator; // ///////////////////////////////////////////////////////////////////////// - + + /** Define the booking class holder. */ + typedef BomChildrenHolderImp<BookingClass> BookingClassHolder_T; + public: // /////////// Iteration methods ////////// - /** Initialise the internal iterator on segment cabin: + /** Initialise the internal iterator on flight date: return the iterator at the begining of the map. */ iterator begin () const; - /** Initialise the internal iterator on segment cabin: + /** Initialise the internal iterator on flight date: return the iterator at the end of the map. */ iterator end () const; - /** Initialise the internal reverse iterator on segment cabin: + /** Initialise the internal reverse iterator on flight date: return the reverse iterator at the rbegining of the map. */ reverse_iterator rbegin () const; - /** Initialise the internal reverse iterator on segment cabin: + /** Initialise the internal reverse iterator on flight date: return the reverse iterator at the end of the map. */ reverse_iterator rend () const; @@ -49,7 +54,7 @@ /** Default constructors. */ BookingClassMap_T (); BookingClassMap_T (const BookingClassMap_T&); - BookingClassMap_T (const SegmentCabinStructure_T&); + BookingClassMap_T (const BookingClassHolder_T&); /** Destructor. */ virtual ~BookingClassMap_T(); @@ -57,7 +62,7 @@ private: // Attributes /** Reference structure. */ - const SegmentCabinStructure_T& _segmentCabinStructure; + const BookingClassHolder_T& _bookingClassHolder; }; } Modified: trunk/stdair/stdair/bom/FlightDate.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/FlightDate.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -59,22 +59,22 @@ // ////////////////////////////////////////////////////////////////////// SegmentDateList_T FlightDate::getSegmentDateList () const { - return SegmentDateList_T (_flightDateStructure); + return _flightDateStructure.getChildrenList(); } // ////////////////////////////////////////////////////////////////////// SegmentDateMap_T FlightDate::getSegmentDateMap () const { - return SegmentDateMap_T (_flightDateStructure); + return _flightDateStructure.getChildrenList(); } // ////////////////////////////////////////////////////////////////////// LegDateList_T FlightDate::getLegDateList () const { - return LegDateList_T (_flightDateStructure); + return _flightDateStructure.getSecondChildrenList(); } // ////////////////////////////////////////////////////////////////////// LegDateMap_T FlightDate::getLegDateMap () const { - return LegDateMap_T (_flightDateStructure); + return _flightDateStructure.getSecondChildrenList(); } } Modified: trunk/stdair/stdair/bom/FlightDateList.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateList.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/FlightDateList.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -4,8 +4,7 @@ // STL #include <cassert> // STDAIR -#include <stdair/bom/InventoryStructure.hpp> -#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/FlightDate.hpp> #include <stdair/bom/FlightDateList.hpp> @@ -13,14 +12,14 @@ // //////////////////////////////////////////////////////////////////// FlightDateList_T:: - FlightDateList_T (const InventoryStructure_T& iInventoryStructure) - : _inventoryStructure (iInventoryStructure) { + FlightDateList_T (const FlightDateHolder_T& iFlightDateHolder) + : _flightDateHolder (iFlightDateHolder) { } // //////////////////////////////////////////////////////////////////// FlightDateList_T:: FlightDateList_T (const FlightDateList_T& iFDList) - : _inventoryStructure (iFDList._inventoryStructure) { + : _flightDateHolder (iFDList._flightDateHolder) { } // //////////////////////////////////////////////////////////////////// @@ -29,22 +28,22 @@ // ////////////////////////////////////////////////////////////////////// FlightDateList_T::iterator FlightDateList_T::begin () const { - return _inventoryStructure.flightDateListBegin (); + return _flightDateHolder.listBegin (); } // ////////////////////////////////////////////////////////////////////// FlightDateList_T::iterator FlightDateList_T::end () const { - return _inventoryStructure.flightDateListEnd (); + return _flightDateHolder.listEnd (); } // ////////////////////////////////////////////////////////////////////// FlightDateList_T::reverse_iterator FlightDateList_T::rbegin () const { - return _inventoryStructure.flightDateListRBegin (); + return _flightDateHolder.listRBegin (); } // ////////////////////////////////////////////////////////////////////// FlightDateList_T::reverse_iterator FlightDateList_T::rend () const { - return _inventoryStructure.flightDateListREnd (); + return _flightDateHolder.listREnd (); } } Modified: trunk/stdair/stdair/bom/FlightDateList.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateList.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/FlightDateList.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -5,14 +5,15 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/InventoryTypes.hpp> #include <stdair/bom/FlightDateTypes.hpp> namespace stdair { -// Forward declarations + // Forward declarations template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class FlightDate; + /** Structure which handles the iterators for a flight-date list. */ struct FlightDateList_T { @@ -27,7 +28,10 @@ typedef BomIterator_T<FlightDate, FlightDateStructureList_T::const_reverse_iterator> reverse_iterator; // ///////////////////////////////////////////////////////////////////////// - + + /** Define the flight-date holder. */ + typedef BomChildrenHolderImp<FlightDate> FlightDateHolder_T; + public: // /////////// Iteration methods ////////// /** Initialise the internal iterator on flight date: @@ -50,7 +54,7 @@ /** Default constructors. */ FlightDateList_T (); FlightDateList_T (const FlightDateList_T&); - FlightDateList_T (const InventoryStructure_T&); + FlightDateList_T (const FlightDateHolder_T&); /** Destructor. */ virtual ~FlightDateList_T(); @@ -58,7 +62,7 @@ private: // Attributes /** Reference structure. */ - const InventoryStructure_T& _inventoryStructure; + const FlightDateHolder_T& _flightDateHolder; }; } Modified: trunk/stdair/stdair/bom/FlightDateMap.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateMap.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/FlightDateMap.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -4,8 +4,7 @@ // STL #include <cassert> // STDAIR -#include <stdair/bom/InventoryStructure.hpp> -#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/FlightDate.hpp> #include <stdair/bom/FlightDateMap.hpp> @@ -13,14 +12,14 @@ // //////////////////////////////////////////////////////////////////// FlightDateMap_T:: - FlightDateMap_T (const InventoryStructure_T& iInventoryStructure) - : _inventoryStructure (iInventoryStructure) { + FlightDateMap_T (const FlightDateHolder_T& iFlightDateHolder) + : _flightDateHolder (iFlightDateHolder) { } // //////////////////////////////////////////////////////////////////// FlightDateMap_T:: FlightDateMap_T (const FlightDateMap_T& iFDMap) - : _inventoryStructure (iFDMap._inventoryStructure) { + : _flightDateHolder (iFDMap._flightDateHolder) { } // //////////////////////////////////////////////////////////////////// @@ -29,22 +28,22 @@ // ////////////////////////////////////////////////////////////////////// FlightDateMap_T::iterator FlightDateMap_T::begin () const { - return _inventoryStructure.flightDateMapBegin (); + return _flightDateHolder.mapBegin (); } // ////////////////////////////////////////////////////////////////////// FlightDateMap_T::iterator FlightDateMap_T::end () const { - return _inventoryStructure.flightDateMapEnd (); + return _flightDateHolder.mapEnd (); } // ////////////////////////////////////////////////////////////////////// FlightDateMap_T::reverse_iterator FlightDateMap_T::rbegin () const { - return _inventoryStructure.flightDateMapRBegin (); + return _flightDateHolder.mapRBegin (); } // ////////////////////////////////////////////////////////////////////// FlightDateMap_T::reverse_iterator FlightDateMap_T::rend () const { - return _inventoryStructure.flightDateMapREnd (); + return _flightDateHolder.mapREnd (); } } Modified: trunk/stdair/stdair/bom/FlightDateMap.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateMap.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/FlightDateMap.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -5,13 +5,15 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/InventoryTypes.hpp> #include <stdair/bom/FlightDateTypes.hpp> namespace stdair { -// Forward declarations + + // Forward declarations template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class FlightDate; + /** Structure which handles the iterators for a flight-date map. */ struct FlightDateMap_T { @@ -26,7 +28,10 @@ typedef BomIterator_T<FlightDate, FlightDateStructureMap_T::const_reverse_iterator> reverse_iterator; // ///////////////////////////////////////////////////////////////////////// - + + /** Define the flight-date holder. */ + typedef BomChildrenHolderImp<FlightDate> FlightDateHolder_T; + public: // /////////// Iteration methods ////////// /** Initialise the internal iterator on flight date: @@ -49,7 +54,7 @@ /** Default constructors. */ FlightDateMap_T (); FlightDateMap_T (const FlightDateMap_T&); - FlightDateMap_T (const InventoryStructure_T&); + FlightDateMap_T (const FlightDateHolder_T&); /** Destructor. */ virtual ~FlightDateMap_T(); @@ -57,7 +62,7 @@ private: // Attributes /** Reference structure. */ - const InventoryStructure_T& _inventoryStructure; + const FlightDateHolder_T& _flightDateHolder; }; } Modified: trunk/stdair/stdair/bom/FlightDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -61,23 +61,6 @@ /** Definition allowing to retrive the second children bom holder type. */ typedef BomChildrenHolderImp<SecondContentChild_T> SecondChildrenBomHolder_T; - /** Define the iterators of the segment-date list. */ - typedef typename ChildrenBomHolder_T::ListIterator_T SegmentDateListIterator_T; - typedef typename ChildrenBomHolder_T::ListReverseIterator_T SegmentDateListReverseIterator_T; - - /** Define the iterators of the segment-date map. */ - typedef typename ChildrenBomHolder_T::MapIterator_T SegmentDateMapIterator_T; - typedef typename ChildrenBomHolder_T::MapReverseIterator_T SegmentDateMapReverseIterator_T; - - /** Define the iterators of the leg-date list. */ - typedef typename SecondChildrenBomHolder_T::ListIterator_T LegDateListIterator_T; - typedef typename SecondChildrenBomHolder_T::ListReverseIterator_T LegDateListReverseIterator_T; - - /** Define the iterators of the leg-date map. */ - typedef typename SecondChildrenBomHolder_T::MapIterator_T LegDateMapIterator_T; - typedef typename SecondChildrenBomHolder_T::MapReverseIterator_T LegDateMapReverseIterator_T; - - public: // /////////// Getters ///////////// /** Get the (parent) InventoryStructure object. */ @@ -183,122 +166,7 @@ _secondChildrenList->describeFull (ioOut); } - public: - // /////////// Iteration methods ////////// - /** Initialise the internal iterator on segment date: - return the iterator at the begining of the list. */ - SegmentDateListIterator_T segmentDateListBegin () const { - assert (_childrenList != NULL); - return _childrenList->listBegin (); - } - /** Initialise the internal iterator on segment date: - return the iterator at the end of the list. */ - SegmentDateListIterator_T segmentDateListEnd () const { - assert (_childrenList != NULL); - return _childrenList->listEnd (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rbegining of the list. */ - SegmentDateListReverseIterator_T segmentDateListRBegin () const { - assert (_childrenList != NULL); - return _childrenList->listRBegin (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rend of the list. */ - SegmentDateListReverseIterator_T segmentDateListREnd () const { - assert (_childrenList != NULL); - return _childrenList->listREnd (); - } - - /** Initialise the internal iterator on segment date: - return the iterator at the begining of the map. */ - SegmentDateMapIterator_T segmentDateMapBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapBegin (); - } - - /** Initialise the internal iterator on segment date: - return the iterator at the end of the map. */ - SegmentDateMapIterator_T segmentDateMapEnd () const { - assert (_childrenList != NULL); - return _childrenList->mapEnd (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rbegining of the map. */ - SegmentDateMapReverseIterator_T segmentDateMapRBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapRBegin (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rend of the map. */ - SegmentDateMapReverseIterator_T segmentDateMapREnd () const { - assert (_childrenList != NULL); - return _childrenList->mapREnd (); - } - - - /** Initialise the internal iterator on leg date: - return the iterator at the begining of the list. */ - LegDateListIterator_T legDateListBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listBegin (); - } - - /** Initialise the internal iterator on leg date: - return the iterator at the end of the list. */ - LegDateListIterator_T legDateListEnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listEnd (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rbegining of the list. */ - LegDateListReverseIterator_T legDateListRBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listRBegin (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rend of the list. */ - LegDateListReverseIterator_T legDateListREnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listREnd (); - } - - /** Initialise the internal iterator on leg date: - return the iterator at the begining of the map. */ - LegDateMapIterator_T legDateMapBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapBegin (); - } - - /** Initialise the internal iterator on leg date: - return the iterator at the end of the map. */ - LegDateMapIterator_T legDateMapEnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapEnd (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rbegining of the map. */ - LegDateMapReverseIterator_T legDateMapRBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapRBegin (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rend of the map. */ - LegDateMapReverseIterator_T legDateMapREnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapREnd (); - } - - private: /** Constructors are private so as to force the usage of the Factory layer. */ Modified: trunk/stdair/stdair/bom/Inventory.cpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/Inventory.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -56,12 +56,12 @@ // ////////////////////////////////////////////////////////////////////// FlightDateList_T Inventory::getFlightDateList () const { - return FlightDateList_T (_inventoryStructure); + return _inventoryStructure.getChildrenList(); } // ////////////////////////////////////////////////////////////////////// FlightDateMap_T Inventory::getFlightDateMap () const { - return FlightDateMap_T (_inventoryStructure); + return _inventoryStructure.getChildrenList(); } } Modified: trunk/stdair/stdair/bom/InventoryList.cpp =================================================================== --- trunk/stdair/stdair/bom/InventoryList.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/InventoryList.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -4,8 +4,7 @@ // STL #include <cassert> // STDAIR -#include <stdair/bom/BomStructureRoot.hpp> -#include <stdair/bom/BomContentRoot.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/Inventory.hpp> #include <stdair/bom/InventoryList.hpp> @@ -13,14 +12,14 @@ // //////////////////////////////////////////////////////////////////// InventoryList_T:: - InventoryList_T (const BomStructureRoot_T& iBomStructureRoot) - : _bomStructureRoot (iBomStructureRoot) { + InventoryList_T (const InventoryHolder_T& iInventoryHolder) + : _inventoryHolder (iInventoryHolder) { } // //////////////////////////////////////////////////////////////////// InventoryList_T:: InventoryList_T (const InventoryList_T& iINVList) - : _bomStructureRoot (iINVList._bomStructureRoot) { + : _inventoryHolder (iINVList._inventoryHolder) { } // //////////////////////////////////////////////////////////////////// @@ -29,22 +28,22 @@ // ////////////////////////////////////////////////////////////////////// InventoryList_T::iterator InventoryList_T::begin () const { - return _bomStructureRoot.inventoryListBegin (); + return _inventoryHolder.listBegin (); } // ////////////////////////////////////////////////////////////////////// InventoryList_T::iterator InventoryList_T::end () const { - return _bomStructureRoot.inventoryListEnd (); + return _inventoryHolder.listEnd (); } // ////////////////////////////////////////////////////////////////////// InventoryList_T::reverse_iterator InventoryList_T::rbegin () const { - return _bomStructureRoot.inventoryListRBegin (); + return _inventoryHolder.listRBegin (); } // ////////////////////////////////////////////////////////////////////// InventoryList_T::reverse_iterator InventoryList_T::rend () const { - return _bomStructureRoot.inventoryListREnd (); + return _inventoryHolder.listREnd (); } } Modified: trunk/stdair/stdair/bom/InventoryList.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryList.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/InventoryList.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -5,15 +5,16 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/BomRootTypes.hpp> #include <stdair/bom/InventoryTypes.hpp> namespace stdair { -// Forward declarations + // Forward declarations template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - - /** Structure which handles the iterators for a flight-date list. */ + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class Inventory; + + /** Structure which handles the iterators for a inventory list. */ struct InventoryList_T { public: @@ -21,13 +22,16 @@ // See the explanations, within the stdair::BomContentRoot class, for all // the iterator types specified below // ///////////////////////////////////////////////////////////////////////// - /** Define the flight-date list iterators. */ + /** Define the inventory list iterators. */ typedef BomIterator_T<Inventory, InventoryStructureList_T::const_iterator> iterator; typedef BomIterator_T<Inventory, InventoryStructureList_T::const_reverse_iterator> reverse_iterator; // ///////////////////////////////////////////////////////////////////////// - + + /** Define the inventory holder. */ + typedef BomChildrenHolderImp<Inventory> InventoryHolder_T; + public: // /////////// Iteration methods ////////// /** Initialise the internal iterator on flight date: @@ -50,7 +54,7 @@ /** Default constructors. */ InventoryList_T (); InventoryList_T (const InventoryList_T&); - InventoryList_T (const BomStructureRoot_T&); + InventoryList_T (const InventoryHolder_T&); /** Destructor. */ virtual ~InventoryList_T(); @@ -58,7 +62,7 @@ private: // Attributes /** Reference structure. */ - const BomStructureRoot_T& _bomStructureRoot; + const InventoryHolder_T& _inventoryHolder; }; } Modified: trunk/stdair/stdair/bom/InventoryMap.cpp =================================================================== --- trunk/stdair/stdair/bom/InventoryMap.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/InventoryMap.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -4,8 +4,7 @@ // STL #include <cassert> // STDAIR -#include <stdair/bom/BomStructureRoot.hpp> -#include <stdair/bom/BomContentRoot.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/Inventory.hpp> #include <stdair/bom/InventoryMap.hpp> @@ -13,14 +12,14 @@ // //////////////////////////////////////////////////////////////////// InventoryMap_T:: - InventoryMap_T (const BomStructureRoot_T& iBomStructureRoot) - : _bomStructureRoot (iBomStructureRoot) { + InventoryMap_T (const InventoryHolder_T& iInventoryHolder) + : _inventoryHolder (iInventoryHolder) { } // //////////////////////////////////////////////////////////////////// InventoryMap_T:: InventoryMap_T (const InventoryMap_T& iINVMap) - : _bomStructureRoot (iINVMap._bomStructureRoot) { + : _inventoryHolder (iINVMap._inventoryHolder) { } // //////////////////////////////////////////////////////////////////// @@ -29,22 +28,22 @@ // ////////////////////////////////////////////////////////////////////// InventoryMap_T::iterator InventoryMap_T::begin () const { - return _bomStructureRoot.inventoryMapBegin (); + return _inventoryHolder.mapBegin (); } // ////////////////////////////////////////////////////////////////////// InventoryMap_T::iterator InventoryMap_T::end () const { - return _bomStructureRoot.inventoryMapEnd (); + return _inventoryHolder.mapEnd (); } // ////////////////////////////////////////////////////////////////////// InventoryMap_T::reverse_iterator InventoryMap_T::rbegin () const { - return _bomStructureRoot.inventoryMapRBegin (); + return _inventoryHolder.mapRBegin (); } // ////////////////////////////////////////////////////////////////////// InventoryMap_T::reverse_iterator InventoryMap_T::rend () const { - return _bomStructureRoot.inventoryMapREnd (); + return _inventoryHolder.mapREnd (); } } Modified: trunk/stdair/stdair/bom/InventoryMap.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryMap.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/InventoryMap.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -5,15 +5,16 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/BomRootTypes.hpp> #include <stdair/bom/InventoryTypes.hpp> namespace stdair { -// Forward declarations + // Forward declarations template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - - /** Structure which handles the iterators for a flight-date map. */ + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class Inventory; + + /** Structure which handles the iterators for a inventory map. */ struct InventoryMap_T { public: @@ -21,13 +22,16 @@ // See the explanations, within the stdair::BomContentRoot class, for all // the iterator types specified below // ///////////////////////////////////////////////////////////////////////// - /** Define the flight-date map iterators. */ + /** Define the inventory map iterators. */ typedef BomIterator_T<Inventory, InventoryStructureMap_T::const_iterator> iterator; typedef BomIterator_T<Inventory, InventoryStructureMap_T::const_reverse_iterator> reverse_iterator; // ///////////////////////////////////////////////////////////////////////// - + + /** Define the inventory holder. */ + typedef BomChildrenHolderImp<Inventory> InventoryHolder_T; + public: // /////////// Iteration methods ////////// /** Initialise the internal iterator on flight date: @@ -50,7 +54,7 @@ /** Default constructors. */ InventoryMap_T (); InventoryMap_T (const InventoryMap_T&); - InventoryMap_T (const BomStructureRoot_T&); + InventoryMap_T (const InventoryHolder_T&); /** Destructor. */ virtual ~InventoryMap_T(); @@ -58,7 +62,7 @@ private: // Attributes /** Reference structure. */ - const BomStructureRoot_T& _bomStructureRoot; + const InventoryHolder_T& _inventoryHolder; }; } Modified: trunk/stdair/stdair/bom/InventoryStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -57,14 +57,6 @@ /** Define the children bom holder type. */ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; - /** Define the iterators of the flight-date list. */ - typedef typename ChildrenBomHolder_T::ListIterator_T FlightDateListIterator_T; - typedef typename ChildrenBomHolder_T::ListReverseIterator_T FlightDateListReverseIterator_T; - - /** Define the iterators of the flight-date map. */ - typedef typename ChildrenBomHolder_T::MapIterator_T FlightDateMapIterator_T; - typedef typename ChildrenBomHolder_T::MapReverseIterator_T FlightDateMapReverseIterator_T; - public: // /////////// Getters ///////////// /** Get the (parent) BomStructureRoot object. */ @@ -146,65 +138,7 @@ assert (_childrenList != NULL); _childrenList->describeFull (ioOut); } - - public: - // /////////// Iteration methods ////////// - /** Initialise the internal iterator on flight date: - return the iterator at the begining of the list. */ - FlightDateListIterator_T flightDateListBegin () const { - assert (_childrenList != NULL); - return _childrenList->listBegin (); - } - /** Initialise the internal iterator on flight date: - return the iterator at the end of the list. */ - FlightDateListIterator_T flightDateListEnd () const { - assert (_childrenList != NULL); - return _childrenList->listEnd (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rbegining of the list. */ - FlightDateListReverseIterator_T flightDateListRBegin () const { - assert (_childrenList != NULL); - return _childrenList->listRBegin (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rend of the list. */ - FlightDateListReverseIterator_T flightDateListREnd () const { - assert (_childrenList != NULL); - return _childrenList->listREnd (); - } - - /** Initialise the internal iterator on flight date: - return the iterator at the begining of the map. */ - FlightDateMapIterator_T flightDateMapBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapBegin (); - } - - /** Initialise the internal iterator on flight date: - return the iterator at the end of the map. */ - FlightDateMapIterator_T flightDateMapEnd () const { - assert (_childrenList != NULL); - return _childrenList->mapEnd (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rbegining of the map. */ - FlightDateMapReverseIterator_T flightDateMapRBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapRBegin (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rend of the map. */ - FlightDateMapReverseIterator_T flightDateMapREnd () const { - assert (_childrenList != NULL); - return _childrenList->mapREnd (); - } - private: /** Constructors are private so as to force the usage of the Factory layer. */ Modified: trunk/stdair/stdair/bom/LegCabinList.cpp =================================================================== --- trunk/stdair/stdair/bom/LegCabinList.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/LegCabinList.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -4,9 +4,7 @@ // STL #include <cassert> // STDAIR -#include <stdair/bom/LegDateStructure.hpp> -#include <stdair/bom/FlightDate.hpp> -#include <stdair/bom/LegDate.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/LegCabin.hpp> #include <stdair/bom/LegCabinList.hpp> @@ -14,14 +12,14 @@ // //////////////////////////////////////////////////////////////////// LegCabinList_T:: - LegCabinList_T (const LegDateStructure_T& iLegDateStructure) - : _legDateStructure (iLegDateStructure) { + LegCabinList_T (const LegCabinHolder_T& iLegCabinHolder) + : _legCabinHolder (iLegCabinHolder) { } // //////////////////////////////////////////////////////////////////// LegCabinList_T:: - LegCabinList_T (const LegCabinList_T& iSCList) - : _legDateStructure (iSCList._legDateStructure) { + LegCabinList_T (const LegCabinList_T& iLCList) + : _legCabinHolder (iLCList._legCabinHolder) { } // //////////////////////////////////////////////////////////////////// @@ -30,22 +28,22 @@ // ////////////////////////////////////////////////////////////////////// LegCabinList_T::iterator LegCabinList_T::begin () const { - return _legDateStructure.legCabinListBegin (); + return _legCabinHolder.listBegin (); } // ////////////////////////////////////////////////////////////////////// LegCabinList_T::iterator LegCabinList_T::end () const { - return _legDateStructure.legCabinListEnd (); + return _legCabinHolder.listEnd (); } // ////////////////////////////////////////////////////////////////////// LegCabinList_T::reverse_iterator LegCabinList_T::rbegin () const { - return _legDateStructure.legCabinListRBegin (); + return _legCabinHolder.listRBegin (); } // ////////////////////////////////////////////////////////////////////// LegCabinList_T::reverse_iterator LegCabinList_T::rend () const { - return _legDateStructure.legCabinListREnd (); + return _legCabinHolder.listREnd (); } } Modified: trunk/stdair/stdair/bom/LegCabinList.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabinList.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/LegCabinList.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -5,13 +5,15 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/LegDateTypes.hpp> #include <stdair/bom/LegCabinTypes.hpp> namespace stdair { -// Forward declarations + + // Forward declarations template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class LegCabin; + /** Structure which handles the iterators for a leg-cabin list. */ struct LegCabinList_T { @@ -26,7 +28,10 @@ typedef BomIterator_T<LegCabin, LegCabinStructureList_T::const_reverse_iterator> reverse_iterator; // ///////////////////////////////////////////////////////////////////////// - + + /** Define the leg-cabin holder. */ + typedef BomChildrenHolderImp<LegCabin> LegCabinHolder_T; + public: // /////////// Iteration methods ////////// /** Initialise the internal iterator on leg cabin: @@ -49,7 +54,7 @@ /** Default constructors. */ LegCabinList_T (); LegCabinList_T (const LegCabinList_T&); - LegCabinList_T (const LegDateStructure_T&); + LegCabinList_T (const LegCabinHolder_T&); /** Destructor. */ virtual ~LegCabinList_T(); @@ -57,7 +62,7 @@ private: // Attributes /** Reference structure. */ - const LegDateStructure_T& _legDateStructure; + const LegCabinHolder_T& _legCabinHolder; }; } Modified: trunk/stdair/stdair/bom/LegCabinMap.cpp =================================================================== --- trunk/stdair/stdair/bom/LegCabinMap.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/LegCabinMap.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -4,9 +4,7 @@ // STL #include <cassert> // STDAIR -#include <stdair/bom/LegDateStructure.hpp> -#include <stdair/bom/FlightDate.hpp> -#include <stdair/bom/LegDate.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/LegCabin.hpp> #include <stdair/bom/LegCabinMap.hpp> @@ -14,14 +12,14 @@ // //////////////////////////////////////////////////////////////////// LegCabinMap_T:: - LegCabinMap_T (const LegDateStructure_T& iLegDateStructure) - : _legDateStructure (iLegDateStructure) { + LegCabinMap_T (const LegCabinHolder_T& iLegCabinHolder) + : _legCabinHolder (iLegCabinHolder) { } // //////////////////////////////////////////////////////////////////// LegCabinMap_T:: - LegCabinMap_T (const LegCabinMap_T& iSCMap) - : _legDateStructure (iSCMap._legDateStructure) { + LegCabinMap_T (const LegCabinMap_T& iLCMap) + : _legCabinHolder (iLCMap._legCabinHolder) { } // //////////////////////////////////////////////////////////////////// @@ -30,22 +28,22 @@ // ////////////////////////////////////////////////////////////////////// LegCabinMap_T::iterator LegCabinMap_T::begin () const { - return _legDateStructure.legCabinMapBegin (); + return _legCabinHolder.mapBegin (); } // ////////////////////////////////////////////////////////////////////// LegCabinMap_T::iterator LegCabinMap_T::end () const { - return _legDateStructure.legCabinMapEnd (); + return _legCabinHolder.mapEnd (); } // ////////////////////////////////////////////////////////////////////// LegCabinMap_T::reverse_iterator LegCabinMap_T::rbegin () const { - return _legDateStructure.legCabinMapRBegin (); + return _legCabinHolder.mapRBegin (); } // ////////////////////////////////////////////////////////////////////// LegCabinMap_T::reverse_iterator LegCabinMap_T::rend () const { - return _legDateStructure.legCabinMapREnd (); + return _legCabinHolder.mapREnd (); } } Modified: trunk/stdair/stdair/bom/LegCabinMap.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabinMap.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/LegCabinMap.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -5,14 +5,16 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/LegDateTypes.hpp> #include <stdair/bom/LegCabinTypes.hpp> namespace stdair { -// Forward declarations + + // Forward declarations template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - - /** Structure which handles the iterators for a leg-date map. */ + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class LegCabin; + + /** Structure which handles the iterators for a leg-cabin map. */ struct LegCabinMap_T { public: @@ -20,28 +22,31 @@ // See the explanations, within the stdair::BomContentRoot class, for all // the iterator types specified below // ///////////////////////////////////////////////////////////////////////// - /** Define the leg-date map iterators. */ + /** Define the leg-cabin map iterators. */ typedef BomIterator_T<LegCabin, LegCabinStructureMap_T::const_iterator> iterator; typedef BomIterator_T<LegCabin, LegCabinStructureMap_T::const_reverse_iterator> reverse_iterator; // ///////////////////////////////////////////////////////////////////////// - + + /** Define the leg-cabin holder. */ + typedef BomChildrenHolderImp<LegCabin> LegCabinHolder_T; + public: // /////////// Iteration methods ////////// - /** Initialise the internal iterator on leg date: + /** Initialise the internal iterator on leg cabin: return the iterator at the begining of the map. */ iterator begin () const; - /** Initialise the internal iterator on leg date: + /** Initialise the internal iterator on leg cabin: return the iterator at the end of the map. */ iterator end () const; - /** Initialise the internal reverse iterator on leg date: + /** Initialise the internal reverse iterator on leg cabin: return the reverse iterator at the rbegining of the map. */ reverse_iterator rbegin () const; - /** Initialise the internal reverse iterator on leg date: + /** Initialise the internal reverse iterator on leg cabin: return the reverse iterator at the end of the map. */ reverse_iterator rend () const; @@ -49,7 +54,7 @@ /** Default constructors. */ LegCabinMap_T (); LegCabinMap_T (const LegCabinMap_T&); - LegCabinMap_T (const LegDateStructure_T&); + LegCabinMap_T (const LegCabinHolder_T&); /** Destructor. */ virtual ~LegCabinMap_T(); @@ -57,7 +62,7 @@ private: // Attributes /** Reference structure. */ - const LegDateStructure_T& _legDateStructure; + const LegCabinHolder_T& _legCabinHolder; }; } Modified: trunk/stdair/stdair/bom/LegDate.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/LegDate.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -56,12 +56,12 @@ // ////////////////////////////////////////////////////////////////////// LegCabinList_T LegDate::getLegCabinList () const { - return LegCabinList_T (_legDateStructure); + return _legDateStructure.getChildrenList(); } // ////////////////////////////////////////////////////////////////////// LegCabinMap_T LegDate::getLegCabinMap () const { - return LegCabinMap_T (_legDateStructure); + return _legDateStructure.getChildrenList(); } } Modified: trunk/stdair/stdair/bom/LegDateList.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDateList.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/LegDateList.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -4,10 +4,7 @@ // STL #include <cassert> // STDAIR -#include <stdair/bom/FlightDateStructure.hpp> -#include <stdair/bom/Inventory.hpp> -#include <stdair/bom/FlightDate.hpp> -#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/LegDate.hpp> #include <stdair/bom/LegDateList.hpp> @@ -15,14 +12,14 @@ // //////////////////////////////////////////////////////////////////// LegDateList_T:: - LegDateList_T (const FlightDateStructure_T& iFlightDateStructure) - : _flightDateStructure (iFlightDateStructure) { + LegDateList_T (const LegDateHolder_T& iLegDateHolder) + : _legDateHolder (iLegDateHolder) { } // //////////////////////////////////////////////////////////////////// LegDateList_T:: - LegDateList_T (const LegDateList_T& iSDList) - : _flightDateStructure (iSDList._flightDateStructure) { + LegDateList_T (const LegDateList_T& iLDList) + : _legDateHolder (iLDList._legDateHolder) { } // //////////////////////////////////////////////////////////////////// @@ -31,22 +28,22 @@ // ////////////////////////////////////////////////////////////////////// LegDateList_T::iterator LegDateList_T::begin () const { - return _flightDateStructure.legDateListBegin (); + return _legDateHolder.listBegin (); } // ////////////////////////////////////////////////////////////////////// LegDateList_T::iterator LegDateList_T::end () const { - return _flightDateStructure.legDateListEnd (); + return _legDateHolder.listEnd (); } // ////////////////////////////////////////////////////////////////////// LegDateList_T::reverse_iterator LegDateList_T::rbegin () const { - return _flightDateStructure.legDateListRBegin (); + return _legDateHolder.listRBegin (); } // ////////////////////////////////////////////////////////////////////// LegDateList_T::reverse_iterator LegDateList_T::rend () const { - return _flightDateStructure.legDateListREnd (); + return _legDateHolder.listREnd (); } } Modified: trunk/stdair/stdair/bom/LegDateList.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateList.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/LegDateList.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -5,13 +5,15 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/FlightDateTypes.hpp> #include <stdair/bom/LegDateTypes.hpp> namespace stdair { - // Forward declarations. + + // Forward declarations template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class LegDate; + /** Structure which handles the iterators for a leg-date list. */ struct LegDateList_T { @@ -26,7 +28,10 @@ typedef BomIterator_T<LegDate, LegDateStructureList_T::const_reverse_iterator> reverse_iterator; // ///////////////////////////////////////////////////////////////////////// - + + /** Define the leg-date holder. */ + typedef BomChildrenHolderImp<LegDate> LegDateHolder_T; + public: // /////////// Iteration methods ////////// /** Initialise the internal iterator on leg date: @@ -49,7 +54,7 @@ /** Default constructors. */ LegDateList_T (); LegDateList_T (const LegDateList_T&); - LegDateList_T (const FlightDateStructure_T&); + LegDateList_T (const LegDateHolder_T&); /** Destructor. */ virtual ~LegDateList_T(); @@ -57,7 +62,7 @@ private: // Attributes /** Reference structure. */ - const FlightDateStructure_T& _flightDateStructure; + const LegDateHolder_T& _legDateHolder; }; } Modified: trunk/stdair/stdair/bom/LegDateMap.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDateMap.cpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/LegDateMap.cpp 2009-10-13 07:52:49 UTC (rev 44) @@ -4,10 +4,7 @@ // STL #include <cassert> // STDAIR -#include <stdair/bom/FlightDateStructure.hpp> -#include <stdair/bom/Inventory.hpp> -#include <stdair/bom/FlightDate.hpp> -#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/LegDate.hpp> #include <stdair/bom/LegDateMap.hpp> @@ -15,14 +12,14 @@ // //////////////////////////////////////////////////////////////////// LegDateMap_T:: - LegDateMap_T (const FlightDateStructure_T& iFlightDateStructure) - : _flightDateStructure (iFlightDateStructure) { + LegDateMap_T (const LegDateHolder_T& iLegDateHolder) + : _legDateHolder (iLegDateHolder) { } // //////////////////////////////////////////////////////////////////// LegDateMap_T:: - LegDateMap_T (const LegDateMap_T& iSDMap) - : _flightDateStructure (iSDMap._flightDateStructure) { + LegDateMap_T (const LegDateMap_T& iLDMap) + : _legDateHolder (iLDMap._legDateHolder) { } // //////////////////////////////////////////////////////////////////// @@ -31,22 +28,22 @@ // ////////////////////////////////////////////////////////////////////// LegDateMap_T::iterator LegDateMap_T::begin () const { - return _flightDateStructure.legDateMapBegin (); + return _legDateHolder.mapBegin (); } // ////////////////////////////////////////////////////////////////////// LegDateMap_T::iterator LegDateMap_T::end () const { - return _flightDateStructure.legDateMapEnd (); + return _legDateHolder.mapEnd (); } // ////////////////////////////////////////////////////////////////////// LegDateMap_T::reverse_iterator LegDateMap_T::rbegin () const { - return _flightDateStructure.legDateMapRBegin (); + return _legDateHolder.mapRBegin (); } // ////////////////////////////////////////////////////////////////////// LegDateMap_T::reverse_iterator LegDateMap_T::rend () const { - return _flightDateStructure.legDateMapREnd (); + return _legDateHolder.mapREnd (); } } Modified: trunk/stdair/stdair/bom/LegDateMap.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateMap.hpp 2009-10-12 15:13:31 UTC (rev 43) +++ trunk/stdair/stdair/bom/LegDateMap.hpp 2009-10-13 07:52:49 UTC (rev 44) @@ -5,13 +5,15 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/FlightDateTypes.hpp> #include <stdair/bom/LegDateTypes.hpp> namespace stdair { -// Forward declarations + + // Forward declarations template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class LegDate; + /** Structure which handles the iterators for a leg-date map. */ struct LegDateMap_T { @@ -26,7 +28,10 @@ typedef BomIterator_T<LegDate, LegDateStructureMap_T::const_reverse_iterator> reverse_iterator; // //////////////////////////////////////////////////... [truncated message content] |
From: <qua...@us...> - 2009-10-12 15:13:38
|
Revision: 43 http://stdair.svn.sourceforge.net/stdair/?rev=43&view=rev Author: quannaus Date: 2009-10-12 15:13:31 +0000 (Mon, 12 Oct 2009) Log Message: ----------- [Dev] Fix some small bugs. Modified Paths: -------------- trunk/stdair/stdair/bom/LegDateStructure.hpp trunk/stdair/stdair/bom/SegmentDateStructure.hpp Modified: trunk/stdair/stdair/bom/LegDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-10-12 13:35:33 UTC (rev 42) +++ trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-10-12 15:13:31 UTC (rev 43) @@ -45,7 +45,7 @@ typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector <LegDateStructure<ContentChild_T>, + typedef boost::mpl::vector <LegCabinStructure<ContentChild_T>, BomStructureDummy> ChildrenBomTypeList_T; /** Definition allowing to retrieve the default children bom holder type. */ Modified: trunk/stdair/stdair/bom/SegmentDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateStructure.hpp 2009-10-12 13:35:33 UTC (rev 42) +++ trunk/stdair/stdair/bom/SegmentDateStructure.hpp 2009-10-12 15:13:31 UTC (rev 43) @@ -45,7 +45,7 @@ typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector <SegmentDateStructure<ContentChild_T>, + typedef boost::mpl::vector <SegmentCabinStructure<ContentChild_T>, BomStructureDummy> ChildrenBomTypeList_T; /** Definition allowing to retrieve the default children bom holder type. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-12 13:35:39
|
Revision: 42 http://stdair.svn.sourceforge.net/stdair/?rev=42&view=rev Author: quannaus Date: 2009-10-12 13:35:33 +0000 (Mon, 12 Oct 2009) Log Message: ----------- [Dev] Added SegmentCabin, LegCabin, BookingClass. Definately need to have some test (implementation). Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/LegDate.cpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/LegDateStructure.hpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentDate.hpp trunk/stdair/stdair/bom/SegmentDateStructure.hpp trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/BookingClass.cpp trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/BookingClassKey.hpp trunk/stdair/stdair/bom/BookingClassList.cpp trunk/stdair/stdair/bom/BookingClassList.hpp trunk/stdair/stdair/bom/BookingClassMap.cpp trunk/stdair/stdair/bom/BookingClassMap.hpp trunk/stdair/stdair/bom/BookingClassStructure.hpp trunk/stdair/stdair/bom/BookingClassTypes.hpp trunk/stdair/stdair/bom/LegCabin.cpp trunk/stdair/stdair/bom/LegCabin.hpp trunk/stdair/stdair/bom/LegCabinKey.hpp trunk/stdair/stdair/bom/LegCabinList.cpp trunk/stdair/stdair/bom/LegCabinList.hpp trunk/stdair/stdair/bom/LegCabinMap.cpp trunk/stdair/stdair/bom/LegCabinMap.hpp trunk/stdair/stdair/bom/LegCabinStructure.hpp trunk/stdair/stdair/bom/LegCabinTypes.hpp trunk/stdair/stdair/bom/SegmentCabin.cpp trunk/stdair/stdair/bom/SegmentCabin.hpp trunk/stdair/stdair/bom/SegmentCabinKey.hpp trunk/stdair/stdair/bom/SegmentCabinList.cpp trunk/stdair/stdair/bom/SegmentCabinList.hpp trunk/stdair/stdair/bom/SegmentCabinMap.cpp trunk/stdair/stdair/bom/SegmentCabinMap.hpp trunk/stdair/stdair/bom/SegmentCabinStructure.hpp trunk/stdair/stdair/bom/SegmentCabinTypes.hpp Removed Paths: ------------- trunk/stdair/stdair/bom/BomStructureList.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2009-10-12 08:57:42 UTC (rev 41) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -54,6 +54,12 @@ /** Define the type for flight numbers. */ typedef unsigned int FlightNumber_T; + /** Define the type for cabin codes. */ + typedef std::string CabinCode_T; + + /** Define the type for class codes. */ + typedef std::string ClassCode_T; + /** Define the type for durations (e.g., elapsed in-flight time). */ typedef boost::posix_time::time_duration Duration_T; Deleted: trunk/stdair/stdair/bom/BomStructureList.hpp =================================================================== --- trunk/stdair/stdair/bom/BomStructureList.hpp 2009-10-12 08:57:42 UTC (rev 41) +++ trunk/stdair/stdair/bom/BomStructureList.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -1,24 +0,0 @@ -#ifndef __STDAIR_BOM_BOMSTRUCTURELIST_HPP -#define __STDAIR_BOM_BOMSTRUCTURELIST_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -#include <map> -#include <vector> -#include <list> - -namespace stdair { - - /** Forward declarations. */ - class BomStructure; - - /** Define lists of Bom-Structure objects. */ - typedef std::map<std::string, BomStructure*> BomStructureList_T; - typedef std::vector<BomStructure*> BomStructureOrderedList_T; - typedef std::list<const BomStructure*> BomStructureLightList_T; - -} -#endif // __STDAIR_BOM_BOMSTRUCTURELIST_HPP Copied: trunk/stdair/stdair/bom/BookingClass.cpp (from rev 40, trunk/stdair/stdair/bom/SegmentDate.cpp) =================================================================== --- trunk/stdair/stdair/bom/BookingClass.cpp (rev 0) +++ trunk/stdair/stdair/bom/BookingClass.cpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,56 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STDAIR +#include <stdair/bom/BookingClassStructure.hpp> +#include <stdair/bom/SegmentCabin.hpp> +#include <stdair/bom/LegCabin.hpp> +#include <stdair/bom/BookingClass.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + BookingClass::BookingClass (BomStructure_T& ioBookingClassStructure) + : _bookingClassStructure (ioBookingClassStructure) { + } + + // //////////////////////////////////////////////////////////////////// + BookingClass::~BookingClass () { + } + + // ////////////////////////////////////////////////////////////////////// + void BookingClass::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void BookingClass::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string BookingClass::toString() const { + std::ostringstream oStr; + + // First, put the key of that level + oStr << describeShortKey() << std::endl; + + // Then, browse the children + // [...] (no child for now) + + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string BookingClass::describeKey() const { + return _bookingClassStructure.describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string BookingClass::describeShortKey() const { + return _bookingClassStructure.describeShortKey(); + } + +} + Copied: trunk/stdair/stdair/bom/BookingClass.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDate.hpp) =================================================================== --- trunk/stdair/stdair/bom/BookingClass.hpp (rev 0) +++ trunk/stdair/stdair/bom/BookingClass.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,86 @@ +#ifndef __STDAIR_BOM_BOOKINGCLASS_HPP +#define __STDAIR_BOM_BOOKINGCLASS_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/SegmentCabinTypes.hpp> +#include <stdair/bom/BookingClassTypes.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + class SegmentCabin; + struct BookingClassList_T; + struct BookingClassMap_T; + + /** Class representing the actual functional/business content for a + segment-cabin. */ + class BookingClass : public BomContent { + friend class FacBomContent; + + public: + // Type definitions + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef SegmentCabin ParentBomContent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef BookingClassStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef BookingClassKey_T BomKey_T; + + /** Definition allowing to retrieve the associated + BOM content child type. */ + typedef BookingClass ContentChild_T; + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** 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 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; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _bookingClassStructure; + } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + BookingClass (); + BookingClass (const BookingClass&); + BookingClass (BomStructure_T&); + + /** Destructor. */ + virtual ~BookingClass(); + + protected: + // Attributes + /** Reference structure. */ + BomStructure_T& _bookingClassStructure; + }; + +} +#endif // __STDAIR_BOM_BOOKINGCLASS_HPP + Copied: trunk/stdair/stdair/bom/BookingClassKey.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateKey.hpp) =================================================================== --- trunk/stdair/stdair/bom/BookingClassKey.hpp (rev 0) +++ trunk/stdair/stdair/bom/BookingClassKey.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,74 @@ +#ifndef __STDAIR_BOM_BOOKINGCLASSKEY_HPP +#define __STDAIR_BOM_BOOKINGCLASSKEY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomKey.hpp> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT> + class BookingClassStructure; + + /** Key of segment-cabin. */ + template <typename BOM_CONTENT> + class BookingClassKey : public BomKey { + friend class FacBomStructure; + friend class FacBomContent; + + private: + // Type definitions + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef BookingClassStructure<BOM_CONTENT> BomStructure_T; + + public: + // /////////// Construction /////////// + /** Constructor. */ + BookingClassKey (const ClassCode_T& iClassCode) + : _classCode (iClassCode) { + } + + /** Destructor. */ + ~BookingClassKey () { } + + // /////////// Getters ////////// + /** Get the cabin code. */ + const ClassCode_T& getClassCode () const { + return _classCode; + } + + // /////////// Display support methods ///////// + /** Dump a Business Object Key into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { + ioOut << "BookingClassKey: " << toString() << std::endl; + } + + /** 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. + <br>For instance, "H" and "K" allow to differentiate among two + marketing classes for the same segment-cabin. */ + std::string toString() const { + std::ostringstream oStr; + oStr << _classCode; + return oStr.str(); + } + + + private: + // Attributes + /** Cabin code. */ + ClassCode_T _classCode; + }; + +} +#endif // __STDAIR_BOM_BOOKINGCLASSKEY_HPP Copied: trunk/stdair/stdair/bom/BookingClassList.cpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateList.cpp) =================================================================== --- trunk/stdair/stdair/bom/BookingClassList.cpp (rev 0) +++ trunk/stdair/stdair/bom/BookingClassList.cpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,52 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/SegmentCabinStructure.hpp> +#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/SegmentCabin.hpp> +#include <stdair/bom/BookingClass.hpp> +#include <stdair/bom/BookingClassList.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + BookingClassList_T:: + BookingClassList_T (const SegmentCabinStructure_T& iSegmentCabinStructure) + : _segmentCabinStructure (iSegmentCabinStructure) { + } + + // //////////////////////////////////////////////////////////////////// + BookingClassList_T:: + BookingClassList_T (const BookingClassList_T& iSCList) + : _segmentCabinStructure (iSCList._segmentCabinStructure) { + } + + // //////////////////////////////////////////////////////////////////// + BookingClassList_T::~BookingClassList_T () { + } + + // ////////////////////////////////////////////////////////////////////// + BookingClassList_T::iterator BookingClassList_T::begin () const { + return _segmentCabinStructure.bookingClassListBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + BookingClassList_T::iterator BookingClassList_T::end () const { + return _segmentCabinStructure.bookingClassListEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + BookingClassList_T::reverse_iterator BookingClassList_T::rbegin () const { + return _segmentCabinStructure.bookingClassListRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + BookingClassList_T::reverse_iterator BookingClassList_T::rend () const { + return _segmentCabinStructure.bookingClassListREnd (); + } + +} + Copied: trunk/stdair/stdair/bom/BookingClassList.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateList.hpp) =================================================================== --- trunk/stdair/stdair/bom/BookingClassList.hpp (rev 0) +++ trunk/stdair/stdair/bom/BookingClassList.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,65 @@ +#ifndef __STDAIR_BOM_BOOKINGCLASSLIST_HPP +#define __STDAIR_BOM_BOOKINGCLASSLIST_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/SegmentCabinTypes.hpp> +#include <stdair/bom/BookingClassTypes.hpp> + +namespace stdair { +// Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; + + /** Structure which handles the iterators for a segment-cabin list. */ + struct BookingClassList_T { + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the segment-cabin list iterators. */ + typedef BomIterator_T<BookingClass, + BookingClassStructureList_T::const_iterator> iterator; + typedef BomIterator_T<BookingClass, + BookingClassStructureList_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on segment cabin: + return the iterator at the begining of the list. */ + iterator begin () const; + + /** Initialise the internal iterator on segment cabin: + return the iterator at the end of the list. */ + iterator end () const; + + /** Initialise the internal reverse iterator on segment cabin: + return the reverse iterator at the rbegining of the list. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on segment cabin: + return the reverse iterator at the end of the list. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + BookingClassList_T (); + BookingClassList_T (const BookingClassList_T&); + BookingClassList_T (const SegmentCabinStructure_T&); + + /** Destructor. */ + virtual ~BookingClassList_T(); + + private: + // Attributes + /** Reference structure. */ + const SegmentCabinStructure_T& _segmentCabinStructure; + }; + +} +#endif // __STDAIR_BOM_BOOKINGCLASSLIST_HPP + Copied: trunk/stdair/stdair/bom/BookingClassMap.cpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateMap.cpp) =================================================================== --- trunk/stdair/stdair/bom/BookingClassMap.cpp (rev 0) +++ trunk/stdair/stdair/bom/BookingClassMap.cpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,52 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/SegmentCabinStructure.hpp> +#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/SegmentCabin.hpp> +#include <stdair/bom/BookingClass.hpp> +#include <stdair/bom/BookingClassMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + BookingClassMap_T:: + BookingClassMap_T (const SegmentCabinStructure_T& iSegmentCabinStructure) + : _segmentCabinStructure (iSegmentCabinStructure) { + } + + // //////////////////////////////////////////////////////////////////// + BookingClassMap_T:: + BookingClassMap_T (const BookingClassMap_T& iSCMap) + : _segmentCabinStructure (iSCMap._segmentCabinStructure) { + } + + // //////////////////////////////////////////////////////////////////// + BookingClassMap_T::~BookingClassMap_T () { + } + + // ////////////////////////////////////////////////////////////////////// + BookingClassMap_T::iterator BookingClassMap_T::begin () const { + return _segmentCabinStructure.bookingClassMapBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + BookingClassMap_T::iterator BookingClassMap_T::end () const { + return _segmentCabinStructure.bookingClassMapEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + BookingClassMap_T::reverse_iterator BookingClassMap_T::rbegin () const { + return _segmentCabinStructure.bookingClassMapRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + BookingClassMap_T::reverse_iterator BookingClassMap_T::rend () const { + return _segmentCabinStructure.bookingClassMapREnd (); + } + +} + Copied: trunk/stdair/stdair/bom/BookingClassMap.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateMap.hpp) =================================================================== --- trunk/stdair/stdair/bom/BookingClassMap.hpp (rev 0) +++ trunk/stdair/stdair/bom/BookingClassMap.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,65 @@ +#ifndef __STDAIR_BOM_BOOKINGCLASSMAP_HPP +#define __STDAIR_BOM_BOOKINGCLASSMAP_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/SegmentCabinTypes.hpp> +#include <stdair/bom/BookingClassTypes.hpp> + +namespace stdair { +// Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; + + /** Structure which handles the iterators for a segment-cabin map. */ + struct BookingClassMap_T { + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the segment-cabin map iterators. */ + typedef BomIterator_T<BookingClass, + BookingClassStructureMap_T::const_iterator> iterator; + typedef BomIterator_T<BookingClass, + BookingClassStructureMap_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on segment cabin: + return the iterator at the begining of the map. */ + iterator begin () const; + + /** Initialise the internal iterator on segment cabin: + return the iterator at the end of the map. */ + iterator end () const; + + /** Initialise the internal reverse iterator on segment cabin: + return the reverse iterator at the rbegining of the map. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on segment cabin: + return the reverse iterator at the end of the map. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + BookingClassMap_T (); + BookingClassMap_T (const BookingClassMap_T&); + BookingClassMap_T (const SegmentCabinStructure_T&); + + /** Destructor. */ + virtual ~BookingClassMap_T(); + + private: + // Attributes + /** Reference structure. */ + const SegmentCabinStructure_T& _segmentCabinStructure; + }; + +} +#endif // __STDAIR_BOM_BOOKINGCLASSMAP_HPP + Copied: trunk/stdair/stdair/bom/BookingClassStructure.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateStructure.hpp) =================================================================== --- trunk/stdair/stdair/bom/BookingClassStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/BookingClassStructure.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,128 @@ +#ifndef __STDAIR_BOM_BOOKINGCLASSSTRUCTURE_HPP +#define __STDAIR_BOM_BOOKINGCLASSSTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/BookingClassKey.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT> class SegmentCabinStructure; + class BomStructureDummy; + class BomContentDummy; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific BookingClass class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class BookingClassStructure : public BomStructure { + friend class FacBomStructure; + friend class FacBomContent; + friend class BomStructure; + + public: + // Type definitions + /** Definition allowing to retrieve the associated BOM content type. */ + typedef BOM_CONTENT Content_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef BookingClassKey<BOM_CONTENT> BomKey_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector <BomStructureDummy, + BomStructureDummy> ChildrenBomTypeList_T; + + /** Definition allowing to retrieve the default children bom holder type. */ + typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + + public: + // /////////// Getters ///////////// + /** Get the (parent) SegmentCabinStructure object. */ + ParentBomStructure_T* getSegmentCabinStructurePtr() const { + return _parent; + } + + /** Get the (parent) SegmentCabinStructure object. */ + ParentBomStructure_T& getSegmentCabinStructure() const; + + /** Get the segment-cabin key. */ + const BomKey_T& getKey() const { + return _key; + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) SegmentCabinStructure object. */ + void setSegmentCabinStructure(ParentBomStructure_T& ioSegmentCabinStructure){ + _parent = &ioSegmentCabinStructure; + } + + /** Default children list setter. */ + void setChildrenList (DefaultChildrenBomHolder_T&) { } + + 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() << std::endl; + } + + /** Dump a Business Object with all its children into an output stream. + @param ostream& the output stream. */ + void describeFull (std::ostringstream& ioOut) const { + ioOut << describeShortKey () << std::endl; + } + + /** 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 { return describeKey(); } + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const { return _key.toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return _key.toString(); } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + BookingClassStructure (); + BookingClassStructure (const BookingClassStructure&); + BookingClassStructure (const BomKey_T& iKey) : _parent (NULL), _key (iKey){ } + + /** Destructor. */ + virtual ~BookingClassStructure() { } + + private: + // Attributes + /** Parent segment-cabin. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** The key of both the structure and content objects. */ + BomKey_T _key; + + }; + +} +#endif // __STDAIR_BOM_BOOKINGCLASSSTRUCTURE_HPP Copied: trunk/stdair/stdair/bom/BookingClassTypes.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/BookingClassTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/BookingClassTypes.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,33 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_BOOKINGCLASSTYPES_HPP +#define __STDAIR_BOM_BOOKINGCLASSTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <map> +#include <vector> + +namespace stdair { + + // Forward declarations. + template <typename BOM_CONTENT> class BookingClassStructure; + template <typename BOM_CONTENT> class BookingClassKey; + class BookingClass; + + /** Define the BookingClass structure. */ + typedef BookingClassStructure<BookingClass> BookingClassStructure_T; + + /** Define the BookingClass key. */ + typedef BookingClassKey<BookingClass> BookingClassKey_T; + + /** Define the segment-cabin structure list. */ + typedef std::vector<BookingClassStructure_T*> BookingClassStructureList_T; + + /** Define the segment-cabin structure map. */ + typedef std::map<const std::string, BookingClassStructure_T*> BookingClassStructureMap_T; + +} +#endif // __STDAIR_BOM_BOOKINGCLASSTYPES_HPP + Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-12 08:57:42 UTC (rev 41) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -5,7 +5,6 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/BomStructureList.hpp> #include <stdair/bom/BomContent.hpp> #include <stdair/bom/FlightDateTypes.hpp> #include <stdair/bom/SegmentDateTypes.hpp> Modified: trunk/stdair/stdair/bom/Inventory.cpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.cpp 2009-10-12 08:57:42 UTC (rev 41) +++ trunk/stdair/stdair/bom/Inventory.cpp 2009-10-12 13:35:33 UTC (rev 42) @@ -11,6 +11,9 @@ #include <stdair/bom/FlightDateMap.hpp> #include <stdair/bom/SegmentDate.hpp> #include <stdair/bom/LegDate.hpp> +#include <stdair/bom/SegmentCabin.hpp> +#include <stdair/bom/LegCabin.hpp> +#include <stdair/bom/BookingClass.hpp> namespace stdair { Copied: trunk/stdair/stdair/bom/LegCabin.cpp (from rev 40, trunk/stdair/stdair/bom/SegmentDate.cpp) =================================================================== --- trunk/stdair/stdair/bom/LegCabin.cpp (rev 0) +++ trunk/stdair/stdair/bom/LegCabin.cpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,55 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STDAIR +#include <stdair/bom/LegCabinStructure.hpp> +#include <stdair/bom/LegDate.hpp> +#include <stdair/bom/LegCabin.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + LegCabin::LegCabin (BomStructure_T& ioLegStructure) + : _legCabinStructure (ioLegStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LegCabin::~LegCabin () { + } + + // ////////////////////////////////////////////////////////////////////// + void LegCabin::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void LegCabin::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string LegCabin::toString() const { + std::ostringstream oStr; + + // First, put the key of that level + oStr << describeShortKey() << std::endl; + + // Then, browse the children + // [...] (no child for now) + + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string LegCabin::describeKey() const { + return _legCabinStructure.describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string LegCabin::describeShortKey() const { + return _legCabinStructure.describeShortKey(); + } + +} + Copied: trunk/stdair/stdair/bom/LegCabin.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDate.hpp) =================================================================== --- trunk/stdair/stdair/bom/LegCabin.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegCabin.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,79 @@ +#ifndef __STDAIR_BOM_LEGCABIN_HPP +#define __STDAIR_BOM_LEGCABIN_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/LegCabinTypes.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + class LegDate; + + /** Class representing the actual functional/business content for a + leg-date. */ + class LegCabin : public BomContent { + friend class FacBomContent; + + public: + // Type definitions + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef LegDate ParentBomContent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef LegCabinStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef LegCabinKey_T BomKey_T; + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** 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 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; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _legCabinStructure; + } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + LegCabin (); + LegCabin (const LegCabin&); + LegCabin (BomStructure_T&); + + /** Destructor. */ + virtual ~LegCabin(); + + protected: + // Attributes + /** Reference structure. */ + BomStructure_T& _legCabinStructure; + }; + +} +#endif // __STDAIR_BOM_LEGCABIN_HPP + Copied: trunk/stdair/stdair/bom/LegCabinKey.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateKey.hpp) =================================================================== --- trunk/stdair/stdair/bom/LegCabinKey.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegCabinKey.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,74 @@ +#ifndef __STDAIR_BOM_LEGCABINKEY_HPP +#define __STDAIR_BOM_LEGCABINKEY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomKey.hpp> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT> + class LegCabinStructure; + + /** Key of leg-cabin. */ + template <typename BOM_CONTENT> + class LegCabinKey : public BomKey { + friend class FacBomStructure; + friend class FacBomContent; + + private: + // Type definitions + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef LegCabinStructure<BOM_CONTENT> BomStructure_T; + + public: + // /////////// Construction /////////// + /** Constructor. */ + LegCabinKey (const CabinCode_T& iCabinCode) + : _cabinCode (iCabinCode) { + } + + /** Destructor. */ + ~LegCabinKey () { } + + // /////////// Getters ////////// + /** Get the cabin code. */ + const CabinCode_T& getCabinCode () const { + return _cabinCode; + } + + // /////////// Display support methods ///////// + /** Dump a Business Object Key into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { + ioOut << "LegCabinKey: " << toString() << std::endl; + } + + /** 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. + <br>For instance, "H" and "K" allow to differentiate among two + marketing classes for the same leg-cabin. */ + std::string toString() const { + std::ostringstream oStr; + oStr << _cabinCode; + return oStr.str(); + } + + + private: + // Attributes + /** Cabin code. */ + CabinCode_T _cabinCode; + }; + +} +#endif // __STDAIR_BOM_LEGCABINKEY_HPP Copied: trunk/stdair/stdair/bom/LegCabinList.cpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateList.cpp) =================================================================== --- trunk/stdair/stdair/bom/LegCabinList.cpp (rev 0) +++ trunk/stdair/stdair/bom/LegCabinList.cpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,52 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/LegDateStructure.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/LegDate.hpp> +#include <stdair/bom/LegCabin.hpp> +#include <stdair/bom/LegCabinList.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + LegCabinList_T:: + LegCabinList_T (const LegDateStructure_T& iLegDateStructure) + : _legDateStructure (iLegDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LegCabinList_T:: + LegCabinList_T (const LegCabinList_T& iSCList) + : _legDateStructure (iSCList._legDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LegCabinList_T::~LegCabinList_T () { + } + + // ////////////////////////////////////////////////////////////////////// + LegCabinList_T::iterator LegCabinList_T::begin () const { + return _legDateStructure.legCabinListBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + LegCabinList_T::iterator LegCabinList_T::end () const { + return _legDateStructure.legCabinListEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + LegCabinList_T::reverse_iterator LegCabinList_T::rbegin () const { + return _legDateStructure.legCabinListRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + LegCabinList_T::reverse_iterator LegCabinList_T::rend () const { + return _legDateStructure.legCabinListREnd (); + } + +} + Copied: trunk/stdair/stdair/bom/LegCabinList.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateList.hpp) =================================================================== --- trunk/stdair/stdair/bom/LegCabinList.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegCabinList.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,65 @@ +#ifndef __STDAIR_BOM_LEGCABINLIST_HPP +#define __STDAIR_BOM_LEGCABINLIST_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/LegDateTypes.hpp> +#include <stdair/bom/LegCabinTypes.hpp> + +namespace stdair { +// Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; + + /** Structure which handles the iterators for a leg-cabin list. */ + struct LegCabinList_T { + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the leg-cabin list iterators. */ + typedef BomIterator_T<LegCabin, + LegCabinStructureList_T::const_iterator> iterator; + typedef BomIterator_T<LegCabin, + LegCabinStructureList_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on leg cabin: + return the iterator at the begining of the list. */ + iterator begin () const; + + /** Initialise the internal iterator on leg cabin: + return the iterator at the end of the list. */ + iterator end () const; + + /** Initialise the internal reverse iterator on leg cabin: + return the reverse iterator at the rbegining of the list. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on leg cabin: + return the reverse iterator at the end of the list. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + LegCabinList_T (); + LegCabinList_T (const LegCabinList_T&); + LegCabinList_T (const LegDateStructure_T&); + + /** Destructor. */ + virtual ~LegCabinList_T(); + + private: + // Attributes + /** Reference structure. */ + const LegDateStructure_T& _legDateStructure; + }; + +} +#endif // __STDAIR_BOM_LEGCABINLIST_HPP + Copied: trunk/stdair/stdair/bom/LegCabinMap.cpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateMap.cpp) =================================================================== --- trunk/stdair/stdair/bom/LegCabinMap.cpp (rev 0) +++ trunk/stdair/stdair/bom/LegCabinMap.cpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,52 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/LegDateStructure.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/LegDate.hpp> +#include <stdair/bom/LegCabin.hpp> +#include <stdair/bom/LegCabinMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + LegCabinMap_T:: + LegCabinMap_T (const LegDateStructure_T& iLegDateStructure) + : _legDateStructure (iLegDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LegCabinMap_T:: + LegCabinMap_T (const LegCabinMap_T& iSCMap) + : _legDateStructure (iSCMap._legDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LegCabinMap_T::~LegCabinMap_T () { + } + + // ////////////////////////////////////////////////////////////////////// + LegCabinMap_T::iterator LegCabinMap_T::begin () const { + return _legDateStructure.legCabinMapBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + LegCabinMap_T::iterator LegCabinMap_T::end () const { + return _legDateStructure.legCabinMapEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + LegCabinMap_T::reverse_iterator LegCabinMap_T::rbegin () const { + return _legDateStructure.legCabinMapRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + LegCabinMap_T::reverse_iterator LegCabinMap_T::rend () const { + return _legDateStructure.legCabinMapREnd (); + } + +} + Copied: trunk/stdair/stdair/bom/LegCabinMap.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateMap.hpp) =================================================================== --- trunk/stdair/stdair/bom/LegCabinMap.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegCabinMap.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,65 @@ +#ifndef __STDAIR_BOM_LEGCABINMAP_HPP +#define __STDAIR_BOM_LEGCABINMAP_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/LegDateTypes.hpp> +#include <stdair/bom/LegCabinTypes.hpp> + +namespace stdair { +// Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; + + /** Structure which handles the iterators for a leg-date map. */ + struct LegCabinMap_T { + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the leg-date map iterators. */ + typedef BomIterator_T<LegCabin, + LegCabinStructureMap_T::const_iterator> iterator; + typedef BomIterator_T<LegCabin, + LegCabinStructureMap_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on leg date: + return the iterator at the begining of the map. */ + iterator begin () const; + + /** Initialise the internal iterator on leg date: + return the iterator at the end of the map. */ + iterator end () const; + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rbegining of the map. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the end of the map. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + LegCabinMap_T (); + LegCabinMap_T (const LegCabinMap_T&); + LegCabinMap_T (const LegDateStructure_T&); + + /** Destructor. */ + virtual ~LegCabinMap_T(); + + private: + // Attributes + /** Reference structure. */ + const LegDateStructure_T& _legDateStructure; + }; + +} +#endif // __STDAIR_BOM_LEGCABINMAP_HPP + Copied: trunk/stdair/stdair/bom/LegCabinStructure.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateStructure.hpp) =================================================================== --- trunk/stdair/stdair/bom/LegCabinStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegCabinStructure.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,129 @@ +#ifndef __STDAIR_BOM_LEGCABINSTRUCTURE_HPP +#define __STDAIR_BOM_LEGCABINSTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/LegCabinKey.hpp> +#include <stdair/bom/BookingClassStructure.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT> class LegDateStructure; + class BomStructureDummy; + class BomContentDummy; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific LegCabin class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class LegCabinStructure : public BomStructure { + friend class FacBomStructure; + friend class FacBomContent; + friend class BomStructure; + + public: + // Type definitions + /** Definition allowing to retrieve the associated BOM content type. */ + typedef BOM_CONTENT Content_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef LegCabinKey<BOM_CONTENT> BomKey_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector <BomStructureDummy, + BomStructureDummy> ChildrenBomTypeList_T; + + /** Definition allowing to retrieve the default children bom holder type. */ + typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + + public: + // /////////// Getters ///////////// + /** Get the (parent) LegDateStructure object. */ + ParentBomStructure_T* getLegDateStructurePtr() const { + return _parent; + } + + /** Get the (parent) LegDateStructure object. */ + ParentBomStructure_T& getLegDateStructure() const; + + /** Get the leg-date key. */ + const BomKey_T& getKey() const { + return _key; + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) LegDateStructure object. */ + void setLegDateStructure (ParentBomStructure_T& ioLegDateStructure) { + _parent = &ioLegDateStructure; + } + + /** Default children list setter. */ + void setChildrenList (DefaultChildrenBomHolder_T&) { } + + 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() << std::endl; + } + + /** Dump a Business Object with all its children into an output stream. + @param ostream& the output stream. */ + void describeFull (std::ostringstream& ioOut) const { + ioOut << describeShortKey () << std::endl; + } + + /** 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 { return describeKey(); } + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const { return _key.toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return _key.toString(); } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + LegCabinStructure (); + LegCabinStructure (const LegCabinStructure&); + LegCabinStructure (const BomKey_T& iKey) : _parent (NULL), _key (iKey){ } + + /** Destructor. */ + virtual ~LegCabinStructure() { } + + private: + // Attributes + /** Parent leg-date. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** The key of both the structure and content objects. */ + BomKey_T _key; + + }; + +} +#endif // __STDAIR_BOM_LEGCABINSTRUCTURE_HPP Copied: trunk/stdair/stdair/bom/LegCabinTypes.hpp (from rev 40, trunk/stdair/stdair/bom/SegmentDateTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/LegCabinTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegCabinTypes.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -0,0 +1,33 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_LEGCABINTYPES_HPP +#define __STDAIR_BOM_LEGCABINTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <map> +#include <vector> + +namespace stdair { + + // Forward declarations. + template <typename BOM_CONTENT> class LegCabinStructure; + template <typename BOM_CONTENT> class LegCabinKey; + class LegCabin; + + /** Define the LegCabin structure. */ + typedef LegCabinStructure<LegCabin> LegCabinStructure_T; + + /** Define the LegCabin key. */ + typedef LegCabinKey<LegCabin> LegCabinKey_T; + + /** Define the leg-cabin structure list. */ + typedef std::vector<LegCabinStructure_T*> LegCabinStructureList_T; + + /** Define the leg-cabin structure map. */ + typedef std::map<const std::string, LegCabinStructure_T*> LegCabinStructureMap_T; + +} +#endif // __STDAIR_BOM_LEGCABINTYPES_HPP + Modified: trunk/stdair/stdair/bom/LegDate.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.cpp 2009-10-12 08:57:42 UTC (rev 41) +++ trunk/stdair/stdair/bom/LegDate.cpp 2009-10-12 13:35:33 UTC (rev 42) @@ -7,6 +7,9 @@ #include <stdair/bom/LegDateStructure.hpp> #include <stdair/bom/FlightDate.hpp> #include <stdair/bom/LegDate.hpp> +#include <stdair/bom/LegCabin.hpp> +#include <stdair/bom/LegCabinList.hpp> +#include <stdair/bom/LegCabinMap.hpp> namespace stdair { @@ -51,5 +54,15 @@ return _legDateStructure.describeShortKey(); } + // ////////////////////////////////////////////////////////////////////// + LegCabinList_T LegDate::getLegCabinList () const { + return LegCabinList_T (_legDateStructure); + } + + // ////////////////////////////////////////////////////////////////////// + LegCabinMap_T LegDate::getLegCabinMap () const { + return LegCabinMap_T (_legDateStructure); + } + } Modified: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp 2009-10-12 08:57:42 UTC (rev 41) +++ trunk/stdair/stdair/bom/LegDate.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -7,11 +7,14 @@ // STDAIR #include <stdair/bom/BomContent.hpp> #include <stdair/bom/LegDateTypes.hpp> +#include <stdair/bom/LegCabinTypes.hpp> namespace stdair { // Forward declarations class FacBomContent; class FlightDate; + struct LegCabinList_T; + struct LegCabinMap_T; /** Class representing the actual functional/business content for a leg-date. */ @@ -29,9 +32,12 @@ /** Definition allowing to retrieve the associated BOM key type. */ typedef LegDateKey_T BomKey_T; + + /** Definition allowing to retrieve the associated + BOM content child type. */ + typedef LegCabin ContentChild_T; public: - // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ @@ -51,7 +57,15 @@ /** Get a string describing the short key (differentiating two objects at the same level). */ const std::string describeShortKey() const; + + public: + // /////////// Getters ///////////// + /** Get a LegCabinList_T for iteration methods. */ + LegCabinList_T getLegCabinList () const; + /** Get a LegCabinMap_T for iteration methods. */ + LegCabinMap_T getLegCabinMap () const; + private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { Modified: trunk/stdair/stdair/bom/LegDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-10-12 08:57:42 UTC (rev 41) +++ trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-10-12 13:35:33 UTC (rev 42) @@ -9,6 +9,7 @@ // STDAIR #include <stdair/bom/BomStructure.hpp> #include <stdair/bom/LegDateKey.hpp> +#include <stdair/bom/LegCabinStructure.hpp> #include <stdair/bom/BomChildrenHolderImp.hpp> namespace stdair { @@ -39,12 +40,28 @@ BOM structure type. */ typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; - /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector <BomStructureDummy, BomStructureDummy> ChildrenBomTypeList_T; + /** Definition allowing to retrieve the children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector <LegDateStructure<ContentChild_T>, + BomStructureDummy> ChildrenBomTypeList_T; /** Definition allowing to retrieve the default children bom holder type. */ typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + /** Definition allowing to retrive the children bom holder type. */ + typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + + /** Define the iterators of the leg-cabin list. */ + typedef typename ChildrenBomHolder_T::ListIterator_T LegCabinListIterator_T; + typedef typename ChildrenBomHolder_T::ListReverseIterator_T LegCabinListReverseIterator_T; + + /** Define the iterators of the leg-cabin map. */ + typedef typename ChildrenBomHolder_T::MapIterator_T LegCabinMapIterator_T; + typedef typename ChildrenBomHolder_T::MapReverseIterator_T LegCabinMapReverseIterator_T; + public: // /////////// Getters ///////////// /** Get the (parent) FlightDateStructure object. */ @@ -60,6 +77,16 @@ return _key; } + /** Get the list of leg-cabins. */ + const ChildrenBomHolder_T& getChildrenList() const { + return *_childrenList; + } + + /** Get the list of leg-cabins. */ + void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { + ioChildrenList = _childrenList; + } + private: // /////////// Setters ///////////// /** Set the (parent) FlightDateStructure object. */ @@ -70,6 +97,10 @@ /** Default children list setter. */ void setChildrenList (DefaultChildrenBomHolder_T&) { } + /** Set the leg-cabin children list. */ + void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { + _childrenList = &ioChildrenList; + } public: // /////////// Display support methods ///////// @@ -83,6 +114,7 @@ @param ostream& the output stream. */ void describeFull (std::ostringstream& ioOut) const { ioOut << describeShortKey () << std::endl; + displayLegCabinList (ioOut); } /** Read a Business Object from an input stream. @@ -100,6 +132,72 @@ at the same level). */ const std::string describeShortKey() const { return _key.toString(); } + /** Dump the leg-cabin children list in to an output stream. + @param ostream& the output stream. */ + void displayLegCabinList (std::ostringstream& ioOut) const { + ioOut << "LegCabins: " << std::endl; + assert (_childrenList != NULL); + _childrenList->describeFull (ioOut); + } + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on leg cabin: + return the iterator at the begining of the list. */ + LegCabinListIterator_T legCabinListBegin () const { + assert (_childrenList != NULL); + return _childrenList->listBegin (); + } + + /** Initialise the internal iterator on leg cabin: + return the iterator at the end of the list. */ + LegCabinListIterator_T legCabinListEnd () const { + assert (_childrenList != NULL); + return _childrenList->listEnd (); + } + + /** Initialise the internal reverse iterator on leg cabin: + return the reverse iterator at the rbegining of the list. */ + LegCabinListReverseIterator_T legCabinListRBegin () const { + assert (_childrenList != NULL); + return _childrenList->listRBegin (); + } + + /** Initialise the internal reverse iterator on leg cabin: + return the reverse iterator at the rend of the list. */ + LegCabinListReverseIterator_T legCabinListREnd () const { + assert (_childrenList != NULL); + return _childrenList->listREnd (); + } + + /** Initialise the internal iterator on leg cabin: + return the iterator at the begining of the map. */ + LegCabinMapIterator_T legCabinMapBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapBegin (); + } + + /** Initialise the internal iterator on leg cabin: + return the iterator at the end of the map. */ + LegCabinMapIterator_T legCabinMapEnd () const { + assert (_childrenList != NULL); + return _childrenList->mapEnd (); + } + + /** Initialise the internal reverse iterator on leg cabin: + return the reverse iterator at the rbegining of the map. */ + LegCabinMapReverseIterator_T legCabinMapRBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapRBegin (); + } + + /** Initialise the internal reverse iterator on leg cabin: + return the reverse iterator at the rend of the map. */ + LegCabinMapReverseIterator_T legCabinMapREnd () const { + assert (_childrenList != NULL); + return _childrenList->mapREnd (); + } + ... [truncated message content] |
From: <qua...@us...> - 2009-10-12 08:57:49
|
Revision: 41 http://stdair.svn.sourceforge.net/stdair/?rev=41&view=rev Author: quannaus Date: 2009-10-12 08:57:42 +0000 (Mon, 12 Oct 2009) Log Message: ----------- [Dev] Added iterators for Inventory. Bom root now replaces the former WorldSchedule. Modified Paths: -------------- trunk/stdair/stdair/bom/BomStructureRoot.hpp trunk/stdair/stdair/bom/InventoryList.hpp trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/InventoryList.cpp trunk/stdair/stdair/bom/InventoryMap.cpp trunk/stdair/stdair/bom/InventoryMap.hpp Modified: trunk/stdair/stdair/bom/BomStructureRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomStructureRoot.hpp 2009-10-09 14:15:42 UTC (rev 40) +++ trunk/stdair/stdair/bom/BomStructureRoot.hpp 2009-10-12 08:57:42 UTC (rev 41) @@ -47,7 +47,16 @@ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; public: + /** Define the iterators of the inventory list. */ + typedef typename ChildrenBomHolder_T::ListIterator_T InventoryListIterator_T; + typedef typename ChildrenBomHolder_T::ListReverseIterator_T InventoryListReverseIterator_T; + /** Define the iterators of the inventory map. */ + typedef typename ChildrenBomHolder_T::MapIterator_T InventoryMapIterator_T; + typedef typename ChildrenBomHolder_T::MapReverseIterator_T InventoryMapReverseIterator_T; + + public: + // /////////// Getters ///////////// /** Get the BomStructureRoot key. */ const BomKey_T& getKey() const { @@ -97,7 +106,64 @@ at the same level). */ const std::string describeShortKey() const { return _key.toString(); } + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on inventory: + return the iterator at the begining of the list. */ + InventoryListIterator_T inventoryListBegin () const { + assert (_childrenList != NULL); + return _childrenList->listBegin (); + } + + /** Initialise the internal iterator on inventory: + return the iterator at the end of the list. */ + InventoryListIterator_T inventoryListEnd () const { + assert (_childrenList != NULL); + return _childrenList->listEnd (); + } + + /** Initialise the internal reverse iterator on inventory: + return the reverse iterator at the rbegining of the list. */ + InventoryListReverseIterator_T inventoryListRBegin () const { + assert (_childrenList != NULL); + return _childrenList->listRBegin (); + } + + /** Initialise the internal reverse iterator on inventory: + return the reverse iterator at the rend of the list. */ + InventoryListReverseIterator_T inventoryListREnd () const { + assert (_childrenList != NULL); + return _childrenList->listREnd (); + } + /** Initialise the internal iterator on inventory: + return the iterator at the begining of the map. */ + InventoryMapIterator_T inventoryMapBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapBegin (); + } + + /** Initialise the internal iterator on inventory: + return the iterator at the end of the map. */ + InventoryMapIterator_T inventoryMapEnd () const { + assert (_childrenList != NULL); + return _childrenList->mapEnd (); + } + + /** Initialise the internal reverse iterator on inventory: + return the reverse iterator at the rbegining of the map. */ + InventoryMapReverseIterator_T inventoryMapRBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapRBegin (); + } + + /** Initialise the internal reverse iterator on inventory: + return the reverse iterator at the rend of the map. */ + InventoryMapReverseIterator_T inventoryMapREnd () const { + assert (_childrenList != NULL); + return _childrenList->mapREnd (); + } + private: /** Constructors are private so as to force the usage of the Factory layer. */ Copied: trunk/stdair/stdair/bom/InventoryList.cpp (from rev 40, trunk/stdair/stdair/bom/FlightDateList.cpp) =================================================================== --- trunk/stdair/stdair/bom/InventoryList.cpp (rev 0) +++ trunk/stdair/stdair/bom/InventoryList.cpp 2009-10-12 08:57:42 UTC (rev 41) @@ -0,0 +1,51 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/BomStructureRoot.hpp> +#include <stdair/bom/BomContentRoot.hpp> +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/InventoryList.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + InventoryList_T:: + InventoryList_T (const BomStructureRoot_T& iBomStructureRoot) + : _bomStructureRoot (iBomStructureRoot) { + } + + // //////////////////////////////////////////////////////////////////// + InventoryList_T:: + InventoryList_T (const InventoryList_T& iINVList) + : _bomStructureRoot (iINVList._bomStructureRoot) { + } + + // //////////////////////////////////////////////////////////////////// + InventoryList_T::~InventoryList_T () { + } + + // ////////////////////////////////////////////////////////////////////// + InventoryList_T::iterator InventoryList_T::begin () const { + return _bomStructureRoot.inventoryListBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + InventoryList_T::iterator InventoryList_T::end () const { + return _bomStructureRoot.inventoryListEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + InventoryList_T::reverse_iterator InventoryList_T::rbegin () const { + return _bomStructureRoot.inventoryListRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + InventoryList_T::reverse_iterator InventoryList_T::rend () const { + return _bomStructureRoot.inventoryListREnd (); + } + +} + Modified: trunk/stdair/stdair/bom/InventoryList.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryList.hpp 2009-10-09 14:15:42 UTC (rev 40) +++ trunk/stdair/stdair/bom/InventoryList.hpp 2009-10-12 08:57:42 UTC (rev 41) @@ -4,16 +4,63 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -#include <map> -#include <vector> -#include <list> +// STDAIR +#include <stdair/bom/BomRootTypes.hpp> +#include <stdair/bom/InventoryTypes.hpp> namespace stdair { + +// Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - /** Forward declarations. */ - class Inventory; + /** Structure which handles the iterators for a flight-date list. */ + struct InventoryList_T { + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the flight-date list iterators. */ + typedef BomIterator_T<Inventory, + InventoryStructureList_T::const_iterator> iterator; + typedef BomIterator_T<Inventory, + InventoryStructureList_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the list. */ + iterator begin () const; + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the list. */ + iterator end () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the list. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the end of the list. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + InventoryList_T (); + InventoryList_T (const InventoryList_T&); + InventoryList_T (const BomStructureRoot_T&); + + /** Destructor. */ + virtual ~InventoryList_T(); + + private: + // Attributes + /** Reference structure. */ + const BomStructureRoot_T& _bomStructureRoot; + }; + } #endif // __STDAIR_BOM_INVENTORYLIST_HPP + Copied: trunk/stdair/stdair/bom/InventoryMap.cpp (from rev 40, trunk/stdair/stdair/bom/FlightDateMap.cpp) =================================================================== --- trunk/stdair/stdair/bom/InventoryMap.cpp (rev 0) +++ trunk/stdair/stdair/bom/InventoryMap.cpp 2009-10-12 08:57:42 UTC (rev 41) @@ -0,0 +1,51 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/BomStructureRoot.hpp> +#include <stdair/bom/BomContentRoot.hpp> +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/InventoryMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + InventoryMap_T:: + InventoryMap_T (const BomStructureRoot_T& iBomStructureRoot) + : _bomStructureRoot (iBomStructureRoot) { + } + + // //////////////////////////////////////////////////////////////////// + InventoryMap_T:: + InventoryMap_T (const InventoryMap_T& iINVMap) + : _bomStructureRoot (iINVMap._bomStructureRoot) { + } + + // //////////////////////////////////////////////////////////////////// + InventoryMap_T::~InventoryMap_T () { + } + + // ////////////////////////////////////////////////////////////////////// + InventoryMap_T::iterator InventoryMap_T::begin () const { + return _bomStructureRoot.inventoryMapBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + InventoryMap_T::iterator InventoryMap_T::end () const { + return _bomStructureRoot.inventoryMapEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + InventoryMap_T::reverse_iterator InventoryMap_T::rbegin () const { + return _bomStructureRoot.inventoryMapRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + InventoryMap_T::reverse_iterator InventoryMap_T::rend () const { + return _bomStructureRoot.inventoryMapREnd (); + } + +} + Copied: trunk/stdair/stdair/bom/InventoryMap.hpp (from rev 40, trunk/stdair/stdair/bom/FlightDateMap.hpp) =================================================================== --- trunk/stdair/stdair/bom/InventoryMap.hpp (rev 0) +++ trunk/stdair/stdair/bom/InventoryMap.hpp 2009-10-12 08:57:42 UTC (rev 41) @@ -0,0 +1,66 @@ +#ifndef __STDAIR_BOM_INVENTORYMAP_HPP +#define __STDAIR_BOM_INVENTORYMAP_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomRootTypes.hpp> +#include <stdair/bom/InventoryTypes.hpp> + +namespace stdair { + +// Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; + + /** Structure which handles the iterators for a flight-date map. */ + struct InventoryMap_T { + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the flight-date map iterators. */ + typedef BomIterator_T<Inventory, + InventoryStructureMap_T::const_iterator> iterator; + typedef BomIterator_T<Inventory, + InventoryStructureMap_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the map. */ + iterator begin () const; + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the map. */ + iterator end () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the map. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the end of the map. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + InventoryMap_T (); + InventoryMap_T (const InventoryMap_T&); + InventoryMap_T (const BomStructureRoot_T&); + + /** Destructor. */ + virtual ~InventoryMap_T(); + + private: + // Attributes + /** Reference structure. */ + const BomStructureRoot_T& _bomStructureRoot; + }; + +} +#endif // __STDAIR_BOM_INVENTORYMAP_HPP + Modified: trunk/stdair/stdair/bom/sources.mk =================================================================== --- trunk/stdair/stdair/bom/sources.mk 2009-10-09 14:15:42 UTC (rev 40) +++ trunk/stdair/stdair/bom/sources.mk 2009-10-12 08:57:42 UTC (rev 41) @@ -11,6 +11,8 @@ $(top_srcdir)/stdair/bom/BomStructureDummy.hpp \ $(top_srcdir)/stdair/bom/Inventory.hpp \ $(top_srcdir)/stdair/bom/InventoryTypes.hpp \ + $(top_srcdir)/stdair/bom/InventoryList.hpp \ + $(top_srcdir)/stdair/bom/InventoryMap.hpp \ $(top_srcdir)/stdair/bom/InventoryStructure.hpp \ $(top_srcdir)/stdair/bom/FlightDate.hpp \ $(top_srcdir)/stdair/bom/FlightDateTypes.hpp \ @@ -35,6 +37,8 @@ $(top_srcdir)/stdair/bom/BomIterator.hpp bom_cc_sources = \ $(top_srcdir)/stdair/bom/Inventory.cpp \ + $(top_srcdir)/stdair/bom/InventoryList.cpp \ + $(top_srcdir)/stdair/bom/InventoryMap.cpp \ $(top_srcdir)/stdair/bom/FlightDate.cpp \ $(top_srcdir)/stdair/bom/FlightDateList.cpp \ $(top_srcdir)/stdair/bom/FlightDateMap.cpp \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-09 14:15:48
|
Revision: 40 http://stdair.svn.sourceforge.net/stdair/?rev=40&view=rev Author: quannaus Date: 2009-10-09 14:15:42 +0000 (Fri, 09 Oct 2009) Log Message: ----------- [Dev] Changed some private to protected. Modified Paths: -------------- trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/SegmentDate.hpp Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-09 13:58:02 UTC (rev 39) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-09 14:15:42 UTC (rev 40) @@ -102,7 +102,7 @@ /** Destructor. */ virtual ~FlightDate(); - private: + protected: // Attributes /** Reference structure. */ BomStructure_T& _flightDateStructure; Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2009-10-09 13:58:02 UTC (rev 39) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-09 14:15:42 UTC (rev 40) @@ -90,7 +90,7 @@ /** Destructor. */ virtual ~Inventory(); - private: + protected: // Attributes /** Reference structure. */ BomStructure_T& _inventoryStructure; Modified: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp 2009-10-09 13:58:02 UTC (rev 39) +++ trunk/stdair/stdair/bom/LegDate.hpp 2009-10-09 14:15:42 UTC (rev 40) @@ -69,7 +69,7 @@ /** Destructor. */ virtual ~LegDate(); - private: + protected: // Attributes /** Reference structure. */ BomStructure_T& _legDateStructure; Modified: trunk/stdair/stdair/bom/SegmentDate.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-09 13:58:02 UTC (rev 39) +++ trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-09 14:15:42 UTC (rev 40) @@ -69,7 +69,7 @@ /** Destructor. */ virtual ~SegmentDate(); - private: + protected: // Attributes /** Reference structure. */ BomStructure_T& _segmentDateStructure; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-09 13:58:08
|
Revision: 39 http://stdair.svn.sourceforge.net/stdair/?rev=39&view=rev Author: quannaus Date: 2009-10-09 13:58:02 +0000 (Fri, 09 Oct 2009) Log Message: ----------- [Dev] Added the content objects. Modified Paths: -------------- trunk/stdair/stdair/bom/BomStructureRoot.hpp trunk/stdair/stdair/bom/FlightDateKey.hpp trunk/stdair/stdair/bom/FlightDateList.hpp trunk/stdair/stdair/bom/FlightDateStructure.hpp trunk/stdair/stdair/bom/InventoryKey.hpp trunk/stdair/stdair/bom/InventoryList.hpp trunk/stdair/stdair/bom/InventoryStructure.hpp trunk/stdair/stdair/bom/LegDateKey.hpp trunk/stdair/stdair/bom/LegDateList.hpp trunk/stdair/stdair/bom/SegmentDateKey.hpp trunk/stdair/stdair/bom/SegmentDateList.hpp trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/BomRootTypes.hpp trunk/stdair/stdair/bom/FlightDate.cpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/FlightDateList.cpp trunk/stdair/stdair/bom/FlightDateMap.cpp trunk/stdair/stdair/bom/FlightDateMap.hpp trunk/stdair/stdair/bom/FlightDateTypes.hpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/InventoryTypes.hpp trunk/stdair/stdair/bom/LegDate.cpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/LegDateList.cpp trunk/stdair/stdair/bom/LegDateMap.cpp trunk/stdair/stdair/bom/LegDateMap.hpp trunk/stdair/stdair/bom/LegDateTypes.hpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentDate.hpp trunk/stdair/stdair/bom/SegmentDateList.cpp trunk/stdair/stdair/bom/SegmentDateMap.cpp trunk/stdair/stdair/bom/SegmentDateMap.hpp trunk/stdair/stdair/bom/SegmentDateTypes.hpp Added: trunk/stdair/stdair/bom/BomRootTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRootTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/BomRootTypes.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,27 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_BOMROOTTYPES_HPP +#define __STDAIR_BOM_BOMROOTTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// + +namespace stdair { + // Forward declarations. + template <typename BOM_CONTENT> class BomStructureRoot; + template <typename BOM_CONTENT> class BomStructureRootKey; + template <typename BOM_CHILD> class BomContentRoot; + class Inventory; + + /** Define the BomContentRoot. */ + typedef BomContentRoot<Inventory> BomContentRoot_T; + + /** Define the BomStructureRoot. */ + typedef BomStructureRoot<BomContentRoot_T> BomStructureRoot_T; + + /** Define the BomStructureRootKey. */ + typedef BomStructureRootKey<BomContentRoot_T> BomStructureRootKey_T; + +} +#endif // __STDAIR_BOM_BOMROOTTYPES_HPP + Modified: trunk/stdair/stdair/bom/BomStructureRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomStructureRoot.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/BomStructureRoot.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -13,7 +13,7 @@ namespace stdair { // Forward declarations. - template <typename BOM_CONTENT> class Inventory; + template <typename BOM_CONTENT> class InventoryStructure; class BomStructureDummy; class BomContentDummy; @@ -38,7 +38,7 @@ typedef BomStructureRootKey<BOM_CONTENT> BomKey_T; /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector<Inventory<ContentChild_T>, BomStructureDummy> ChildrenBomTypeList_T; + typedef boost::mpl::vector<InventoryStructure<ContentChild_T>, BomStructureDummy> ChildrenBomTypeList_T; /** Definition allowing to retrive the default children bom holder type. */ typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; Added: trunk/stdair/stdair/bom/FlightDate.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.cpp (rev 0) +++ trunk/stdair/stdair/bom/FlightDate.cpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,81 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STL +#include <iostream> +#include <algorithm> +// STDAIR +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/FlightDateStructure.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/SegmentDateList.hpp> +#include <stdair/bom/SegmentDateMap.hpp> +#include <stdair/bom/LegDate.hpp> +#include <stdair/bom/LegDateList.hpp> +#include <stdair/bom/LegDateMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + FlightDate::FlightDate (BomStructure_T& ioFlightStructure) + : _flightDateStructure (ioFlightStructure) { + } + + // //////////////////////////////////////////////////////////////////// + FlightDate::~FlightDate () { + } + + // ////////////////////////////////////////////////////////////////////// + void FlightDate::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void FlightDate::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string FlightDate::toString() const { + std::ostringstream oStr; + + // First, put the key of that level + oStr << describeShortKey() << std::endl; + + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string FlightDate::describeKey() const { + return _flightDateStructure.describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string FlightDate::describeShortKey() const { + return _flightDateStructure.describeShortKey(); + } + + // ////////////////////////////////////////////////////////////////////// + SegmentDateList_T FlightDate::getSegmentDateList () const { + return SegmentDateList_T (_flightDateStructure); + } + + // ////////////////////////////////////////////////////////////////////// + SegmentDateMap_T FlightDate::getSegmentDateMap () const { + return SegmentDateMap_T (_flightDateStructure); + } + + // ////////////////////////////////////////////////////////////////////// + LegDateList_T FlightDate::getLegDateList () const { + return LegDateList_T (_flightDateStructure); + } + + // ////////////////////////////////////////////////////////////////////// + LegDateMap_T FlightDate::getLegDateMap () const { + return LegDateMap_T (_flightDateStructure); + } + +} + Added: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp (rev 0) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,113 @@ +#ifndef __STDAIR_BOM_FLIGHTDATE_HPP +#define __STDAIR_BOM_FLIGHTDATE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomStructureList.hpp> +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/FlightDateTypes.hpp> +#include <stdair/bom/SegmentDateTypes.hpp> +#include <stdair/bom/LegDateTypes.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + class BomStructure; + class Inventory; + struct SegmentDateList_T; + struct SegmentDateMap_T; + struct LegDateList_T; + struct LegDateMap_T; + + /** Class representing the actual functional/business content for a + flight-date. */ + class FlightDate : public BomContent { + friend class FacBomContent; + + public: + // Type definitions + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the BomContentRoot class, for all + // the types which require to be specified below + // ///////////////////////////////////////////////////////////////////////// + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef Inventory ParentBomContent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef FlightDateStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef FlightDateKey_T BomKey_T; + + /** Definition allowing to retrieve the associated + BOM content child type. */ + typedef SegmentDate ContentChild_T; + + /** Definition allowing to retrieve the associated second + BOM content child type. */ + typedef LegDate SecondContentChild_T; + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** 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 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: + // /////////// Getters ///////////// + /** Get a SegmentDateList_T for iteration methods. */ + SegmentDateList_T getSegmentDateList () const; + + /** Get a SegmentDateMap_T for iteration methods. */ + SegmentDateMap_T getSegmentDateMap () const; + + /** Get a LegDateList_T for iteration methods. */ + LegDateList_T getLegDateList () const; + + /** Get a LegDateMap_T for iteration methods. */ + LegDateMap_T getLegDateMap () const; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _flightDateStructure; + } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + FlightDate (); + FlightDate (const FlightDate&); + FlightDate (BomStructure_T&); + + /** Destructor. */ + virtual ~FlightDate(); + + private: + // Attributes + /** Reference structure. */ + BomStructure_T& _flightDateStructure; + }; + +} +#endif // __STDAIR_BOM_FLIGHTDATE_HPP + Modified: trunk/stdair/stdair/bom/FlightDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateKey.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/FlightDateKey.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -12,7 +12,7 @@ // Forward declarations template <typename BOM_CONTENT> - class FlightDate; + class FlightDateStructure; /** Key of flight-date. */ template <typename BOM_CONTENT> @@ -23,7 +23,7 @@ private: // Type definitions /** Definition allowing to retrieve the associated BOM structure type. */ - typedef FlightDate<BOM_CONTENT> BomStructure_T; + typedef FlightDateStructure<BOM_CONTENT> BomStructure_T; public: // /////////// Construction /////////// Added: trunk/stdair/stdair/bom/FlightDateList.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateList.cpp (rev 0) +++ trunk/stdair/stdair/bom/FlightDateList.cpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,51 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/InventoryStructure.hpp> +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/FlightDateList.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + FlightDateList_T:: + FlightDateList_T (const InventoryStructure_T& iInventoryStructure) + : _inventoryStructure (iInventoryStructure) { + } + + // //////////////////////////////////////////////////////////////////// + FlightDateList_T:: + FlightDateList_T (const FlightDateList_T& iFDList) + : _inventoryStructure (iFDList._inventoryStructure) { + } + + // //////////////////////////////////////////////////////////////////// + FlightDateList_T::~FlightDateList_T () { + } + + // ////////////////////////////////////////////////////////////////////// + FlightDateList_T::iterator FlightDateList_T::begin () const { + return _inventoryStructure.flightDateListBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + FlightDateList_T::iterator FlightDateList_T::end () const { + return _inventoryStructure.flightDateListEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + FlightDateList_T::reverse_iterator FlightDateList_T::rbegin () const { + return _inventoryStructure.flightDateListRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + FlightDateList_T::reverse_iterator FlightDateList_T::rend () const { + return _inventoryStructure.flightDateListREnd (); + } + +} + Modified: trunk/stdair/stdair/bom/FlightDateList.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateList.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/FlightDateList.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -4,21 +4,63 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -#include <map> -#include <vector> -#include <list> +// STDAIR +#include <stdair/bom/InventoryTypes.hpp> +#include <stdair/bom/FlightDateTypes.hpp> namespace stdair { + +// Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - /** Forward declarations. */ - class FlightDate; + /** Structure which handles the iterators for a flight-date list. */ + struct FlightDateList_T { - /** Define lists of Flight-Date objects. */ - typedef std::map<std::string, FlightDate*> FlightDateList_T; - typedef std::vector<FlightDate*> FlightDateOrderedList_T; - typedef std::list<const FlightDate*> FlightDateLightList_T; + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the flight-date list iterators. */ + typedef BomIterator_T<FlightDate, + FlightDateStructureList_T::const_iterator> iterator; + typedef BomIterator_T<FlightDate, + FlightDateStructureList_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the list. */ + iterator begin () const; + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the list. */ + iterator end () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the list. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the end of the list. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + FlightDateList_T (); + FlightDateList_T (const FlightDateList_T&); + FlightDateList_T (const InventoryStructure_T&); + + /** Destructor. */ + virtual ~FlightDateList_T(); + + private: + // Attributes + /** Reference structure. */ + const InventoryStructure_T& _inventoryStructure; + }; + } #endif // __STDAIR_BOM_FLIGHTDATELIST_HPP + Added: trunk/stdair/stdair/bom/FlightDateMap.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateMap.cpp (rev 0) +++ trunk/stdair/stdair/bom/FlightDateMap.cpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,51 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/InventoryStructure.hpp> +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/FlightDateMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + FlightDateMap_T:: + FlightDateMap_T (const InventoryStructure_T& iInventoryStructure) + : _inventoryStructure (iInventoryStructure) { + } + + // //////////////////////////////////////////////////////////////////// + FlightDateMap_T:: + FlightDateMap_T (const FlightDateMap_T& iFDMap) + : _inventoryStructure (iFDMap._inventoryStructure) { + } + + // //////////////////////////////////////////////////////////////////// + FlightDateMap_T::~FlightDateMap_T () { + } + + // ////////////////////////////////////////////////////////////////////// + FlightDateMap_T::iterator FlightDateMap_T::begin () const { + return _inventoryStructure.flightDateMapBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + FlightDateMap_T::iterator FlightDateMap_T::end () const { + return _inventoryStructure.flightDateMapEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + FlightDateMap_T::reverse_iterator FlightDateMap_T::rbegin () const { + return _inventoryStructure.flightDateMapRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + FlightDateMap_T::reverse_iterator FlightDateMap_T::rend () const { + return _inventoryStructure.flightDateMapREnd (); + } + +} + Added: trunk/stdair/stdair/bom/FlightDateMap.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateMap.hpp (rev 0) +++ trunk/stdair/stdair/bom/FlightDateMap.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,65 @@ +#ifndef __STDAIR_BOM_FLIGHTDATEMAP_HPP +#define __STDAIR_BOM_FLIGHTDATEMAP_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/InventoryTypes.hpp> +#include <stdair/bom/FlightDateTypes.hpp> + +namespace stdair { +// Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; + + /** Structure which handles the iterators for a flight-date map. */ + struct FlightDateMap_T { + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the flight-date map iterators. */ + typedef BomIterator_T<FlightDate, + FlightDateStructureMap_T::const_iterator> iterator; + typedef BomIterator_T<FlightDate, + FlightDateStructureMap_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the map. */ + iterator begin () const; + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the map. */ + iterator end () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the map. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the end of the map. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + FlightDateMap_T (); + FlightDateMap_T (const FlightDateMap_T&); + FlightDateMap_T (const InventoryStructure_T&); + + /** Destructor. */ + virtual ~FlightDateMap_T(); + + private: + // Attributes + /** Reference structure. */ + const InventoryStructure_T& _inventoryStructure; + }; + +} +#endif // __STDAIR_BOM_FLIGHTDATEMAP_HPP + Modified: trunk/stdair/stdair/bom/FlightDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -16,7 +16,7 @@ namespace stdair { // Forward declaration - template <typename BOM_CONTENT> class Inventory; + template <typename BOM_CONTENT> class InventoryStructure; class BomContentDummy; /** Wrapper class aimed at holding the actual content, modeled Added: trunk/stdair/stdair/bom/FlightDateTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/FlightDateTypes.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,33 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_FLIGHTDATETYPES_HPP +#define __STDAIR_BOM_FLIGHTDATETYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <map> +#include <vector> + +namespace stdair { + + // Forward declarations. + template <typename BOM_CONTENT> class FlightDateStructure; + template <typename BOM_CONTENT> class FlightDateKey; + class FlightDate; + + /** Define the FlightDate structure. */ + typedef FlightDateStructure<FlightDate> FlightDateStructure_T; + + /** Define the FlightDate key. */ + typedef FlightDateKey<FlightDate> FlightDateKey_T; + + /** Define the flight-date structure list. */ + typedef std::vector<FlightDateStructure_T*> FlightDateStructureList_T; + + /** Define the flight-date structure map. */ + typedef std::map<const std::string, FlightDateStructure_T*> FlightDateStructureMap_T; + +} +#endif // __STDAIR_BOM_FLIGHTDATETYPES_HPP + Added: trunk/stdair/stdair/bom/Inventory.cpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.cpp (rev 0) +++ trunk/stdair/stdair/bom/Inventory.cpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,65 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/InventoryStructure.hpp> +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/FlightDateList.hpp> +#include <stdair/bom/FlightDateMap.hpp> +#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/LegDate.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + Inventory::Inventory (BomStructure_T& ioInventoryStructure) + : _inventoryStructure (ioInventoryStructure) { + } + + // //////////////////////////////////////////////////////////////////// + Inventory::~Inventory () { + } + + // ////////////////////////////////////////////////////////////////////// + void Inventory::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void Inventory::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string Inventory::toString() const { + std::ostringstream oStr; + + _inventoryStructure.describeFull (oStr); + + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string Inventory::describeKey() const { + return _inventoryStructure.describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string Inventory::describeShortKey() const { + return _inventoryStructure.describeShortKey(); + } + + // ////////////////////////////////////////////////////////////////////// + FlightDateList_T Inventory::getFlightDateList () const { + return FlightDateList_T (_inventoryStructure); + } + + // ////////////////////////////////////////////////////////////////////// + FlightDateMap_T Inventory::getFlightDateMap () const { + return FlightDateMap_T (_inventoryStructure); + } + +} + Added: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp (rev 0) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,101 @@ +#ifndef __STDAIR_BOM_INVENTORY_HPP +#define __STDAIR_BOM_INVENTORY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/BomContentRoot.hpp> +#include <stdair/bom/BomRootTypes.hpp> +#include <stdair/bom/InventoryTypes.hpp> +#include <stdair/bom/FlightDateTypes.hpp> + +namespace stdair { + + // Forward declarations + class FacBomContent; + class FlightDate; + struct FlightDateList_T; + struct FlightDateMap_T; + + /** Class representing the actual functional/business content for + an airline inventory. */ + class Inventory : public BomContent { + friend class FacBomContent; + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the BomContentRoot class, for all + // the types which require to be specified below + // ///////////////////////////////////////////////////////////////////////// + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef BomContentRoot_T ParentBomContent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef InventoryStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef InventoryKey_T BomKey_T; + + /** Definition allowing to retrieve the associated BOM content child + type. */ + typedef FlightDate ContentChild_T; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** 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 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: + // /////////// Getters ///////////// + /** Get a FlightDateList_T for iteration methods. */ + FlightDateList_T getFlightDateList () const; + + /** Get a FlightDateMap_T for iteration methods. */ + FlightDateMap_T getFlightDateMap () const; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _inventoryStructure; + } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + Inventory (); + Inventory (const Inventory&); + Inventory (BomStructure_T&); + + /** Destructor. */ + virtual ~Inventory(); + + private: + // Attributes + /** Reference structure. */ + BomStructure_T& _inventoryStructure; + }; + +} +#endif // __STDAIR_BOM_INVENTORY_HPP + Modified: trunk/stdair/stdair/bom/InventoryKey.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryKey.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/InventoryKey.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -11,7 +11,7 @@ namespace stdair { // Forward declarations - template<typename BOM_CONTENT> class Inventory; + template<typename BOM_CONTENT> class InventoryStructure; /** Key of flight-date. */ template <typename BOM_CONTENT> @@ -22,7 +22,7 @@ private: // Type definitions /** Definition allowing to retrieve the associated BOM structure type. */ - typedef Inventory<BOM_CONTENT> BomStructure_T; + typedef InventoryStructure<BOM_CONTENT> BomStructure_T; public: // /////////// Construction /////////// Modified: trunk/stdair/stdair/bom/InventoryList.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryList.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/InventoryList.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -15,10 +15,5 @@ /** Forward declarations. */ class Inventory; - /** Define lists of Inventory objects. */ - typedef std::map<std::string, Inventory*> InventoryList_T; - typedef std::vector<Inventory*> InventoryOrderedList_T; - typedef std::list<const Inventory*> InventoryLightList_T; - } #endif // __STDAIR_BOM_INVENTORYLIST_HPP Modified: trunk/stdair/stdair/bom/InventoryStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -48,7 +48,7 @@ typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector<FlightDate<ContentChild_T>, + typedef boost::mpl::vector<FlightDateStructure<ContentChild_T>, BomStructureDummy> ChildrenBomTypeList_T; /** Define the default children bom holder type. */ Added: trunk/stdair/stdair/bom/InventoryTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/InventoryTypes.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,33 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_INVENTORYTYPES_HPP +#define __STDAIR_BOM_INVENTORYTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <vector> +#include <map> + +namespace stdair { + + // Forward declarations. + template <typename BOM_CONTENT> class InventoryStructure; + template <typename BOM_CONTENT> class InventoryKey; + class Inventory; + + /** Define the Inventory structure. */ + typedef InventoryStructure<Inventory> InventoryStructure_T; + + /** Define the Inventory key. */ + typedef InventoryKey<Inventory> InventoryKey_T; + + /** Define the flight-date structure list. */ + typedef std::vector<InventoryStructure_T*> InventoryStructureList_T; + + /** Define the flight-date structure map. */ + typedef std::map<const std::string, InventoryStructure_T*> InventoryStructureMap_T; + +} +#endif // __STDAIR_BOM_INVENTORYTYPES_HPP + Added: trunk/stdair/stdair/bom/LegDate.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.cpp (rev 0) +++ trunk/stdair/stdair/bom/LegDate.cpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,55 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STDAIR +#include <stdair/bom/LegDateStructure.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/LegDate.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + LegDate::LegDate (BomStructure_T& ioLegStructure) + : _legDateStructure (ioLegStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LegDate::~LegDate () { + } + + // ////////////////////////////////////////////////////////////////////// + void LegDate::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void LegDate::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string LegDate::toString() const { + std::ostringstream oStr; + + // First, put the key of that level + oStr << describeShortKey() << std::endl; + + // Then, browse the children + // [...] (no child for now) + + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string LegDate::describeKey() const { + return _legDateStructure.describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string LegDate::describeShortKey() const { + return _legDateStructure.describeShortKey(); + } + +} + Added: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegDate.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,80 @@ +#ifndef __STDAIR_BOM_LEGDATE_HPP +#define __STDAIR_BOM_LEGDATE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/LegDateTypes.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + class FlightDate; + + /** Class representing the actual functional/business content for a + leg-date. */ + class LegDate : public BomContent { + friend class FacBomContent; + + public: + // Type definitions + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef FlightDate ParentBomContent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef LegDateStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef LegDateKey_T BomKey_T; + + public: + + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** 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 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; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _legDateStructure; + } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + LegDate (); + LegDate (const LegDate&); + LegDate (BomStructure_T&); + + /** Destructor. */ + virtual ~LegDate(); + + private: + // Attributes + /** Reference structure. */ + BomStructure_T& _legDateStructure; + }; + +} +#endif // __STDAIR_BOM_LEGDATE_HPP + Modified: trunk/stdair/stdair/bom/LegDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateKey.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/LegDateKey.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -12,7 +12,7 @@ // Forward declarations template <typename BOM_CONTENT> - class LegDate; + class LegDateStructure; /** Key of leg-date. */ template <typename BOM_CONTENT> @@ -23,7 +23,7 @@ private: // Type definitions /** Definition allowing to retrieve the associated BOM structure type. */ - typedef LegDate<BOM_CONTENT> BomStructure_T; + typedef LegDateStructure<BOM_CONTENT> BomStructure_T; public: // /////////// Construction /////////// Added: trunk/stdair/stdair/bom/LegDateList.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDateList.cpp (rev 0) +++ trunk/stdair/stdair/bom/LegDateList.cpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,53 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/FlightDateStructure.hpp> +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/LegDate.hpp> +#include <stdair/bom/LegDateList.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + LegDateList_T:: + LegDateList_T (const FlightDateStructure_T& iFlightDateStructure) + : _flightDateStructure (iFlightDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LegDateList_T:: + LegDateList_T (const LegDateList_T& iSDList) + : _flightDateStructure (iSDList._flightDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LegDateList_T::~LegDateList_T () { + } + + // ////////////////////////////////////////////////////////////////////// + LegDateList_T::iterator LegDateList_T::begin () const { + return _flightDateStructure.legDateListBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + LegDateList_T::iterator LegDateList_T::end () const { + return _flightDateStructure.legDateListEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + LegDateList_T::reverse_iterator LegDateList_T::rbegin () const { + return _flightDateStructure.legDateListRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + LegDateList_T::reverse_iterator LegDateList_T::rend () const { + return _flightDateStructure.legDateListREnd (); + } + +} + Modified: trunk/stdair/stdair/bom/LegDateList.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateList.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/LegDateList.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -4,21 +4,62 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -#include <map> -#include <vector> -#include <list> +// STDAIR +#include <stdair/bom/FlightDateTypes.hpp> +#include <stdair/bom/LegDateTypes.hpp> namespace stdair { + // Forward declarations. + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - /** Forward declarations. */ - class LegDate; + /** Structure which handles the iterators for a leg-date list. */ + struct LegDateList_T { - /** Define lists of Leg-Date objects. */ - typedef std::map<std::string, LegDate*> LegDateList_T; - typedef std::vector<LegDate*> LegDateOrderedList_T; - typedef std::list<const LegDate*> LegDateLightList_T; + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the leg-date list iterators. */ + typedef BomIterator_T<LegDate, + LegDateStructureList_T::const_iterator> iterator; + typedef BomIterator_T<LegDate, + LegDateStructureList_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on leg date: + return the iterator at the begining of the list. */ + iterator begin () const; + + /** Initialise the internal iterator on leg date: + return the iterator at the end of the list. */ + iterator end () const; + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rbegining of the list. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the end of the list. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + LegDateList_T (); + LegDateList_T (const LegDateList_T&); + LegDateList_T (const FlightDateStructure_T&); + + /** Destructor. */ + virtual ~LegDateList_T(); + + private: + // Attributes + /** Reference structure. */ + const FlightDateStructure_T& _flightDateStructure; + }; + } #endif // __STDAIR_BOM_LEGDATELIST_HPP + Added: trunk/stdair/stdair/bom/LegDateMap.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDateMap.cpp (rev 0) +++ trunk/stdair/stdair/bom/LegDateMap.cpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,53 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/FlightDateStructure.hpp> +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/LegDate.hpp> +#include <stdair/bom/LegDateMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + LegDateMap_T:: + LegDateMap_T (const FlightDateStructure_T& iFlightDateStructure) + : _flightDateStructure (iFlightDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LegDateMap_T:: + LegDateMap_T (const LegDateMap_T& iSDMap) + : _flightDateStructure (iSDMap._flightDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LegDateMap_T::~LegDateMap_T () { + } + + // ////////////////////////////////////////////////////////////////////// + LegDateMap_T::iterator LegDateMap_T::begin () const { + return _flightDateStructure.legDateMapBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + LegDateMap_T::iterator LegDateMap_T::end () const { + return _flightDateStructure.legDateMapEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + LegDateMap_T::reverse_iterator LegDateMap_T::rbegin () const { + return _flightDateStructure.legDateMapRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + LegDateMap_T::reverse_iterator LegDateMap_T::rend () const { + return _flightDateStructure.legDateMapREnd (); + } + +} + Added: trunk/stdair/stdair/bom/LegDateMap.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateMap.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegDateMap.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,65 @@ +#ifndef __STDAIR_BOM_LEGDATEMAP_HPP +#define __STDAIR_BOM_LEGDATEMAP_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/FlightDateTypes.hpp> +#include <stdair/bom/LegDateTypes.hpp> + +namespace stdair { +// Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; + + /** Structure which handles the iterators for a leg-date map. */ + struct LegDateMap_T { + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the leg-date map iterators. */ + typedef BomIterator_T<LegDate, + LegDateStructureMap_T::const_iterator> iterator; + typedef BomIterator_T<LegDate, + LegDateStructureMap_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on leg date: + return the iterator at the begining of the map. */ + iterator begin () const; + + /** Initialise the internal iterator on leg date: + return the iterator at the end of the map. */ + iterator end () const; + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rbegining of the map. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the end of the map. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + LegDateMap_T (); + LegDateMap_T (const LegDateMap_T&); + LegDateMap_T (const FlightDateStructure_T&); + + /** Destructor. */ + virtual ~LegDateMap_T(); + + private: + // Attributes + /** Reference structure. */ + const FlightDateStructure_T& _flightDateStructure; + }; + +} +#endif // __STDAIR_BOM_LEGDATEMAP_HPP + Added: trunk/stdair/stdair/bom/LegDateTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegDateTypes.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,33 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_LEGDATETYPES_HPP +#define __STDAIR_BOM_LEGDATETYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <map> +#include <vector> + +namespace stdair { + + // Forward declarations. + template <typename BOM_CONTENT> class LegDateStructure; + template <typename BOM_CONTENT> class LegDateKey; + class LegDate; + + /** Define the LegDate structure. */ + typedef LegDateStructure<LegDate> LegDateStructure_T; + + /** Define the LegDate key. */ + typedef LegDateKey<LegDate> LegDateKey_T; + + /** Define the leg-date structure list. */ + typedef std::vector<LegDateStructure_T*> LegDateStructureList_T; + + /** Define the leg-date structure map. */ + typedef std::map<const std::string, LegDateStructure_T*> LegDateStructureMap_T; + +} +#endif // __STDAIR_BOM_LEGDATETYPES_HPP + Added: trunk/stdair/stdair/bom/SegmentDate.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.cpp (rev 0) +++ trunk/stdair/stdair/bom/SegmentDate.cpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,55 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STDAIR +#include <stdair/bom/SegmentDateStructure.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/SegmentDate.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + SegmentDate::SegmentDate (BomStructure_T& ioSegmentStructure) + : _segmentDateStructure (ioSegmentStructure) { + } + + // //////////////////////////////////////////////////////////////////// + SegmentDate::~SegmentDate () { + } + + // ////////////////////////////////////////////////////////////////////// + void SegmentDate::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void SegmentDate::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string SegmentDate::toString() const { + std::ostringstream oStr; + + // First, put the key of that level + oStr << describeShortKey() << std::endl; + + // Then, browse the children + // [...] (no child for now) + + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string SegmentDate::describeKey() const { + return _segmentDateStructure.describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string SegmentDate::describeShortKey() const { + return _segmentDateStructure.describeShortKey(); + } + +} + Added: trunk/stdair/stdair/bom/SegmentDate.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.hpp (rev 0) +++ trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,80 @@ +#ifndef __STDAIR_BOM_SEGMENTDATE_HPP +#define __STDAIR_BOM_SEGMENTDATE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/SegmentDateTypes.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + class FlightDate; + + /** Class representing the actual functional/business content for a + segment-date. */ + class SegmentDate : public BomContent { + friend class FacBomContent; + + public: + // Type definitions + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef FlightDate ParentBomContent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef SegmentDateStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef SegmentDateKey_T BomKey_T; + + public: + + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** 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 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; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _segmentDateStructure; + } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + SegmentDate (); + SegmentDate (const SegmentDate&); + SegmentDate (BomStructure_T&); + + /** Destructor. */ + virtual ~SegmentDate(); + + private: + // Attributes + /** Reference structure. */ + BomStructure_T& _segmentDateStructure; + }; + +} +#endif // __STDAIR_BOM_SEGMENTDATE_HPP + Modified: trunk/stdair/stdair/bom/SegmentDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateKey.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/SegmentDateKey.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -12,7 +12,7 @@ // Forward declarations template <typename BOM_CONTENT> - class SegmentDate; + class SegmentDateStructure; /** Key of segment-date. */ template <typename BOM_CONTENT> @@ -23,7 +23,7 @@ private: // Type definitions /** Definition allowing to retrieve the associated BOM structure type. */ - typedef SegmentDate<BOM_CONTENT> BomStructure_T; + typedef SegmentDateStructure<BOM_CONTENT> BomStructure_T; public: // /////////// Construction /////////// Added: trunk/stdair/stdair/bom/SegmentDateList.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateList.cpp (rev 0) +++ trunk/stdair/stdair/bom/SegmentDateList.cpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,53 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/FlightDateStructure.hpp> +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/SegmentDateList.hpp> +#include <stdair/bom/LegDate.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + SegmentDateList_T:: + SegmentDateList_T (const FlightDateStructure_T& iFlightDateStructure) + : _flightDateStructure (iFlightDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + SegmentDateList_T:: + SegmentDateList_T (const SegmentDateList_T& iSDList) + : _flightDateStructure (iSDList._flightDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + SegmentDateList_T::~SegmentDateList_T () { + } + + // ////////////////////////////////////////////////////////////////////// + SegmentDateList_T::iterator SegmentDateList_T::begin () const { + return _flightDateStructure.segmentDateListBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + SegmentDateList_T::iterator SegmentDateList_T::end () const { + return _flightDateStructure.segmentDateListEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + SegmentDateList_T::reverse_iterator SegmentDateList_T::rbegin () const { + return _flightDateStructure.segmentDateListRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + SegmentDateList_T::reverse_iterator SegmentDateList_T::rend () const { + return _flightDateStructure.segmentDateListREnd (); + } + +} + Modified: trunk/stdair/stdair/bom/SegmentDateList.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateList.hpp 2009-10-09 13:07:14 UTC (rev 38) +++ trunk/stdair/stdair/bom/SegmentDateList.hpp 2009-10-09 13:58:02 UTC (rev 39) @@ -4,21 +4,62 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -#include <map> -#include <vector> -#include <list> +// STDAIR +#include <stdair/bom/FlightDateTypes.hpp> +#include <stdair/bom/SegmentDateTypes.hpp> namespace stdair { +// Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; - /** Forward declarations. */ - class SegmentDate; + /** Structure which handles the iterators for a segment-date list. */ + struct SegmentDateList_T { - /** Define lists of Segment-Date objects. */ - typedef std::map<std::string, SegmentDate*> SegmentDateList_T; - typedef std::vector<SegmentDate*> SegmentDateOrderedList_T; - typedef std::list<const SegmentDate*> SegmentDateLightList_T; + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the segment-date list iterators. */ + typedef BomIterator_T<SegmentDate, + SegmentDateStructureList_T::const_iterator> iterator; + typedef BomIterator_T<SegmentDate, + SegmentDateStructureList_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on segment date: + return the iterator at the begining of the list. */ + iterator begin () const; + + /** Initialise the internal iterator on segment date: + return the iterator at the end of the list. */ + iterator end () const; + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rbegining of the list. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the end of the list. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + SegmentDateList_T (); + SegmentDateList_T (const SegmentDateList_T&); + SegmentDateList_T (const FlightDateStructure_T&); + + /** Destructor. */ + virtual ~SegmentDateList_T(); + + private: + // Attributes + /** Reference structure. */ + const FlightDateStructure_T& _flightDateStructure; + }; + } #endif // __STDAIR_BOM_SEGMENTDATELIST_HPP + Added: trunk/stdair/stdair/bom/SegmentDateMap.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateMap.cpp (rev 0) +++ trunk/stdair/stdair/bom/SegmentDateMap.cpp 2009-10-09 13:58:02 UTC (rev 39) @@ -0,0 +1,53 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// /////////////////////////////////////////////////////////////////... [truncated message content] |
From: <qua...@us...> - 2009-10-09 13:07:23
|
Revision: 38 http://stdair.svn.sourceforge.net/stdair/?rev=38&view=rev Author: quannaus Date: 2009-10-09 13:07:14 +0000 (Fri, 09 Oct 2009) Log Message: ----------- [Dev] Changed the name of bom structure objects. Modified Paths: -------------- trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/FlightDateStructure.hpp trunk/stdair/stdair/bom/InventoryStructure.hpp trunk/stdair/stdair/bom/LegDateStructure.hpp trunk/stdair/stdair/bom/SegmentDateStructure.hpp Removed Paths: ------------- trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/SegmentDate.hpp Deleted: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-08 15:22:51 UTC (rev 37) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -1,336 +0,0 @@ -#ifndef __STDAIR_BOM_FLIGHTDATE_HPP -#define __STDAIR_BOM_FLIGHTDATE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// MPL -#include <boost/mpl/vector.hpp> -// STDAIR -#include <stdair/bom/BomStructure.hpp> -#include <stdair/bom/FlightDateKey.hpp> -#include <stdair/bom/SegmentDate.hpp> -#include <stdair/bom/LegDate.hpp> -#include <stdair/bom/BomChildrenHolderImp.hpp> - -namespace stdair { - - // Forward declaration - template <typename BOM_CONTENT> class Inventory; - class BomContentDummy; - - /** Wrapper class aimed at holding the actual content, modeled - by an external specific FlightDate class (for instance, - in the AIRSCHED library). */ - template <class BOM_CONTENT> - class FlightDate : public BomStructure { - friend class FacBomStructure; - friend class FacBomContent; - friend class BomStructure; - - public: - // Type definitions - /** Definition allowing to retrieve the associated BOM content type. */ - typedef BOM_CONTENT Content_T; - - /** Definition allowing to retrieve the associated BOM key type. */ - typedef FlightDateKey<BOM_CONTENT> BomKey_T; - - /** Definition allowing to retrieve the associated parent - BOM structure type. */ - typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; - - /** Definition allowing to retrieve the children type of the - BOM_CONTENT. */ - typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; - - /** Definition allowing to retrieve the second children type of the - BOM_CONTENT. */ - typedef typename BOM_CONTENT::SecondContentChild_T SecondContentChild_T; - - /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector<SegmentDate<ContentChild_T>, - LegDate<SecondContentChild_T> > ChildrenBomTypeList_T; - - /** Definition allowing to retrive the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; - - /** Definition allowing to retrive the children bom holder type. */ - typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; - - /** Definition allowing to retrive the second children bom holder type. */ - typedef BomChildrenHolderImp<SecondContentChild_T> SecondChildrenBomHolder_T; - - /** Define the iterators of the segment-date list. */ - typedef typename ChildrenBomHolder_T::ListIterator_T SegmentDateListIterator_T; - typedef typename ChildrenBomHolder_T::ListReverseIterator_T SegmentDateListReverseIterator_T; - - /** Define the iterators of the segment-date map. */ - typedef typename ChildrenBomHolder_T::MapIterator_T SegmentDateMapIterator_T; - typedef typename ChildrenBomHolder_T::MapReverseIterator_T SegmentDateMapReverseIterator_T; - - /** Define the iterators of the leg-date list. */ - typedef typename SecondChildrenBomHolder_T::ListIterator_T LegDateListIterator_T; - typedef typename SecondChildrenBomHolder_T::ListReverseIterator_T LegDateListReverseIterator_T; - - /** Define the iterators of the leg-date map. */ - typedef typename SecondChildrenBomHolder_T::MapIterator_T LegDateMapIterator_T; - typedef typename SecondChildrenBomHolder_T::MapReverseIterator_T LegDateMapReverseIterator_T; - - - public: - // /////////// Getters ///////////// - /** Get the (parent) Inventory object. */ - ParentBomStructure_T* getInventoryPtr() const { - return _parent; - } - - /** Get the (parent) Inventory object. */ - ParentBomStructure_T& getInventory() const { - assert (_parent != NULL); - return *_parent; - } - - /** Get the flight-date key. */ - const BomKey_T& getKey() const { - return _key; - } - - /** Get the list of segment-dates. */ - const ChildrenBomHolder_T& getChildrenList() const { - return *_childrenList; - } - - /** Get the list of leg-dates. */ - const SecondChildrenBomHolder_T& getSecondChildrenList() const { - return *_secondChildrenList; - } - - /** Get the list of segment-dates. */ - void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _childrenList; - } - - /** Get the list of leg-dates. */ - void getChildrenList (SecondChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _secondChildrenList; - } - - private: - // /////////// Setters ///////////// - /** Set the (parent) FlightDate object. */ - void setBomStructureRoot (ParentBomStructure_T& ioParent) { - _parent = &ioParent; - } - - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } - - /** Set the segment-date children list. */ - void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { - _childrenList = &ioChildrenList; - } - - /** Set the leg-date children list. */ - void setChildrenList (SecondChildrenBomHolder_T& ioChildrenList) { - _secondChildrenList = &ioChildrenList; - } - - 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() << std::endl; - } - - /** Dump a Business Object with all its children into an output stream. - @param ostream& the output stream. */ - void describeFull (std::ostringstream& ioOut) const { - ioOut << describeShortKey () << std::endl; - displaySegmentDateList (ioOut); - displayLegDateList (ioOut); - } - - /** 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 { return describeKey(); } - - /** Get a string describing the whole key (differentiating two objects - at any level). */ - const std::string describeKey() const { return _key.toString(); } - - /** Get a string describing the short key (differentiating two objects - at the same level). */ - const std::string describeShortKey() const { return _key.toString(); } - - /** Dump the segment-date children list in to an output stream. - @param ostream& the output stream. */ - void displaySegmentDateList (std::ostringstream& ioOut) const { - ioOut << "SegmentDates: " << std::endl; - assert (_childrenList != NULL); - _childrenList->describeFull (ioOut); - } - - /** Dump the leg-date children list in to an output stream. - @param ostream& the output stream. */ - void displayLegDateList (std::ostringstream& ioOut) const { - ioOut << "LegDates: " << std::endl; - assert (_secondChildrenList != NULL); - _secondChildrenList->describeFull (ioOut); - } - - public: - // /////////// Iteration methods ////////// - /** Initialise the internal iterator on segment date: - return the iterator at the begining of the list. */ - SegmentDateListIterator_T segmentDateListBegin () const { - assert (_childrenList != NULL); - return _childrenList->listBegin (); - } - - /** Initialise the internal iterator on segment date: - return the iterator at the end of the list. */ - SegmentDateListIterator_T segmentDateListEnd () const { - assert (_childrenList != NULL); - return _childrenList->listEnd (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rbegining of the list. */ - SegmentDateListReverseIterator_T segmentDateListRBegin () const { - assert (_childrenList != NULL); - return _childrenList->listRBegin (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rend of the list. */ - SegmentDateListReverseIterator_T segmentDateListREnd () const { - assert (_childrenList != NULL); - return _childrenList->listREnd (); - } - - /** Initialise the internal iterator on segment date: - return the iterator at the begining of the map. */ - SegmentDateMapIterator_T segmentDateMapBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapBegin (); - } - - /** Initialise the internal iterator on segment date: - return the iterator at the end of the map. */ - SegmentDateMapIterator_T segmentDateMapEnd () const { - assert (_childrenList != NULL); - return _childrenList->mapEnd (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rbegining of the map. */ - SegmentDateMapReverseIterator_T segmentDateMapRBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapRBegin (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rend of the map. */ - SegmentDateMapReverseIterator_T segmentDateMapREnd () const { - assert (_childrenList != NULL); - return _childrenList->mapREnd (); - } - - - /** Initialise the internal iterator on leg date: - return the iterator at the begining of the list. */ - LegDateListIterator_T legDateListBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listBegin (); - } - - /** Initialise the internal iterator on leg date: - return the iterator at the end of the list. */ - LegDateListIterator_T legDateListEnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listEnd (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rbegining of the list. */ - LegDateListReverseIterator_T legDateListRBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listRBegin (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rend of the list. */ - LegDateListReverseIterator_T legDateListREnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listREnd (); - } - - /** Initialise the internal iterator on leg date: - return the iterator at the begining of the map. */ - LegDateMapIterator_T legDateMapBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapBegin (); - } - - /** Initialise the internal iterator on leg date: - return the iterator at the end of the map. */ - LegDateMapIterator_T legDateMapEnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapEnd (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rbegining of the map. */ - LegDateMapReverseIterator_T legDateMapRBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapRBegin (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rend of the map. */ - LegDateMapReverseIterator_T legDateMapREnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapREnd (); - } - - - private: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Default constructors. */ - FlightDate (); - FlightDate (const FlightDate&); - FlightDate (const BomKey_T& iKey) - : _parent (NULL), _key (iKey), _childrenList (NULL), - _secondChildrenList (NULL) { } - - /** Destructor. */ - virtual ~FlightDate() { } - - private: - // Attributes - /** Parent root. */ - ParentBomStructure_T* _parent; - - /** The actual functional (Business Object) content. */ - BOM_CONTENT* _content; - - /** The key of both the structure and content objects. */ - BomKey_T _key; - - /** List of segment-dates. */ - ChildrenBomHolder_T* _childrenList; - - /** List of leg-dates. */ - SecondChildrenBomHolder_T* _secondChildrenList; - - }; - -} -#endif // __STDAIR_BOM_FLIGHTDATE_HPP - Copied: trunk/stdair/stdair/bom/FlightDateStructure.hpp (from rev 37, trunk/stdair/stdair/bom/FlightDate.hpp) =================================================================== --- trunk/stdair/stdair/bom/FlightDateStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -0,0 +1,336 @@ +#ifndef __STDAIR_BOM_FLIGHTDATESTRUCTURE_HPP +#define __STDAIR_BOM_FLIGHTDATESTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/FlightDateKey.hpp> +#include <stdair/bom/SegmentDateStructure.hpp> +#include <stdair/bom/LegDateStructure.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> + +namespace stdair { + + // Forward declaration + template <typename BOM_CONTENT> class Inventory; + class BomContentDummy; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific FlightDate class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class FlightDateStructure : public BomStructure { + friend class FacBomStructure; + friend class FacBomContent; + friend class BomStructure; + + public: + // Type definitions + /** Definition allowing to retrieve the associated BOM content type. */ + typedef BOM_CONTENT Content_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef FlightDateKey<BOM_CONTENT> BomKey_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; + + /** Definition allowing to retrieve the children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; + + /** Definition allowing to retrieve the second children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::SecondContentChild_T SecondContentChild_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector<SegmentDateStructure<ContentChild_T>, + LegDateStructure<SecondContentChild_T> > ChildrenBomTypeList_T; + + /** Definition allowing to retrive the default children bom holder type. */ + typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + + /** Definition allowing to retrive the children bom holder type. */ + typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + + /** Definition allowing to retrive the second children bom holder type. */ + typedef BomChildrenHolderImp<SecondContentChild_T> SecondChildrenBomHolder_T; + + /** Define the iterators of the segment-date list. */ + typedef typename ChildrenBomHolder_T::ListIterator_T SegmentDateListIterator_T; + typedef typename ChildrenBomHolder_T::ListReverseIterator_T SegmentDateListReverseIterator_T; + + /** Define the iterators of the segment-date map. */ + typedef typename ChildrenBomHolder_T::MapIterator_T SegmentDateMapIterator_T; + typedef typename ChildrenBomHolder_T::MapReverseIterator_T SegmentDateMapReverseIterator_T; + + /** Define the iterators of the leg-date list. */ + typedef typename SecondChildrenBomHolder_T::ListIterator_T LegDateListIterator_T; + typedef typename SecondChildrenBomHolder_T::ListReverseIterator_T LegDateListReverseIterator_T; + + /** Define the iterators of the leg-date map. */ + typedef typename SecondChildrenBomHolder_T::MapIterator_T LegDateMapIterator_T; + typedef typename SecondChildrenBomHolder_T::MapReverseIterator_T LegDateMapReverseIterator_T; + + + public: + // /////////// Getters ///////////// + /** Get the (parent) InventoryStructure object. */ + ParentBomStructure_T* getInventoryStructurePtr() const { + return _parent; + } + + /** Get the (parent) InventoryStructure object. */ + ParentBomStructure_T& getInventoryStructure() const { + assert (_parent != NULL); + return *_parent; + } + + /** Get the flight-date key. */ + const BomKey_T& getKey() const { + return _key; + } + + /** Get the list of segment-dates. */ + const ChildrenBomHolder_T& getChildrenList() const { + return *_childrenList; + } + + /** Get the list of leg-dates. */ + const SecondChildrenBomHolder_T& getSecondChildrenList() const { + return *_secondChildrenList; + } + + /** Get the list of segment-dates. */ + void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { + ioChildrenList = _childrenList; + } + + /** Get the list of leg-dates. */ + void getChildrenList (SecondChildrenBomHolder_T*& ioChildrenList) { + ioChildrenList = _secondChildrenList; + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) FlightDate object. */ + void setInventoryStructure (ParentBomStructure_T& ioParent) { + _parent = &ioParent; + } + + /** Default children list setter. */ + void setChildrenList (DefaultChildrenBomHolder_T&) { } + + /** Set the segment-date children list. */ + void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { + _childrenList = &ioChildrenList; + } + + /** Set the leg-date children list. */ + void setChildrenList (SecondChildrenBomHolder_T& ioChildrenList) { + _secondChildrenList = &ioChildrenList; + } + + 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() << std::endl; + } + + /** Dump a Business Object with all its children into an output stream. + @param ostream& the output stream. */ + void describeFull (std::ostringstream& ioOut) const { + ioOut << describeShortKey () << std::endl; + displaySegmentDateList (ioOut); + displayLegDateList (ioOut); + } + + /** 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 { return describeKey(); } + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const { return _key.toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return _key.toString(); } + + /** Dump the segment-date children list in to an output stream. + @param ostream& the output stream. */ + void displaySegmentDateList (std::ostringstream& ioOut) const { + ioOut << "SegmentDates: " << std::endl; + assert (_childrenList != NULL); + _childrenList->describeFull (ioOut); + } + + /** Dump the leg-date children list in to an output stream. + @param ostream& the output stream. */ + void displayLegDateList (std::ostringstream& ioOut) const { + ioOut << "LegDates: " << std::endl; + assert (_secondChildrenList != NULL); + _secondChildrenList->describeFull (ioOut); + } + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on segment date: + return the iterator at the begining of the list. */ + SegmentDateListIterator_T segmentDateListBegin () const { + assert (_childrenList != NULL); + return _childrenList->listBegin (); + } + + /** Initialise the internal iterator on segment date: + return the iterator at the end of the list. */ + SegmentDateListIterator_T segmentDateListEnd () const { + assert (_childrenList != NULL); + return _childrenList->listEnd (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rbegining of the list. */ + SegmentDateListReverseIterator_T segmentDateListRBegin () const { + assert (_childrenList != NULL); + return _childrenList->listRBegin (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rend of the list. */ + SegmentDateListReverseIterator_T segmentDateListREnd () const { + assert (_childrenList != NULL); + return _childrenList->listREnd (); + } + + /** Initialise the internal iterator on segment date: + return the iterator at the begining of the map. */ + SegmentDateMapIterator_T segmentDateMapBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapBegin (); + } + + /** Initialise the internal iterator on segment date: + return the iterator at the end of the map. */ + SegmentDateMapIterator_T segmentDateMapEnd () const { + assert (_childrenList != NULL); + return _childrenList->mapEnd (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rbegining of the map. */ + SegmentDateMapReverseIterator_T segmentDateMapRBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapRBegin (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rend of the map. */ + SegmentDateMapReverseIterator_T segmentDateMapREnd () const { + assert (_childrenList != NULL); + return _childrenList->mapREnd (); + } + + + /** Initialise the internal iterator on leg date: + return the iterator at the begining of the list. */ + LegDateListIterator_T legDateListBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listBegin (); + } + + /** Initialise the internal iterator on leg date: + return the iterator at the end of the list. */ + LegDateListIterator_T legDateListEnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listEnd (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rbegining of the list. */ + LegDateListReverseIterator_T legDateListRBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listRBegin (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rend of the list. */ + LegDateListReverseIterator_T legDateListREnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listREnd (); + } + + /** Initialise the internal iterator on leg date: + return the iterator at the begining of the map. */ + LegDateMapIterator_T legDateMapBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapBegin (); + } + + /** Initialise the internal iterator on leg date: + return the iterator at the end of the map. */ + LegDateMapIterator_T legDateMapEnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapEnd (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rbegining of the map. */ + LegDateMapReverseIterator_T legDateMapRBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapRBegin (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rend of the map. */ + LegDateMapReverseIterator_T legDateMapREnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapREnd (); + } + + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + FlightDateStructure (); + FlightDateStructure (const FlightDateStructure&); + FlightDateStructure (const BomKey_T& iKey) + : _parent (NULL), _key (iKey), _childrenList (NULL), + _secondChildrenList (NULL) { } + + /** Destructor. */ + virtual ~FlightDateStructure() { } + + private: + // Attributes + /** Parent root. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** The key of both the structure and content objects. */ + BomKey_T _key; + + /** List of segment-dates. */ + ChildrenBomHolder_T* _childrenList; + + /** List of leg-dates. */ + SecondChildrenBomHolder_T* _secondChildrenList; + + }; + +} +#endif // __STDAIR_BOM_FLIGHTDATESTRUCTURE_HPP + Deleted: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2009-10-08 15:22:51 UTC (rev 37) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -1,237 +0,0 @@ -#ifndef __STDAIR_BOM_INVENTORY_HPP -#define __STDAIR_BOM_INVENTORY_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <cassert> -// (Boost) MPL -#include <boost/mpl/vector.hpp> -// STDAIR -#include <stdair/bom/BomStructure.hpp> -#include <stdair/bom/InventoryKey.hpp> -#include <stdair/bom/BomChildrenHolderImp.hpp> -#include <stdair/bom/BomIterator.hpp> -#include <stdair/bom/FlightDate.hpp> - -namespace stdair { - - // Forward declaration - template <typename BOM_CONTENT> class BomStructureRoot; - class BomStructureDummy; - class BomContentDummy; - - /** Wrapper class aimed at holding the actual content, modeled - by an external specific Inventory class (for instance, - in the AIRSCHED library). */ - template <class BOM_CONTENT> - class Inventory : public BomStructure { - friend class FacBomStructure; - friend class FacBomContent; - friend class BomStructure; - - public: - // Type definitions - /** Definition allowing to retrieve the associated BOM content type. */ - typedef BOM_CONTENT Content_T; - - /** Definition allowing to retrieve the associated BOM key type. */ - typedef InventoryKey<BOM_CONTENT> BomKey_T; - - /** Definition allowing to retrieve the children type of the - BOM_CONTENT. */ - typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; - - /** Definition allowing to retrieve the associated parent - BOM structure type. */ - typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; - - /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector<FlightDate<ContentChild_T>, - BomStructureDummy> ChildrenBomTypeList_T; - - /** Define the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; - - /** Define the children bom holder type. */ - typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; - - /** Define the iterators of the flight-date list. */ - typedef typename ChildrenBomHolder_T::ListIterator_T FlightDateListIterator_T; - typedef typename ChildrenBomHolder_T::ListReverseIterator_T FlightDateListReverseIterator_T; - - /** Define the iterators of the flight-date map. */ - typedef typename ChildrenBomHolder_T::MapIterator_T FlightDateMapIterator_T; - typedef typename ChildrenBomHolder_T::MapReverseIterator_T FlightDateMapReverseIterator_T; - - public: - // /////////// Getters ///////////// - /** Get the (parent) BomStructureRoot object. */ - ParentBomStructure_T* getBomStructureRootPtr() const { - return _parent; - } - - /** Get the (parent) BomStructureRoot object. */ - ParentBomStructure_T& getBomStructureRoot() const { - assert (_parent != NULL); - return *_parent; - } - - /** Get the flight-date key. */ - const BomKey_T& getKey() const { - return _key; - } - - /** Get the list of flight-dates. */ - const ChildrenBomHolder_T& getChildrenList() const { - assert (_childrenList != NULL); - return *_childrenList; - } - - /** Get the list of flight-dates. */ - void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _childrenList; - } - - private: - // /////////// Setters ///////////// - /** Set the (parent) Inventory object. */ - void setBomStructureRoot (ParentBomStructure_T& ioParent) { - _parent = &ioParent; - } - - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } - - /** Set the children list. */ - void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { - _childrenList = &ioChildrenList; - } - - 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() << std::endl; - } - - /** Dump a Business Object with all its children into an output stream. - @param ostream& the output stream. */ - void describeFull (std::ostringstream& ioOut) const { - ioOut << describeShortKey () << std::endl; - displayFlightDateList (ioOut); - } - - /** 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 { return describeKey(); } - - /** Get a string describing the whole key (differentiating two objects - at any level). */ - const std::string describeKey() const { return _key.toString(); } - - /** Get a string describing the short key (differentiating two objects - at the same level). */ - const std::string describeShortKey() const { return _key.toString(); } - - /** Dump the flight-date children list in to an output stream. - @param ostream& the output stream. */ - void displayFlightDateList (std::ostringstream& ioOut) const { - ioOut << "FlightDates: " << std::endl; - assert (_childrenList != NULL); - _childrenList->describeFull (ioOut); - } - - public: - // /////////// Iteration methods ////////// - /** Initialise the internal iterator on flight date: - return the iterator at the begining of the list. */ - FlightDateListIterator_T flightDateListBegin () const { - assert (_childrenList != NULL); - return _childrenList->listBegin (); - } - - /** Initialise the internal iterator on flight date: - return the iterator at the end of the list. */ - FlightDateListIterator_T flightDateListEnd () const { - assert (_childrenList != NULL); - return _childrenList->listEnd (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rbegining of the list. */ - FlightDateListReverseIterator_T flightDateListRBegin () const { - assert (_childrenList != NULL); - return _childrenList->listRBegin (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rend of the list. */ - FlightDateListReverseIterator_T flightDateListREnd () const { - assert (_childrenList != NULL); - return _childrenList->listREnd (); - } - - /** Initialise the internal iterator on flight date: - return the iterator at the begining of the map. */ - FlightDateMapIterator_T flightDateMapBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapBegin (); - } - - /** Initialise the internal iterator on flight date: - return the iterator at the end of the map. */ - FlightDateMapIterator_T flightDateMapEnd () const { - assert (_childrenList != NULL); - return _childrenList->mapEnd (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rbegining of the map. */ - FlightDateMapReverseIterator_T flightDateMapRBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapRBegin (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rend of the map. */ - FlightDateMapReverseIterator_T flightDateMapREnd () const { - assert (_childrenList != NULL); - return _childrenList->mapREnd (); - } - - private: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Default constructors. */ - Inventory (); - Inventory (const Inventory&); - Inventory (const BomKey_T& iKey) - : _parent (NULL), _key (iKey), _childrenList (NULL) { } - - /** Destructor. */ - virtual ~Inventory() { } - - private: - // Attributes - /** Parent root. */ - ParentBomStructure_T* _parent; - - /** The actual functional (Business Object) content. */ - BOM_CONTENT* _content; - - /** The key of both the structure and content objects. */ - BomKey_T _key; - - /** List of flight-dates. */ - ChildrenBomHolder_T* _childrenList; - }; - -} -#endif // __STDAIR_BOM_INVENTORY_HPP - Copied: trunk/stdair/stdair/bom/InventoryStructure.hpp (from rev 37, trunk/stdair/stdair/bom/Inventory.hpp) =================================================================== --- trunk/stdair/stdair/bom/InventoryStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -0,0 +1,237 @@ +#ifndef __STDAIR_BOM_INVENTORYSTRUCTURE_HPP +#define __STDAIR_BOM_INVENTORYSTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// (Boost) MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/InventoryKey.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> +#include <stdair/bom/BomIterator.hpp> +#include <stdair/bom/FlightDateStructure.hpp> + +namespace stdair { + + // Forward declaration + template <typename BOM_CONTENT> class BomStructureRoot; + class BomStructureDummy; + class BomContentDummy; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific Inventory class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class InventoryStructure : public BomStructure { + friend class FacBomStructure; + friend class FacBomContent; + friend class BomStructure; + + public: + // Type definitions + /** Definition allowing to retrieve the associated BOM content type. */ + typedef BOM_CONTENT Content_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef InventoryKey<BOM_CONTENT> BomKey_T; + + /** Definition allowing to retrieve the children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector<FlightDate<ContentChild_T>, + BomStructureDummy> ChildrenBomTypeList_T; + + /** Define the default children bom holder type. */ + typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + + /** Define the children bom holder type. */ + typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + + /** Define the iterators of the flight-date list. */ + typedef typename ChildrenBomHolder_T::ListIterator_T FlightDateListIterator_T; + typedef typename ChildrenBomHolder_T::ListReverseIterator_T FlightDateListReverseIterator_T; + + /** Define the iterators of the flight-date map. */ + typedef typename ChildrenBomHolder_T::MapIterator_T FlightDateMapIterator_T; + typedef typename ChildrenBomHolder_T::MapReverseIterator_T FlightDateMapReverseIterator_T; + + public: + // /////////// Getters ///////////// + /** Get the (parent) BomStructureRoot object. */ + ParentBomStructure_T* getBomStructureRootPtr() const { + return _parent; + } + + /** Get the (parent) BomStructureRoot object. */ + ParentBomStructure_T& getBomStructureRoot() const { + assert (_parent != NULL); + return *_parent; + } + + /** Get the flight-date key. */ + const BomKey_T& getKey() const { + return _key; + } + + /** Get the list of flight-dates. */ + const ChildrenBomHolder_T& getChildrenList() const { + assert (_childrenList != NULL); + return *_childrenList; + } + + /** Get the list of flight-dates. */ + void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { + ioChildrenList = _childrenList; + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) Inventory object. */ + void setBomStructureRoot (ParentBomStructure_T& ioParent) { + _parent = &ioParent; + } + + /** Default children list setter. */ + void setChildrenList (DefaultChildrenBomHolder_T&) { } + + /** Set the children list. */ + void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { + _childrenList = &ioChildrenList; + } + + 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() << std::endl; + } + + /** Dump a Business Object with all its children into an output stream. + @param ostream& the output stream. */ + void describeFull (std::ostringstream& ioOut) const { + ioOut << describeShortKey () << std::endl; + displayFlightDateList (ioOut); + } + + /** 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 { return describeKey(); } + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const { return _key.toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return _key.toString(); } + + /** Dump the flight-date children list in to an output stream. + @param ostream& the output stream. */ + void displayFlightDateList (std::ostringstream& ioOut) const { + ioOut << "FlightDates: " << std::endl; + assert (_childrenList != NULL); + _childrenList->describeFull (ioOut); + } + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the list. */ + FlightDateListIterator_T flightDateListBegin () const { + assert (_childrenList != NULL); + return _childrenList->listBegin (); + } + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the list. */ + FlightDateListIterator_T flightDateListEnd () const { + assert (_childrenList != NULL); + return _childrenList->listEnd (); + } + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the list. */ + FlightDateListReverseIterator_T flightDateListRBegin () const { + assert (_childrenList != NULL); + return _childrenList->listRBegin (); + } + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rend of the list. */ + FlightDateListReverseIterator_T flightDateListREnd () const { + assert (_childrenList != NULL); + return _childrenList->listREnd (); + } + + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the map. */ + FlightDateMapIterator_T flightDateMapBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapBegin (); + } + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the map. */ + FlightDateMapIterator_T flightDateMapEnd () const { + assert (_childrenList != NULL); + return _childrenList->mapEnd (); + } + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the map. */ + FlightDateMapReverseIterator_T flightDateMapRBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapRBegin (); + } + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rend of the map. */ + FlightDateMapReverseIterator_T flightDateMapREnd () const { + assert (_childrenList != NULL); + return _childrenList->mapREnd (); + } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + InventoryStructure (); + InventoryStructure (const InventoryStructure&); + InventoryStructure (const BomKey_T& iKey) + : _parent (NULL), _key (iKey), _childrenList (NULL) { } + + /** Destructor. */ + virtual ~InventoryStructure() { } + + private: + // Attributes + /** Parent root. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** The key of both the structure and content objects. */ + BomKey_T _key; + + /** List of flight-dates. */ + ChildrenBomHolder_T* _childrenList; + }; + +} +#endif // __STDAIR_BOM_INVENTORYSTRUCTURE_HPP + Deleted: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp 2009-10-08 15:22:51 UTC (rev 37) +++ trunk/stdair/stdair/bom/LegDate.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -1,127 +0,0 @@ -#ifndef __STDAIR_BOM_LEGDATE_HPP -#define __STDAIR_BOM_LEGDATE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// MPL -#include <boost/mpl/vector.hpp> -// STDAIR -#include <stdair/bom/BomStructure.hpp> -#include <stdair/bom/LegDateKey.hpp> -#include <stdair/bom/BomChildrenHolderImp.hpp> - -namespace stdair { - - // Forward declarations - template <typename BOM_CONTENT> class FlightDate; - class BomStructureDummy; - class BomContentDummy; - - /** Wrapper class aimed at holding the actual content, modeled - by an external specific LegDate class (for instance, - in the AIRSCHED library). */ - template <class BOM_CONTENT> - class LegDate : public BomStructure { - friend class FacBomStructure; - friend class FacBomContent; - friend class BomStructure; - - public: - // Type definitions - /** Definition allowing to retrieve the associated BOM content type. */ - typedef BOM_CONTENT Content_T; - - /** Definition allowing to retrieve the associated BOM key type. */ - typedef LegDateKey<BOM_CONTENT> BomKey_T; - - /** Definition allowing to retrieve the associated parent - BOM structure type. */ - typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; - - /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector <BomStructureDummy, BomStructureDummy> ChildrenBomTypeList_T; - - /** Definition allowing to retrieve the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; - - public: - // /////////// Getters ///////////// - /** Get the (parent) FlightDate object. */ - ParentBomStructure_T* getFlightDatePtr() const { - return _parent; - } - - /** Get the (parent) FlightDate object. */ - ParentBomStructure_T& getFlightDate() const; - - /** Get the leg-date key. */ - const BomKey_T& getKey() const { - return _key; - } - - private: - // /////////// Setters ///////////// - /** Set the (parent) FlightDate object. */ - void setFlightDate (ParentBomStructure_T& ioFlightDate) { - _parent = &ioFlightDate; - } - - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } - - - 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() << std::endl; - } - - /** Dump a Business Object with all its children into an output stream. - @param ostream& the output stream. */ - void describeFull (std::ostringstream& ioOut) const { - ioOut << describeShortKey () << std::endl; - } - - /** 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 { return describeKey(); } - - /** Get a string describing the whole key (differentiating two objects - at any level). */ - const std::string describeKey() const { return _key.toString(); } - - /** Get a string describing the short key (differentiating two objects - at the same level). */ - const std::string describeShortKey() const { return _key.toString(); } - - private: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Default constructors. */ - LegDate (); - LegDate (const LegDate&); - LegDate (const BomKey_T& iKey) : _parent (NULL), _key (iKey) { } - - /** Destructor. */ - virtual ~LegDate() { } - - private: - // Attributes - /** Parent flight-date. */ - ParentBomStructure_T* _parent; - - /** The actual functional (Business Object) content. */ - BOM_CONTENT* _content; - - /** The key of both the structure and content objects. */ - BomKey_T _key; - }; - -} -#endif // __STDAIR_BOM_LEGDATE_HPP Copied: trunk/stdair/stdair/bom/LegDateStructure.hpp (from rev 37, trunk/stdair/stdair/bom/LegDate.hpp) =================================================================== --- trunk/stdair/stdair/bom/LegDateStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -0,0 +1,127 @@ +#ifndef __STDAIR_BOM_LEGDATESTRUCTURE_HPP +#define __STDAIR_BOM_LEGDATESTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/LegDateKey.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT> class FlightDateStructure; + class BomStructureDummy; + class BomContentDummy; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific LegDate class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class LegDateStructure : public BomStructure { + friend class FacBomStructure; + friend class FacBomContent; + friend class BomStructure; + + public: + // Type definitions + /** Definition allowing to retrieve the associated BOM content type. */ + typedef BOM_CONTENT Content_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef LegDateKey<BOM_CONTENT> BomKey_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector <BomStructureDummy, BomStructureDummy> ChildrenBomTypeList_T; + + /** Definition allowing to retrieve the default children bom holder type. */ + typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + + public: + // /////////// Getters ///////////// + /** Get the (parent) FlightDateStructure object. */ + ParentBomStructure_T* getFlightDateStructurePtr() const { + return _parent; + } + + /** Get the (parent) FlightDateStructure object. */ + ParentBomStructure_T& getFlightDateStructure() const; + + /** Get the leg-date key. */ + const BomKey_T& getKey() const { + return _key; + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) FlightDateStructure object. */ + void setFlightDateStructure (ParentBomStructure_T& ioFlightDateStructure) { + _parent = &ioFlightDateStructure; + } + + /** Default children list setter. */ + void setChildrenList (DefaultChildrenBomHolder_T&) { } + + + 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() << std::endl; + } + + /** Dump a Business Object with all its children into an output stream. + @param ostream& the output stream. */ + void describeFull (std::ostringstream& ioOut) const { + ioOut << describeShortKey () << std::endl; + } + + /** 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 { return describeKey(); } + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const { return _key.toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return _key.toString(); } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + LegDateStructure (); + LegDateStructure (const LegDateStructure&); + LegDateStructure (const BomKey_T& iKey) : _parent (NULL), _key (iKey) { } + + /** Destructor. */ + virtual ~LegDateStructure() { } + + private: + // Attributes + /** Parent flight-date. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** The key of both the structure and content objects. */ + BomKey_T _key; + }; + +} +#endif // __STDAIR_BOM_LEGDATESTRUCTURE_HPP Deleted: trunk/stdair/stdair/bom/SegmentDate.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-08 15:22:51 UTC (rev 37) +++ trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -1,127 +0,0 @@ -#ifndef __STDAIR_BOM_SEGMENTDATE_HPP -#define __STDAIR_BOM_SEGMENTDATE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// MPL -#include <boost/mpl/vector.hpp> -// STDAIR -#include <stdair/bom/BomStructure.hpp> -#include <stdair/bom/SegmentDateKey.hpp> -#include <stdair/bom/BomChildrenHolderImp.hpp> - -namespace stdair { - - // Forward declarations - template <typename BOM_CONTENT> class FlightDate; - class BomStructureDummy; - class BomContentDummy; - - /** Wrapper class aimed at holding the actual content, modeled - by an external specific SegmentDate class (for instance, - in the AIRSCHED library). */ - template <class BOM_CONTENT> - class SegmentDate : public BomStructure { - friend class FacBomStructure; - friend class FacBomContent; - friend class BomStructure; - - public: - // Type definitions - /** Definition allowing to retrieve the associated BOM content type. */ - typedef BOM_CONTENT Content_T; - - /** Definition allowing to retrieve the associated BOM key type. */ - typedef SegmentDateKey<BOM_CONTENT> BomKey_T; - - /** Definition allowing to retrieve the associated parent - BOM structure type. */ - typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; - - /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector <BomStructureDummy, BomStructureDummy> ChildrenBomTypeList_T; - - /** Definition allowing to retrieve the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; - - public: - // /////////// Getters ///////////// - /** Get the (parent) FlightDate object. */ - ParentBomStructure_T* getFlightDatePtr() const { - return _parent; - } - - /** Get the (parent) FlightDate object. */ - ParentBomStructure_T& getFlightDate() const; - - /** Get the segment-date key. */ - const BomKey_T& getKey() const { - return _key; - } - - private: - // /////////// Setters ///////////// - /** Set the (parent) FlightDate object. */ - void setFlightDate (ParentBomStructure_T& ioFlightDate) { - _parent = &ioFlightDate; - } - - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } - - - 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() << std::endl; - } - - /** Dump a Business Object with all its children into an output stream. - @param ostream& the output stream. */ - void describeFull (std::ostringstream& ioOut) const { - ioOut << describeShortKey () << std::endl; - } - - /** 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 { return describeKey(); } - - /** Get a string describing the whole key (differentiating two objects - at any level). */ - const std::string describeKey() const { return _key.toString(); } - - /** Get a string describing the short key (differentiating two objects - at the same level). */ - const std::string describeShortKey() const { return _key.toString(); } - - private: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Default constructors. */ - SegmentDate (); - SegmentDate (const SegmentDate&); - SegmentDate (const BomKey_T& iKey) : _parent (NULL), _key (iKey) { } - - /** Destructor. */ - virtual ~SegmentDate() { } - - private: - // Attributes - /** Parent flight-date. */ - ParentBomStructure_T* _parent; - - /** The actual functional (Business Object) content. */ - BOM_CONTENT* _content; - - /** The key of both the structure and content objects. */ - BomKey_T _key; - }; - -} -#endif // __STDAIR_BOM_SEGMENTDATE_HPP Copied: trunk/stdair/stdair/bom/SegmentDateStructure.hpp (from rev 37, trunk/stdair/stdair/bom/SegmentDate.hpp) =================================================================== --- trunk/stdair/stdair/bom/SegmentDateStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/SegmentDateStructure.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -0,0 +1,127 @@ +#ifndef __STDAIR_BOM_SEGMENTDATESTRUCTURE_HPP +#define __STDAIR_BOM_SEGMENTDATESTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/SegmentDateKey.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT> class FlightDateStructure; + class BomStructureDummy; + class BomContentDummy; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific SegmentDate class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class SegmentDateStructure : public BomStructure { + friend class FacBomStructure; + friend class FacBomContent; + friend class BomStructure; + + public: + // Type definitions + /** Definition allowing to retrieve the associated BOM content type. */ + typedef BOM_CONTENT Content_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef SegmentDateKey<BOM_CONTENT> BomKey_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector <BomStructureDummy, BomStructureDummy> ChildrenBomTypeList_T; + + /** Definition allowing to retrieve the default children bom holder type. */ + typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + + public: + // /////////// Getters ///////////// + /** Get the (parent) FlightDateStructure object. */ + ParentBomStructure_T* getFlightDateStructurePtr() const { + return _parent; + } + + /** Get the (parent) FlightDateStructure object. */ + ParentBomStructure_T& getFlightDateStructure() const; + + /** Get the segment-date key. */ + const BomKey_T& getKey() const { + return _key; +... [truncated message content] |
From: <qua...@us...> - 2009-10-08 15:22:59
|
Revision: 37 http://stdair.svn.sourceforge.net/stdair/?rev=37&view=rev Author: quannaus Date: 2009-10-08 15:22:51 +0000 (Thu, 08 Oct 2009) Log Message: ----------- [Dev] Removed an emply line. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2009-10-06 15:40:12 UTC (rev 36) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2009-10-08 15:22:51 UTC (rev 37) @@ -33,7 +33,6 @@ class DocumentNotFoundException : public RootException { }; - // /////////////// Log ///////////// /** Level of logs. */ namespace LOG { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-06 15:40:19
|
Revision: 36 http://stdair.svn.sourceforge.net/stdair/?rev=36&view=rev Author: quannaus Date: 2009-10-06 15:40:12 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomIterator.hpp Modified: trunk/stdair/stdair/bom/BomIterator.hpp =================================================================== --- trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-06 15:38:25 UTC (rev 35) +++ trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-06 15:40:12 UTC (rev 36) @@ -161,8 +161,6 @@ inline BomIterator_T<BOM_CONTENT, ITERATOR> operator+(const typename ITERATOR::difference_type n, const BomIterator_T<BOM_CONTENT, ITERATOR>& r) { - // Definition allowing to retrieve the Parent_T of BomIterator_T. - typedef typename BomIterator_T<BOM_CONTENT,ITERATOR>::Parent_T Parent_T; return BomIterator_T<BOM_CONTENT, ITERATOR> (n+r.base()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-06 15:38:31
|
Revision: 35 http://stdair.svn.sourceforge.net/stdair/?rev=35&view=rev Author: quannaus Date: 2009-10-06 15:38:25 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomIterator.hpp Modified: trunk/stdair/stdair/bom/BomIterator.hpp =================================================================== --- trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-06 15:25:09 UTC (rev 34) +++ trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-06 15:38:25 UTC (rev 35) @@ -28,12 +28,15 @@ // Define the pair of string and pointer of BOM_CONTENT. typedef typename std::pair<std::string, BOM_CONTENT*> value_type; + // Definition allowing the retrieve the ITERATOR type. + typedef ITERATOR iterator_type; + // Definition allowing the retrieve the difference type of the ITERATOR. typedef typename ITERATOR::difference_type difference_type; public: /** Normal constructor. */ - BomIterator_T (ITERATOR iIterator) + BomIterator_T (iterator_type iIterator) : _itBomStructureObject (iIterator) { } /** Default constructor. */ @@ -47,6 +50,10 @@ ~BomIterator_T() { } public: + /** Return _itBomStructureObject, used for underlying work. */ + iterator_type base() const { return _itBomStructureObject; } + + public: // ///////////// Operators ////////////// /** Incrementing (prefix and postfix) operators. */ void operator++ () { ++_itBomStructureObject; } @@ -126,7 +133,7 @@ private: ///////////// Attributes ////////////// /** Iterator for the current BOM structure on the non-ordered list. */ - ITERATOR _itBomStructureObject; + iterator_type _itBomStructureObject; /** Helper attribute. <br>It is necessary to define that value at the attribute @@ -147,7 +154,7 @@ inline typename ITERATOR::difference_type operator-(const BomIterator_T<BOM_CONTENT, ITERATOR>& l, const BomIterator_T<BOM_CONTENT, ITERATOR>& r) { - return l._itBomStructureObject - r._itBomStructureObject; + return l.base() - r.base(); } template<typename BOM_CONTENT, typename ITERATOR> @@ -156,8 +163,7 @@ const BomIterator_T<BOM_CONTENT, ITERATOR>& r) { // Definition allowing to retrieve the Parent_T of BomIterator_T. typedef typename BomIterator_T<BOM_CONTENT,ITERATOR>::Parent_T Parent_T; - return BomIterator_T<BOM_CONTENT, ITERATOR> - (n+r._itBomStructureObject); + return BomIterator_T<BOM_CONTENT, ITERATOR> (n+r.base()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-06 15:25:16
|
Revision: 34 http://stdair.svn.sourceforge.net/stdair/?rev=34&view=rev Author: quannaus Date: 2009-10-06 15:25:09 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-06 15:22:32 UTC (rev 33) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-06 15:25:09 UTC (rev 34) @@ -80,7 +80,7 @@ /** Initialise the internal iterators on bom objects: return the iterator at the begining of the list. */ ListIterator_T listBegin () { - return _bomChildrenOrderedList.begin(); + return ListIterator_T(_bomChildrenOrderedList.begin()); } /** Initialise the internal iterators on bom objects: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-06 15:22:43
|
Revision: 33 http://stdair.svn.sourceforge.net/stdair/?rev=33&view=rev Author: quannaus Date: 2009-10-06 15:22:32 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Changed the construction methods to public in BomConstIterator_T. Modified Paths: -------------- trunk/stdair/stdair/bom/BomIterator.hpp Modified: trunk/stdair/stdair/bom/BomIterator.hpp =================================================================== --- trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-06 15:14:27 UTC (rev 32) +++ trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-06 15:22:32 UTC (rev 33) @@ -31,7 +31,7 @@ // Definition allowing the retrieve the difference type of the ITERATOR. typedef typename ITERATOR::difference_type difference_type; - protected: + public: /** Normal constructor. */ BomIterator_T (ITERATOR iIterator) : _itBomStructureObject (iIterator) { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-06 15:14:33
|
Revision: 32 http://stdair.svn.sourceforge.net/stdair/?rev=32&view=rev Author: quannaus Date: 2009-10-06 15:14:27 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Removed the BomConstIterator_T. Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp trunk/stdair/stdair/bom/BomIterator.hpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.hpp Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-06 12:47:57 UTC (rev 31) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-06 15:14:27 UTC (rev 32) @@ -31,18 +31,10 @@ typedef std::map<const std::string, BomStructure_T*> BomChildrenList_T; /** Define the different types of iterators. */ - typedef BomConstIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenOrderedList_T::const_iterator> ListConstIterator_T; - typedef BomConstIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenOrderedList_T::const_reverse_iterator> ListConstReverseIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, typename BomChildrenOrderedList_T::const_iterator> ListIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, typename BomChildrenOrderedList_T::const_reverse_iterator> ListReverseIterator_T; - typedef BomConstIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenList_T::const_iterator> MapConstIterator_T; - typedef BomConstIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenList_T::const_reverse_iterator> MapConstReverseIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, typename BomChildrenList_T::const_iterator> MapIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, @@ -85,99 +77,51 @@ } // /////////// Iteration methods ////////// - /** Initialise the internal const iterators on bom objects: + /** Initialise the internal iterators on bom objects: return the iterator at the begining of the list. */ - ListConstIterator_T listConstIteratorBegin () const { + ListIterator_T listBegin () { return _bomChildrenOrderedList.begin(); } - /** Initialise the internal const iterators on bom objects: - return the iterator past the end of the list. */ - ListConstIterator_T listConstIteratorEnd () const { - return _bomChildrenOrderedList.end(); - } - - /** Initialise the internal const reverse iterators on bom objects: - return the reverse iterator at the rbegining of the list. */ - ListConstReverseIterator_T listConstIteratorRBegin () const { - return _bomChildrenOrderedList.rbegin(); - } - - /** Initialise the internal const reverse iterators on bom objects: - return the reverse iterator past the rend of the list. */ - ListConstReverseIterator_T listConstIteratorREnd () const { - return _bomChildrenOrderedList.rend(); - } - /** Initialise the internal iterators on bom objects: - return the iterator at the begining of the list. */ - ListIterator_T listIteratorBegin () { - return ListIterator_T(_bomChildrenOrderedList.begin()); - } - - /** Initialise the internal iterators on bom objects: return the iterator past the end of the list. */ - ListIterator_T listIteratorEnd () const { + ListIterator_T listEnd () const { return _bomChildrenOrderedList.end(); } /** Initialise the internal reverse iterators on bom objects: return the reverse iterator at the rbegining of the list. */ - ListReverseIterator_T listIteratorRBegin () const { + ListReverseIterator_T listRBegin () const { return _bomChildrenOrderedList.rbegin(); } /** Initialise the internal reverse iterators on bom objects: return the reverse iterator past the rend of the list. */ - ListReverseIterator_T listIteratorREnd () const { + ListReverseIterator_T listREnd () const { return _bomChildrenOrderedList.rend(); } - /** Initialise the internal const iterators on bom objects: - return the iterator at the begining of the map. */ - MapConstIterator_T mapConstIteratorBegin () const { - return _bomChildrenList.begin(); - } - - /** Initialise the internal const iterators on bom objects: - return the iterator past the end of the map. */ - MapConstIterator_T mapConstIteratorEnd () const { - return _bomChildrenList.end(); - } - - /** Initialise the internal const reverse iterators on bom objects: - return the reverse iterator at the rbegining of the map. */ - MapConstReverseIterator_T mapConstIteratorRBegin () const { - return _bomChildrenList.rbegin(); - } - - /** Initialise the internal const reverse iterators on bom objects: - return the reverse iterator past the rend of the map. */ - MapConstReverseIterator_T mapConstIteratorREnd () const { - return _bomChildrenList.rend(); - } - /** Initialise the internal iterators on bom objects: return the iterator at the begining of the map. */ - MapIterator_T mapIteratorBegin () const { + MapIterator_T mapBegin () const { return _bomChildrenList.begin(); } /** Initialise the internal iterators on bom objects: return the iterator past the end of the map. */ - MapIterator_T mapIteratorEnd () const { + MapIterator_T mapEnd () const { return _bomChildrenList.end(); } /** Initialise the internal reverse iterators on bom objects: return the reverse iterator at the rbegining of the map. */ - MapReverseIterator_T mapIteratorRBegin () const { + MapReverseIterator_T mapRBegin () const { return _bomChildrenList.rbegin(); } /** Initialise the internal reverse iterators on bom objects: return the reverse iterator past the rend of the map. */ - MapReverseIterator_T mapIteratorREnd () const { + MapReverseIterator_T mapREnd () const { return _bomChildrenList.rend(); } Modified: trunk/stdair/stdair/bom/BomIterator.hpp =================================================================== --- trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-06 12:47:57 UTC (rev 31) +++ trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-06 15:14:27 UTC (rev 32) @@ -18,23 +18,33 @@ <br> This class aimed at implementing the "normal" operators except ones that needs to return a specific type (const/non-const) of iterator. */ - template <typename ITERATOR> - struct BomIteratorAbstract { + template <typename BOM_CONTENT, typename ITERATOR> + struct BomIterator_T { + public: + // Definition allowing to retrieve the corresponding bom structure. + typedef typename BOM_CONTENT::BomStructure_T BomStructure_T; + + // Define the pair of string and pointer of BOM_CONTENT. + typedef typename std::pair<std::string, BOM_CONTENT*> value_type; + + // Definition allowing the retrieve the difference type of the ITERATOR. + typedef typename ITERATOR::difference_type difference_type; + protected: /** Normal constructor. */ - BomIteratorAbstract (ITERATOR iIterator) + BomIterator_T (ITERATOR iIterator) : _itBomStructureObject (iIterator) { } /** Default constructor. */ - BomIteratorAbstract () { } + BomIterator_T () { } /** Default copy constructor. */ - BomIteratorAbstract (const BomIteratorAbstract& iBomIterator) + BomIterator_T (const BomIterator_T& iBomIterator) : _itBomStructureObject (iBomIterator._itBomStructureObject) { } /** Destructor. */ - ~BomIteratorAbstract() { } + ~BomIterator_T() { } public: // ///////////// Operators ////////////// @@ -47,210 +57,47 @@ void operator-- (int) { --_itBomStructureObject; } /** Equality operators. */ - bool operator== (const BomIteratorAbstract& iIt) { + bool operator== (const BomIterator_T& iIt) { return _itBomStructureObject == iIt._itBomStructureObject; } - bool operator!= (const BomIteratorAbstract& iIt) { + bool operator!= (const BomIterator_T& iIt) { return _itBomStructureObject != iIt._itBomStructureObject; } /** Relational operators. */ - bool operator< (const BomIteratorAbstract& iIt) { + bool operator< (const BomIterator_T& iIt) { return _itBomStructureObject < iIt._itBomStructureObject; } - bool operator> (const BomIteratorAbstract& iIt) { + bool operator> (const BomIterator_T& iIt) { return _itBomStructureObject > iIt._itBomStructureObject; } - bool operator<= (const BomIteratorAbstract& iIt) { + bool operator<= (const BomIterator_T& iIt) { return _itBomStructureObject <= iIt._itBomStructureObject; } - bool operator>= (const BomIteratorAbstract& iIt) { + bool operator>= (const BomIterator_T& iIt) { return _itBomStructureObject >= iIt._itBomStructureObject; } - - public: - ///////////// Attributes ////////////// - /** Iterator for the current BOM structure on the non-ordered list. */ - ITERATOR _itBomStructureObject; - - }; - - - /** - Operators for BomIteratorAbstract that need to be implemented outside - of BomIteratorAbstract scope. - */ - template<typename ITERATOR> - inline typename ITERATOR::difference_type - operator-(const BomIteratorAbstract<ITERATOR>& l, - const BomIteratorAbstract<ITERATOR>& r) { - return l._itBomStructureObject - r._itBomStructureObject; - } - - - /** Template class aimed at iterating a list or a map of children BOM - structure of a dedicated type using const iterators. - <br> This class aimed at implementing the specific operators for - const iterators. - */ - template <typename BOM_CONTENT, typename ITERATOR> - struct BomConstIterator_T : public BomIteratorAbstract<ITERATOR> { - - public: - // Definition allowing to retrieve the parent type. - typedef BomIteratorAbstract<ITERATOR> Parent_T; - - // Definition allowing to retrieve the corresponding bom structure. - typedef typename BOM_CONTENT::BomStructure_T BomStructure_T; - - // Define the pair of string and pointer of BOM_CONTENT. - typedef typename std::pair<std::string, const BOM_CONTENT*> value_type; - - // Definition allowing the retrieve the difference type of the ITERATOR. - typedef typename ITERATOR::difference_type difference_type; - - public: - /** Normal constructor. */ - BomConstIterator_T (ITERATOR iIterator) : Parent_T (iIterator) { } - - /** Default constructor. */ - BomConstIterator_T () { } - - /** Default copy constructor. */ - BomConstIterator_T (const BomConstIterator_T& iBomIterator) - : Parent_T (iBomIterator.Parent_T::_itBomStructureObject) { } - - /** Destructor. */ - ~BomConstIterator_T() { } - - public: - // ////////////// Additive Operators /////////////// - BomConstIterator_T operator+ (const difference_type iIndex) { - return BomConstIterator_T(Parent_T::_itBomStructureObject + iIndex); - } - BomConstIterator_T& operator+= (const difference_type iIndex) { - Parent_T::_itBomStructureObject += iIndex; - return *this; - } - BomConstIterator_T operator- (const difference_type iIndex) { - return BomConstIterator_T(Parent_T::_itBomStructureObject - iIndex); - } - BomConstIterator_T& operator-= (const difference_type iIndex) { - Parent_T::_itBomStructureObject -= iIndex; - return *this; - } - - // ////////////// Dereferencing Operators ////////////// - /** Dereferencing operator for iterators on a list. */ - const BOM_CONTENT& operator* () { - const BomStructure_T* lBomStruct_ptr = *Parent_T::_itBomStructureObject; - assert (lBomStruct_ptr != NULL); - BOM_CONTENT* lBomContent_ptr = - BomStructure::getBomContentPtr<BOM_CONTENT> (*lBomStruct_ptr); - assert (lBomContent_ptr != NULL); - return *lBomContent_ptr; - } - - /** Dereferencing operator for iterators on a map. */ - value_type* operator-> () { - const MapKey_T& lKey = Parent_T::_itBomStructureObject->first; - const BomStructure_T* lBomStruct_ptr = - Parent_T::_itBomStructureObject->second; - assert (lBomStruct_ptr != NULL); - BOM_CONTENT* lBomContent_ptr = - BomStructure::getBomContentPtr<BOM_CONTENT> (*lBomStruct_ptr); - assert (lBomContent_ptr != NULL); - - // See the comment below, at the definition of the _intermediateValue - // attribute - _intermediateValue.first = lKey; - _intermediateValue.second = lBomContent_ptr; - - return &_intermediateValue; - } - - protected: - /** Helper attribute. - <br>It is necessary to define that value at the attribute - level, because the operator->() method needs to return a - pointer on it. If that value be temporary, i.e., created at - the fly when the operator->() method returns, we would return - a pointer on a temporary value, which is not good. */ - value_type _intermediateValue; - - }; - - /** - Operators for BomConstIterator_T that need to be implemented outside - of BomConstIterator_T scope. - */ - template<typename BOM_CONTENT, typename ITERATOR> - inline BomConstIterator_T<BOM_CONTENT, ITERATOR> - operator+(const typename ITERATOR::difference_type n, - const BomConstIterator_T<BOM_CONTENT, ITERATOR>& r) { - // Definition allowing to retrieve the Parent_T of BomConstIterator_T. - typedef typename BomConstIterator_T<BOM_CONTENT,ITERATOR>::Parent_T Parent_T; - return BomConstIterator_T<BOM_CONTENT, ITERATOR> - (n+r.Parent_T::_itBomStructureObject); - } - - /** Template class aimed at iterating a list or a map of children BOM - structure of a dedicated type using non-const iterators. - <br> This class aimed at implementing the specific operators for - non-const iterators. - */ - template <typename BOM_CONTENT, typename ITERATOR> - struct BomIterator_T : public BomIteratorAbstract<ITERATOR> { - - public: - // Definition allowing to retrieve the parent type. - typedef BomIteratorAbstract<ITERATOR> Parent_T; - - // Definition allowing to retrieve the corresponding bom structure. - typedef typename BOM_CONTENT::BomStructure_T BomStructure_T; - - // Define the pair of string and pointer of BOM_CONTENT. - typedef typename std::pair<std::string, BOM_CONTENT*> value_type; - - // Definition allowing the retrieve the difference type of the ITERATOR. - typedef typename ITERATOR::difference_type difference_type; - - public: - /** Normal constructor. */ - BomIterator_T (ITERATOR iIterator) : Parent_T (iIterator) { } - - /** Default constructor. */ - BomIterator_T () { } - - /** Default copy constructor. */ - BomIterator_T (const BomIterator_T& iBomIterator) - : Parent_T (iBomIterator.Parent_T::_itBomStructureObject) { } - - /** Destructor. */ - ~BomIterator_T() { } - - public: - // ////////////// Additive Operators /////////////// + /** Additive Operators. */ BomIterator_T operator+ (const difference_type iIndex) { - return BomIterator_T(Parent_T::_itBomStructureObject + iIndex); + return BomIterator_T(_itBomStructureObject + iIndex); } BomIterator_T& operator+= (const difference_type iIndex) { - Parent_T::_itBomStructureObject += iIndex; + _itBomStructureObject += iIndex; return *this; } BomIterator_T operator- (const difference_type iIndex) { - return BomIterator_T(Parent_T::_itBomStructureObject - iIndex); + return BomIterator_T(_itBomStructureObject - iIndex); } BomIterator_T& operator-= (const difference_type iIndex) { - Parent_T::_itBomStructureObject -= iIndex; + _itBomStructureObject -= iIndex; return *this; } - + // ////////////// Dereferencing Operators ////////////// /** Dereferencing operator for iterators on a list. */ BOM_CONTENT& operator* () { - const BomStructure_T* lBomStruct_ptr = *Parent_T::_itBomStructureObject; + const BomStructure_T* lBomStruct_ptr = *_itBomStructureObject; assert (lBomStruct_ptr != NULL); BOM_CONTENT* lBomContent_ptr = BomStructure::getBomContentPtr<BOM_CONTENT> (*lBomStruct_ptr); @@ -260,9 +107,9 @@ /** Dereferencing operator for iterators on a map. */ value_type* operator-> () { - const MapKey_T& lKey = Parent_T::_itBomStructureObject->first; + const MapKey_T& lKey = _itBomStructureObject->first; const BomStructure_T* lBomStruct_ptr = - Parent_T::_itBomStructureObject->second; + _itBomStructureObject->second; assert (lBomStruct_ptr != NULL); BOM_CONTENT* lBomContent_ptr = BomStructure::getBomContentPtr<BOM_CONTENT> (*lBomStruct_ptr); @@ -276,7 +123,11 @@ return &_intermediateValue; } - protected: + private: + ///////////// Attributes ////////////// + /** Iterator for the current BOM structure on the non-ordered list. */ + ITERATOR _itBomStructureObject; + /** Helper attribute. <br>It is necessary to define that value at the attribute level, because the operator->() method needs to return a @@ -287,19 +138,27 @@ }; + /** Operators for BomIterator_T that need to be implemented outside of BomIterator_T scope. */ template<typename BOM_CONTENT, typename ITERATOR> + inline typename ITERATOR::difference_type + operator-(const BomIterator_T<BOM_CONTENT, ITERATOR>& l, + const BomIterator_T<BOM_CONTENT, ITERATOR>& r) { + return l._itBomStructureObject - r._itBomStructureObject; + } + + template<typename BOM_CONTENT, typename ITERATOR> inline BomIterator_T<BOM_CONTENT, ITERATOR> operator+(const typename ITERATOR::difference_type n, const BomIterator_T<BOM_CONTENT, ITERATOR>& r) { // Definition allowing to retrieve the Parent_T of BomIterator_T. typedef typename BomIterator_T<BOM_CONTENT,ITERATOR>::Parent_T Parent_T; return BomIterator_T<BOM_CONTENT, ITERATOR> - (n+r.Parent_T::_itBomStructureObject); + (n+r._itBomStructureObject); } - + } #endif // __STDAIR_BOM_BOMITERATOR_T_HPP Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-06 12:47:57 UTC (rev 31) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-06 15:14:27 UTC (rev 32) @@ -62,26 +62,18 @@ typedef BomChildrenHolderImp<SecondContentChild_T> SecondChildrenBomHolder_T; /** Define the iterators of the segment-date list. */ - typedef typename ChildrenBomHolder_T::ListConstIterator_T SegmentDateListConstIterator_T; - typedef typename ChildrenBomHolder_T::ListConstReverseIterator_T SegmentDateListConstReverseIterator_T; typedef typename ChildrenBomHolder_T::ListIterator_T SegmentDateListIterator_T; typedef typename ChildrenBomHolder_T::ListReverseIterator_T SegmentDateListReverseIterator_T; /** Define the iterators of the segment-date map. */ - typedef typename ChildrenBomHolder_T::MapConstIterator_T SegmentDateMapConstIterator_T; - typedef typename ChildrenBomHolder_T::MapConstReverseIterator_T SegmentDateMapConstReverseIterator_T; typedef typename ChildrenBomHolder_T::MapIterator_T SegmentDateMapIterator_T; typedef typename ChildrenBomHolder_T::MapReverseIterator_T SegmentDateMapReverseIterator_T; /** Define the iterators of the leg-date list. */ - typedef typename SecondChildrenBomHolder_T::ListConstIterator_T LegDateListConstIterator_T; - typedef typename SecondChildrenBomHolder_T::ListConstReverseIterator_T LegDateListConstReverseIterator_T; typedef typename SecondChildrenBomHolder_T::ListIterator_T LegDateListIterator_T; typedef typename SecondChildrenBomHolder_T::ListReverseIterator_T LegDateListReverseIterator_T; /** Define the iterators of the leg-date map. */ - typedef typename SecondChildrenBomHolder_T::MapConstIterator_T LegDateMapConstIterator_T; - typedef typename SecondChildrenBomHolder_T::MapConstReverseIterator_T LegDateMapConstReverseIterator_T; typedef typename SecondChildrenBomHolder_T::MapIterator_T LegDateMapIterator_T; typedef typename SecondChildrenBomHolder_T::MapReverseIterator_T LegDateMapReverseIterator_T; @@ -193,229 +185,117 @@ public: // /////////// Iteration methods ////////// - /** Initialise the internal const iterator on segment date: - return the const iterator at the begining of the list. */ - SegmentDateListConstIterator_T segmentDateListConstIteratorBegin () const { - assert (_childrenList != NULL); - return _childrenList->listConstIteratorBegin (); - } - - /** Initialise the internal const iterator on segment date: - return the const iterator at the end of the list. */ - SegmentDateListConstIterator_T segmentDateListConstIteratorEnd () const { - assert (_childrenList != NULL); - return _childrenList->listConstIteratorEnd (); - } - - /** Initialise the internal const reverse iterator on segment date: - return the const reverse iterator at the rbegining of the list. */ - SegmentDateListConstReverseIterator_T segmentDateListConstIteratorRBegin () const { - assert (_childrenList != NULL); - return _childrenList->listConstIteratorRBegin (); - } - - /** Initialise the internal const reverse iterator on segment date: - return the const reverse iterator at the rend of the list. */ - SegmentDateListConstReverseIterator_T segmentDateListConstIteratorREnd () const { - assert (_childrenList != NULL); - return _childrenList->listConstIteratorREnd (); - } - /** Initialise the internal iterator on segment date: return the iterator at the begining of the list. */ - SegmentDateListIterator_T segmentDateListIteratorBegin () const { + SegmentDateListIterator_T segmentDateListBegin () const { assert (_childrenList != NULL); - return _childrenList->listIteratorBegin (); + return _childrenList->listBegin (); } /** Initialise the internal iterator on segment date: return the iterator at the end of the list. */ - SegmentDateListIterator_T segmentDateListIteratorEnd () const { + SegmentDateListIterator_T segmentDateListEnd () const { assert (_childrenList != NULL); - return _childrenList->listIteratorEnd (); + return _childrenList->listEnd (); } /** Initialise the internal reverse iterator on segment date: return the reverse iterator at the rbegining of the list. */ - SegmentDateListReverseIterator_T segmentDateListIteratorRBegin () const { + SegmentDateListReverseIterator_T segmentDateListRBegin () const { assert (_childrenList != NULL); - return _childrenList->listIteratorRBegin (); + return _childrenList->listRBegin (); } /** Initialise the internal reverse iterator on segment date: return the reverse iterator at the rend of the list. */ - SegmentDateListReverseIterator_T segmentDateListIteratorREnd () const { + SegmentDateListReverseIterator_T segmentDateListREnd () const { assert (_childrenList != NULL); - return _childrenList->listIteratorREnd (); + return _childrenList->listREnd (); } - /** Initialise the internal const iteratorson segment date: - return the const iterator at the begining of the map. */ - SegmentDateMapConstIterator_T segmentDateMapConstIteratorBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapConstIteratorBegin (); - } - - /** Initialise the internal const iterator on segment date: - return the const iterator at the end of the map. */ - SegmentDateMapConstIterator_T segmentDateMapConstIteratorEnd () const { - assert (_childrenList != NULL); - return _childrenList->mapConstIteratorEnd (); - } - - /** Initialise the internal const reverse iterator on segment date: - return the const reverse iterator at the rbegining of the map. */ - SegmentDateMapConstReverseIterator_T segmentDateMapConstIteratorRBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapConstIteratorRBegin (); - } - - /** Initialise the internal const reverse iterator on segment date: - return the const reverse iterator at the rend of the map. */ - SegmentDateMapConstReverseIterator_T segmentDateMapConstIteratorREnd () const { - assert (_childrenList != NULL); - return _childrenList->mapConstIteratorREnd (); - } - /** Initialise the internal iterator on segment date: return the iterator at the begining of the map. */ - SegmentDateMapIterator_T segmentDateMapIteratorBegin () const { + SegmentDateMapIterator_T segmentDateMapBegin () const { assert (_childrenList != NULL); - return _childrenList->mapIteratorBegin (); + return _childrenList->mapBegin (); } /** Initialise the internal iterator on segment date: return the iterator at the end of the map. */ - SegmentDateMapIterator_T segmentDateMapIteratorEnd () const { + SegmentDateMapIterator_T segmentDateMapEnd () const { assert (_childrenList != NULL); - return _childrenList->mapIteratorEnd (); + return _childrenList->mapEnd (); } /** Initialise the internal reverse iterator on segment date: return the reverse iterator at the rbegining of the map. */ - SegmentDateMapReverseIterator_T segmentDateMapIteratorRBegin () const { + SegmentDateMapReverseIterator_T segmentDateMapRBegin () const { assert (_childrenList != NULL); - return _childrenList->mapIteratorRBegin (); + return _childrenList->mapRBegin (); } /** Initialise the internal reverse iterator on segment date: return the reverse iterator at the rend of the map. */ - SegmentDateMapReverseIterator_T segmentDateMapIteratorREnd () const { + SegmentDateMapReverseIterator_T segmentDateMapREnd () const { assert (_childrenList != NULL); - return _childrenList->mapIteratorREnd (); + return _childrenList->mapREnd (); } - /** Initialise the internal const iterator on leg date: - return the const iterator at the begining of the list. */ - LegDateListConstIterator_T legDateListConstIteratorBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listConstIteratorBegin (); - } - - /** Initialise the internal const iterator on leg date: - return the const iterator at the end of the list. */ - LegDateListConstIterator_T legDateListConstIteratorEnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listConstIteratorEnd (); - } - - /** Initialise the internal const reverse iterator on leg date: - return the const reverse iterator at the rbegining of the list. */ - LegDateListConstReverseIterator_T legDateListConstIteratorRBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listConstIteratorRBegin (); - } - - /** Initialise the internal const reverse iterator on leg date: - return the const reverse iterator at the rend of the list. */ - LegDateListConstReverseIterator_T legDateListConstIteratorREnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listConstIteratorREnd (); - } - /** Initialise the internal iterator on leg date: return the iterator at the begining of the list. */ - LegDateListIterator_T legDateListIteratorBegin () const { + LegDateListIterator_T legDateListBegin () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->listIteratorBegin (); + return _secondChildrenList->listBegin (); } /** Initialise the internal iterator on leg date: return the iterator at the end of the list. */ - LegDateListIterator_T legDateListIteratorEnd () const { + LegDateListIterator_T legDateListEnd () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->listIteratorEnd (); + return _secondChildrenList->listEnd (); } /** Initialise the internal reverse iterator on leg date: return the reverse iterator at the rbegining of the list. */ - LegDateListReverseIterator_T legDateListIteratorRBegin () const { + LegDateListReverseIterator_T legDateListRBegin () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->listIteratorRBegin (); + return _secondChildrenList->listRBegin (); } /** Initialise the internal reverse iterator on leg date: return the reverse iterator at the rend of the list. */ - LegDateListReverseIterator_T legDateListIteratorREnd () const { + LegDateListReverseIterator_T legDateListREnd () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->listIteratorREnd (); + return _secondChildrenList->listREnd (); } - /** Initialise the internal const iteratorson leg date: - return the const iterator at the begining of the map. */ - LegDateMapConstIterator_T legDateMapConstIteratorBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapConstIteratorBegin (); - } - - /** Initialise the internal const iterator on leg date: - return the const iterator at the end of the map. */ - LegDateMapConstIterator_T legDateMapConstIteratorEnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapConstIteratorEnd (); - } - - /** Initialise the internal const reverse iterator on leg date: - return the const reverse iterator at the rbegining of the map. */ - LegDateMapConstReverseIterator_T legDateMapConstIteratorRBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapConstIteratorRBegin (); - } - - /** Initialise the internal const reverse iterator on leg date: - return the const reverse iterator at the rend of the map. */ - LegDateMapConstReverseIterator_T legDateMapConstIteratorREnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapConstIteratorREnd (); - } - /** Initialise the internal iterator on leg date: return the iterator at the begining of the map. */ - LegDateMapIterator_T legDateMapIteratorBegin () const { + LegDateMapIterator_T legDateMapBegin () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->mapIteratorBegin (); + return _secondChildrenList->mapBegin (); } /** Initialise the internal iterator on leg date: return the iterator at the end of the map. */ - LegDateMapIterator_T legDateMapIteratorEnd () const { + LegDateMapIterator_T legDateMapEnd () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->mapIteratorEnd (); + return _secondChildrenList->mapEnd (); } /** Initialise the internal reverse iterator on leg date: return the reverse iterator at the rbegining of the map. */ - LegDateMapReverseIterator_T legDateMapIteratorRBegin () const { + LegDateMapReverseIterator_T legDateMapRBegin () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->mapIteratorRBegin (); + return _secondChildrenList->mapRBegin (); } /** Initialise the internal reverse iterator on leg date: return the reverse iterator at the rend of the map. */ - LegDateMapReverseIterator_T legDateMapIteratorREnd () const { + LegDateMapReverseIterator_T legDateMapREnd () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->mapIteratorREnd (); + return _secondChildrenList->mapREnd (); } Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 12:47:57 UTC (rev 31) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 15:14:27 UTC (rev 32) @@ -58,14 +58,10 @@ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; /** Define the iterators of the flight-date list. */ - typedef typename ChildrenBomHolder_T::ListConstIterator_T FlightDateListConstIterator_T; - typedef typename ChildrenBomHolder_T::ListConstReverseIterator_T FlightDateListConstReverseIterator_T; typedef typename ChildrenBomHolder_T::ListIterator_T FlightDateListIterator_T; typedef typename ChildrenBomHolder_T::ListReverseIterator_T FlightDateListReverseIterator_T; /** Define the iterators of the flight-date map. */ - typedef typename ChildrenBomHolder_T::MapConstIterator_T FlightDateMapConstIterator_T; - typedef typename ChildrenBomHolder_T::MapConstReverseIterator_T FlightDateMapConstReverseIterator_T; typedef typename ChildrenBomHolder_T::MapIterator_T FlightDateMapIterator_T; typedef typename ChildrenBomHolder_T::MapReverseIterator_T FlightDateMapReverseIterator_T; @@ -153,116 +149,60 @@ public: // /////////// Iteration methods ////////// - /** Initialise the internal const iterator on flight date: - return the const iterator at the begining of the list. */ - FlightDateListConstIterator_T flightDateListConstIteratorBegin () const { - assert (_childrenList != NULL); - return _childrenList->listConstIteratorBegin (); - } - - /** Initialise the internal const iterator on flight date: - return the const iterator at the end of the list. */ - FlightDateListConstIterator_T flightDateListConstIteratorEnd () const { - assert (_childrenList != NULL); - return _childrenList->listConstIteratorEnd (); - } - - /** Initialise the internal const reverse iterator on flight date: - return the const reverse iterator at the rbegining of the list. */ - FlightDateListConstReverseIterator_T flightDateListConstIteratorRBegin () const { - assert (_childrenList != NULL); - return _childrenList->listConstIteratorRBegin (); - } - - /** Initialise the internal const reverse iterator on flight date: - return the const reverse iterator at the rend of the list. */ - FlightDateListConstReverseIterator_T flightDateListConstIteratorREnd () const { - assert (_childrenList != NULL); - return _childrenList->listConstIteratorREnd (); - } - /** Initialise the internal iterator on flight date: return the iterator at the begining of the list. */ - FlightDateListIterator_T flightDateListIteratorBegin () const { + FlightDateListIterator_T flightDateListBegin () const { assert (_childrenList != NULL); - return _childrenList->listIteratorBegin (); + return _childrenList->listBegin (); } /** Initialise the internal iterator on flight date: return the iterator at the end of the list. */ - FlightDateListIterator_T flightDateListIteratorEnd () const { + FlightDateListIterator_T flightDateListEnd () const { assert (_childrenList != NULL); - return _childrenList->listIteratorEnd (); + return _childrenList->listEnd (); } /** Initialise the internal reverse iterator on flight date: return the reverse iterator at the rbegining of the list. */ - FlightDateListReverseIterator_T flightDateListIteratorRBegin () const { + FlightDateListReverseIterator_T flightDateListRBegin () const { assert (_childrenList != NULL); - return _childrenList->listIteratorRBegin (); + return _childrenList->listRBegin (); } /** Initialise the internal reverse iterator on flight date: return the reverse iterator at the rend of the list. */ - FlightDateListReverseIterator_T flightDateListIteratorREnd () const { + FlightDateListReverseIterator_T flightDateListREnd () const { assert (_childrenList != NULL); - return _childrenList->listIteratorREnd (); + return _childrenList->listREnd (); } - /** Initialise the internal const iteratorson flight date: - return the const iterator at the begining of the map. */ - FlightDateMapConstIterator_T flightDateMapConstIteratorBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapConstIteratorBegin (); - } - - /** Initialise the internal const iterator on flight date: - return the const iterator at the end of the map. */ - FlightDateMapConstIterator_T flightDateMapConstIteratorEnd () const { - assert (_childrenList != NULL); - return _childrenList->mapConstIteratorEnd (); - } - - /** Initialise the internal const reverse iterator on flight date: - return the const reverse iterator at the rbegining of the map. */ - FlightDateMapConstReverseIterator_T flightDateMapConstIteratorRBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapConstIteratorRBegin (); - } - - /** Initialise the internal const reverse iterator on flight date: - return the const reverse iterator at the rend of the map. */ - FlightDateMapConstReverseIterator_T flightDateMapConstIteratorREnd () const { - assert (_childrenList != NULL); - return _childrenList->mapConstIteratorREnd (); - } - /** Initialise the internal iterator on flight date: return the iterator at the begining of the map. */ - FlightDateMapIterator_T flightDateMapIteratorBegin () const { + FlightDateMapIterator_T flightDateMapBegin () const { assert (_childrenList != NULL); - return _childrenList->mapIteratorBegin (); + return _childrenList->mapBegin (); } /** Initialise the internal iterator on flight date: return the iterator at the end of the map. */ - FlightDateMapIterator_T flightDateMapIteratorEnd () const { + FlightDateMapIterator_T flightDateMapEnd () const { assert (_childrenList != NULL); - return _childrenList->mapIteratorEnd (); + return _childrenList->mapEnd (); } /** Initialise the internal reverse iterator on flight date: return the reverse iterator at the rbegining of the map. */ - FlightDateMapReverseIterator_T flightDateMapIteratorRBegin () const { + FlightDateMapReverseIterator_T flightDateMapRBegin () const { assert (_childrenList != NULL); - return _childrenList->mapIteratorRBegin (); + return _childrenList->mapRBegin (); } /** Initialise the internal reverse iterator on flight date: return the reverse iterator at the rend of the map. */ - FlightDateMapReverseIterator_T flightDateMapIteratorREnd () const { + FlightDateMapReverseIterator_T flightDateMapREnd () const { assert (_childrenList != NULL); - return _childrenList->mapIteratorREnd (); + return _childrenList->mapREnd (); } private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-06 12:48:06
|
Revision: 31 http://stdair.svn.sourceforge.net/stdair/?rev=31&view=rev Author: quannaus Date: 2009-10-06 12:47:57 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Reverted to the revision 28. Revision Links: -------------- http://stdair.svn.sourceforge.net/stdair/?rev=28&view=rev Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.hpp Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-06 12:23:47 UTC (rev 30) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-06 12:47:57 UTC (rev 31) @@ -87,7 +87,7 @@ // /////////// Iteration methods ////////// /** Initialise the internal const iterators on bom objects: return the iterator at the begining of the list. */ - ListConstIterator_T listBegin () const { + ListConstIterator_T listConstIteratorBegin () const { return _bomChildrenOrderedList.begin(); } @@ -111,7 +111,7 @@ /** Initialise the internal iterators on bom objects: return the iterator at the begining of the list. */ - ListIterator_T listBegin () { + ListIterator_T listIteratorBegin () { return ListIterator_T(_bomChildrenOrderedList.begin()); } Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-06 12:23:47 UTC (rev 30) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-06 12:47:57 UTC (rev 31) @@ -195,9 +195,9 @@ // /////////// Iteration methods ////////// /** Initialise the internal const iterator on segment date: return the const iterator at the begining of the list. */ - SegmentDateListConstIterator_T segmentDateListBegin () const { + SegmentDateListConstIterator_T segmentDateListConstIteratorBegin () const { assert (_childrenList != NULL); - return _childrenList->listBegin (); + return _childrenList->listConstIteratorBegin (); } /** Initialise the internal const iterator on segment date: @@ -223,9 +223,9 @@ /** Initialise the internal iterator on segment date: return the iterator at the begining of the list. */ - SegmentDateListIterator_T segmentDateListBegin () { + SegmentDateListIterator_T segmentDateListIteratorBegin () const { assert (_childrenList != NULL); - return _childrenList->listaBegin (); + return _childrenList->listIteratorBegin (); } /** Initialise the internal iterator on segment date: @@ -308,9 +308,9 @@ /** Initialise the internal const iterator on leg date: return the const iterator at the begining of the list. */ - LegDateListConstIterator_T legDateListBegin () const { + LegDateListConstIterator_T legDateListConstIteratorBegin () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->listBegin (); + return _secondChildrenList->listConstIteratorBegin (); } /** Initialise the internal const iterator on leg date: @@ -336,9 +336,9 @@ /** Initialise the internal iterator on leg date: return the iterator at the begining of the list. */ - LegDateListIterator_T legDateListBegin () { + LegDateListIterator_T legDateListIteratorBegin () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->listBegin (); + return _secondChildrenList->listIteratorBegin (); } /** Initialise the internal iterator on leg date: Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 12:23:47 UTC (rev 30) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 12:47:57 UTC (rev 31) @@ -155,9 +155,9 @@ // /////////// Iteration methods ////////// /** Initialise the internal const iterator on flight date: return the const iterator at the begining of the list. */ - FlightDateListConstIterator_T flightDateListBegin () const { + FlightDateListConstIterator_T flightDateListConstIteratorBegin () const { assert (_childrenList != NULL); - return _childrenList->listBegin (); + return _childrenList->listConstIteratorBegin (); } /** Initialise the internal const iterator on flight date: @@ -183,9 +183,9 @@ /** Initialise the internal iterator on flight date: return the iterator at the begining of the list. */ - FlightDateListIterator_T flightDateListBegin () { + FlightDateListIterator_T flightDateListIteratorBegin () const { assert (_childrenList != NULL); - return _childrenList->listBegin (); + return _childrenList->listIteratorBegin (); } /** Initialise the internal iterator on flight date: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-06 12:24:02
|
Revision: 30 http://stdair.svn.sourceforge.net/stdair/?rev=30&view=rev Author: quannaus Date: 2009-10-06 12:23:47 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.hpp Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-06 12:19:31 UTC (rev 29) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-06 12:23:47 UTC (rev 30) @@ -223,9 +223,9 @@ /** Initialise the internal iterator on segment date: return the iterator at the begining of the list. */ - SegmentDateListIterator_T segmentDateListBegin () const { + SegmentDateListIterator_T segmentDateListBegin () { assert (_childrenList != NULL); - return _childrenList->listBegin (); + return _childrenList->listaBegin (); } /** Initialise the internal iterator on segment date: @@ -336,7 +336,7 @@ /** Initialise the internal iterator on leg date: return the iterator at the begining of the list. */ - LegDateListIterator_T legDateListBegin () const { + LegDateListIterator_T legDateListBegin () { assert (_secondChildrenList != NULL); return _secondChildrenList->listBegin (); } Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 12:19:31 UTC (rev 29) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 12:23:47 UTC (rev 30) @@ -183,7 +183,7 @@ /** Initialise the internal iterator on flight date: return the iterator at the begining of the list. */ - FlightDateListIterator_T flightDateListBegin () const { + FlightDateListIterator_T flightDateListBegin () { assert (_childrenList != NULL); return _childrenList->listBegin (); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-06 12:19:37
|
Revision: 29 http://stdair.svn.sourceforge.net/stdair/?rev=29&view=rev Author: quannaus Date: 2009-10-06 12:19:31 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.hpp Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-06 09:12:24 UTC (rev 28) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-06 12:19:31 UTC (rev 29) @@ -87,7 +87,7 @@ // /////////// Iteration methods ////////// /** Initialise the internal const iterators on bom objects: return the iterator at the begining of the list. */ - ListConstIterator_T listConstIteratorBegin () const { + ListConstIterator_T listBegin () const { return _bomChildrenOrderedList.begin(); } @@ -111,7 +111,7 @@ /** Initialise the internal iterators on bom objects: return the iterator at the begining of the list. */ - ListIterator_T listIteratorBegin () { + ListIterator_T listBegin () { return ListIterator_T(_bomChildrenOrderedList.begin()); } Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-06 09:12:24 UTC (rev 28) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-06 12:19:31 UTC (rev 29) @@ -195,9 +195,9 @@ // /////////// Iteration methods ////////// /** Initialise the internal const iterator on segment date: return the const iterator at the begining of the list. */ - SegmentDateListConstIterator_T segmentDateListConstIteratorBegin () const { + SegmentDateListConstIterator_T segmentDateListBegin () const { assert (_childrenList != NULL); - return _childrenList->listConstIteratorBegin (); + return _childrenList->listBegin (); } /** Initialise the internal const iterator on segment date: @@ -223,9 +223,9 @@ /** Initialise the internal iterator on segment date: return the iterator at the begining of the list. */ - SegmentDateListIterator_T segmentDateListIteratorBegin () const { + SegmentDateListIterator_T segmentDateListBegin () const { assert (_childrenList != NULL); - return _childrenList->listIteratorBegin (); + return _childrenList->listBegin (); } /** Initialise the internal iterator on segment date: @@ -308,9 +308,9 @@ /** Initialise the internal const iterator on leg date: return the const iterator at the begining of the list. */ - LegDateListConstIterator_T legDateListConstIteratorBegin () const { + LegDateListConstIterator_T legDateListBegin () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->listConstIteratorBegin (); + return _secondChildrenList->listBegin (); } /** Initialise the internal const iterator on leg date: @@ -336,9 +336,9 @@ /** Initialise the internal iterator on leg date: return the iterator at the begining of the list. */ - LegDateListIterator_T legDateListIteratorBegin () const { + LegDateListIterator_T legDateListBegin () const { assert (_secondChildrenList != NULL); - return _secondChildrenList->listIteratorBegin (); + return _secondChildrenList->listBegin (); } /** Initialise the internal iterator on leg date: Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 09:12:24 UTC (rev 28) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 12:19:31 UTC (rev 29) @@ -155,9 +155,9 @@ // /////////// Iteration methods ////////// /** Initialise the internal const iterator on flight date: return the const iterator at the begining of the list. */ - FlightDateListConstIterator_T flightDateListConstIteratorBegin () const { + FlightDateListConstIterator_T flightDateListBegin () const { assert (_childrenList != NULL); - return _childrenList->listConstIteratorBegin (); + return _childrenList->listBegin (); } /** Initialise the internal const iterator on flight date: @@ -183,9 +183,9 @@ /** Initialise the internal iterator on flight date: return the iterator at the begining of the list. */ - FlightDateListIterator_T flightDateListIteratorBegin () const { + FlightDateListIterator_T flightDateListBegin () const { assert (_childrenList != NULL); - return _childrenList->listIteratorBegin (); + return _childrenList->listBegin (); } /** Initialise the internal iterator on flight date: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-06 09:12:30
|
Revision: 28 http://stdair.svn.sourceforge.net/stdair/?rev=28&view=rev Author: quannaus Date: 2009-10-06 09:12:24 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Added some friend classes. Modified Paths: -------------- trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/SegmentDate.hpp Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 09:01:12 UTC (rev 27) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 09:12:24 UTC (rev 28) @@ -29,6 +29,7 @@ class Inventory : public BomStructure { friend class FacBomStructure; friend class FacBomContent; + friend class BomStructure; public: // Type definitions Modified: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp 2009-10-06 09:01:12 UTC (rev 27) +++ trunk/stdair/stdair/bom/LegDate.hpp 2009-10-06 09:12:24 UTC (rev 28) @@ -25,6 +25,7 @@ class LegDate : public BomStructure { friend class FacBomStructure; friend class FacBomContent; + friend class BomStructure; public: // Type definitions Modified: trunk/stdair/stdair/bom/SegmentDate.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-06 09:01:12 UTC (rev 27) +++ trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-06 09:12:24 UTC (rev 28) @@ -25,6 +25,7 @@ class SegmentDate : public BomStructure { friend class FacBomStructure; friend class FacBomContent; + friend class BomStructure; public: // Type definitions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-06 09:01:19
|
Revision: 27 http://stdair.svn.sourceforge.net/stdair/?rev=27&view=rev Author: quannaus Date: 2009-10-06 09:01:12 +0000 (Tue, 06 Oct 2009) Log Message: ----------- [Dev] Added the itertion methods on the children lists of flight-date. Modified Paths: -------------- trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.hpp Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-05 08:42:37 UTC (rev 26) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-06 09:01:12 UTC (rev 27) @@ -60,6 +60,31 @@ /** Definition allowing to retrive the second children bom holder type. */ typedef BomChildrenHolderImp<SecondContentChild_T> SecondChildrenBomHolder_T; + + /** Define the iterators of the segment-date list. */ + typedef typename ChildrenBomHolder_T::ListConstIterator_T SegmentDateListConstIterator_T; + typedef typename ChildrenBomHolder_T::ListConstReverseIterator_T SegmentDateListConstReverseIterator_T; + typedef typename ChildrenBomHolder_T::ListIterator_T SegmentDateListIterator_T; + typedef typename ChildrenBomHolder_T::ListReverseIterator_T SegmentDateListReverseIterator_T; + + /** Define the iterators of the segment-date map. */ + typedef typename ChildrenBomHolder_T::MapConstIterator_T SegmentDateMapConstIterator_T; + typedef typename ChildrenBomHolder_T::MapConstReverseIterator_T SegmentDateMapConstReverseIterator_T; + typedef typename ChildrenBomHolder_T::MapIterator_T SegmentDateMapIterator_T; + typedef typename ChildrenBomHolder_T::MapReverseIterator_T SegmentDateMapReverseIterator_T; + + /** Define the iterators of the leg-date list. */ + typedef typename SecondChildrenBomHolder_T::ListConstIterator_T LegDateListConstIterator_T; + typedef typename SecondChildrenBomHolder_T::ListConstReverseIterator_T LegDateListConstReverseIterator_T; + typedef typename SecondChildrenBomHolder_T::ListIterator_T LegDateListIterator_T; + typedef typename SecondChildrenBomHolder_T::ListReverseIterator_T LegDateListReverseIterator_T; + + /** Define the iterators of the leg-date map. */ + typedef typename SecondChildrenBomHolder_T::MapConstIterator_T LegDateMapConstIterator_T; + typedef typename SecondChildrenBomHolder_T::MapConstReverseIterator_T LegDateMapConstReverseIterator_T; + typedef typename SecondChildrenBomHolder_T::MapIterator_T LegDateMapIterator_T; + typedef typename SecondChildrenBomHolder_T::MapReverseIterator_T LegDateMapReverseIterator_T; + public: // /////////// Getters ///////////// @@ -165,7 +190,235 @@ assert (_secondChildrenList != NULL); _secondChildrenList->describeFull (ioOut); } + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal const iterator on segment date: + return the const iterator at the begining of the list. */ + SegmentDateListConstIterator_T segmentDateListConstIteratorBegin () const { + assert (_childrenList != NULL); + return _childrenList->listConstIteratorBegin (); + } + /** Initialise the internal const iterator on segment date: + return the const iterator at the end of the list. */ + SegmentDateListConstIterator_T segmentDateListConstIteratorEnd () const { + assert (_childrenList != NULL); + return _childrenList->listConstIteratorEnd (); + } + + /** Initialise the internal const reverse iterator on segment date: + return the const reverse iterator at the rbegining of the list. */ + SegmentDateListConstReverseIterator_T segmentDateListConstIteratorRBegin () const { + assert (_childrenList != NULL); + return _childrenList->listConstIteratorRBegin (); + } + + /** Initialise the internal const reverse iterator on segment date: + return the const reverse iterator at the rend of the list. */ + SegmentDateListConstReverseIterator_T segmentDateListConstIteratorREnd () const { + assert (_childrenList != NULL); + return _childrenList->listConstIteratorREnd (); + } + + /** Initialise the internal iterator on segment date: + return the iterator at the begining of the list. */ + SegmentDateListIterator_T segmentDateListIteratorBegin () const { + assert (_childrenList != NULL); + return _childrenList->listIteratorBegin (); + } + + /** Initialise the internal iterator on segment date: + return the iterator at the end of the list. */ + SegmentDateListIterator_T segmentDateListIteratorEnd () const { + assert (_childrenList != NULL); + return _childrenList->listIteratorEnd (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rbegining of the list. */ + SegmentDateListReverseIterator_T segmentDateListIteratorRBegin () const { + assert (_childrenList != NULL); + return _childrenList->listIteratorRBegin (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rend of the list. */ + SegmentDateListReverseIterator_T segmentDateListIteratorREnd () const { + assert (_childrenList != NULL); + return _childrenList->listIteratorREnd (); + } + + /** Initialise the internal const iteratorson segment date: + return the const iterator at the begining of the map. */ + SegmentDateMapConstIterator_T segmentDateMapConstIteratorBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapConstIteratorBegin (); + } + + /** Initialise the internal const iterator on segment date: + return the const iterator at the end of the map. */ + SegmentDateMapConstIterator_T segmentDateMapConstIteratorEnd () const { + assert (_childrenList != NULL); + return _childrenList->mapConstIteratorEnd (); + } + + /** Initialise the internal const reverse iterator on segment date: + return the const reverse iterator at the rbegining of the map. */ + SegmentDateMapConstReverseIterator_T segmentDateMapConstIteratorRBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapConstIteratorRBegin (); + } + + /** Initialise the internal const reverse iterator on segment date: + return the const reverse iterator at the rend of the map. */ + SegmentDateMapConstReverseIterator_T segmentDateMapConstIteratorREnd () const { + assert (_childrenList != NULL); + return _childrenList->mapConstIteratorREnd (); + } + + /** Initialise the internal iterator on segment date: + return the iterator at the begining of the map. */ + SegmentDateMapIterator_T segmentDateMapIteratorBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapIteratorBegin (); + } + + /** Initialise the internal iterator on segment date: + return the iterator at the end of the map. */ + SegmentDateMapIterator_T segmentDateMapIteratorEnd () const { + assert (_childrenList != NULL); + return _childrenList->mapIteratorEnd (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rbegining of the map. */ + SegmentDateMapReverseIterator_T segmentDateMapIteratorRBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapIteratorRBegin (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rend of the map. */ + SegmentDateMapReverseIterator_T segmentDateMapIteratorREnd () const { + assert (_childrenList != NULL); + return _childrenList->mapIteratorREnd (); + } + + + /** Initialise the internal const iterator on leg date: + return the const iterator at the begining of the list. */ + LegDateListConstIterator_T legDateListConstIteratorBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listConstIteratorBegin (); + } + + /** Initialise the internal const iterator on leg date: + return the const iterator at the end of the list. */ + LegDateListConstIterator_T legDateListConstIteratorEnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listConstIteratorEnd (); + } + + /** Initialise the internal const reverse iterator on leg date: + return the const reverse iterator at the rbegining of the list. */ + LegDateListConstReverseIterator_T legDateListConstIteratorRBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listConstIteratorRBegin (); + } + + /** Initialise the internal const reverse iterator on leg date: + return the const reverse iterator at the rend of the list. */ + LegDateListConstReverseIterator_T legDateListConstIteratorREnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listConstIteratorREnd (); + } + + /** Initialise the internal iterator on leg date: + return the iterator at the begining of the list. */ + LegDateListIterator_T legDateListIteratorBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listIteratorBegin (); + } + + /** Initialise the internal iterator on leg date: + return the iterator at the end of the list. */ + LegDateListIterator_T legDateListIteratorEnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listIteratorEnd (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rbegining of the list. */ + LegDateListReverseIterator_T legDateListIteratorRBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listIteratorRBegin (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rend of the list. */ + LegDateListReverseIterator_T legDateListIteratorREnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listIteratorREnd (); + } + + /** Initialise the internal const iteratorson leg date: + return the const iterator at the begining of the map. */ + LegDateMapConstIterator_T legDateMapConstIteratorBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapConstIteratorBegin (); + } + + /** Initialise the internal const iterator on leg date: + return the const iterator at the end of the map. */ + LegDateMapConstIterator_T legDateMapConstIteratorEnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapConstIteratorEnd (); + } + + /** Initialise the internal const reverse iterator on leg date: + return the const reverse iterator at the rbegining of the map. */ + LegDateMapConstReverseIterator_T legDateMapConstIteratorRBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapConstIteratorRBegin (); + } + + /** Initialise the internal const reverse iterator on leg date: + return the const reverse iterator at the rend of the map. */ + LegDateMapConstReverseIterator_T legDateMapConstIteratorREnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapConstIteratorREnd (); + } + + /** Initialise the internal iterator on leg date: + return the iterator at the begining of the map. */ + LegDateMapIterator_T legDateMapIteratorBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapIteratorBegin (); + } + + /** Initialise the internal iterator on leg date: + return the iterator at the end of the map. */ + LegDateMapIterator_T legDateMapIteratorEnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapIteratorEnd (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rbegining of the map. */ + LegDateMapReverseIterator_T legDateMapIteratorRBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapIteratorRBegin (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rend of the map. */ + LegDateMapReverseIterator_T legDateMapIteratorREnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapIteratorREnd (); + } + + private: /** Constructors are private so as to force the usage of the Factory layer. */ Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2009-10-05 08:42:37 UTC (rev 26) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-06 09:01:12 UTC (rev 27) @@ -150,6 +150,7 @@ _childrenList->describeFull (ioOut); } + public: // /////////// Iteration methods ////////// /** Initialise the internal const iterator on flight date: return the const iterator at the begining of the list. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-05 08:42:44
|
Revision: 26 http://stdair.svn.sourceforge.net/stdair/?rev=26&view=rev Author: quannaus Date: 2009-10-05 08:42:37 +0000 (Mon, 05 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomIterator.hpp Modified: trunk/stdair/stdair/bom/BomIterator.hpp =================================================================== --- trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-05 08:40:55 UTC (rev 25) +++ trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-05 08:42:37 UTC (rev 26) @@ -211,7 +211,7 @@ typedef typename BOM_CONTENT::BomStructure_T BomStructure_T; // Define the pair of string and pointer of BOM_CONTENT. - typedef typename std::pair<std::string, const BOM_CONTENT*> value_type; + typedef typename std::pair<std::string, BOM_CONTENT*> value_type; // Definition allowing the retrieve the difference type of the ITERATOR. typedef typename ITERATOR::difference_type difference_type; @@ -249,7 +249,7 @@ // ////////////// Dereferencing Operators ////////////// /** Dereferencing operator for iterators on a list. */ - const BOM_CONTENT& operator* () { + BOM_CONTENT& operator* () { const BomStructure_T* lBomStruct_ptr = *Parent_T::_itBomStructureObject; assert (lBomStruct_ptr != NULL); BOM_CONTENT* lBomContent_ptr = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-05 08:41:03
|
Revision: 25 http://stdair.svn.sourceforge.net/stdair/?rev=25&view=rev Author: quannaus Date: 2009-10-05 08:40:55 +0000 (Mon, 05 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-05 08:33:21 UTC (rev 24) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-05 08:40:55 UTC (rev 25) @@ -112,7 +112,7 @@ /** Initialise the internal iterators on bom objects: return the iterator at the begining of the list. */ ListIterator_T listIteratorBegin () { - return _bomChildrenOrderedList.begin(); + return ListIterator_T(_bomChildrenOrderedList.begin()); } /** Initialise the internal iterators on bom objects: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-05 08:33:27
|
Revision: 24 http://stdair.svn.sourceforge.net/stdair/?rev=24&view=rev Author: quannaus Date: 2009-10-05 08:33:21 +0000 (Mon, 05 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp trunk/stdair/stdair/bom/BomIterator.hpp Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-05 08:16:51 UTC (rev 23) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-05 08:33:21 UTC (rev 24) @@ -36,17 +36,17 @@ typedef BomConstIterator_T<BOM_CONTENT_CHILD, typename BomChildrenOrderedList_T::const_reverse_iterator> ListConstReverseIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenOrderedList_T::iterator> ListIterator_T; + typename BomChildrenOrderedList_T::const_iterator> ListIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenOrderedList_T::reverse_iterator> ListReverseIterator_T; + typename BomChildrenOrderedList_T::const_reverse_iterator> ListReverseIterator_T; typedef BomConstIterator_T<BOM_CONTENT_CHILD, typename BomChildrenList_T::const_iterator> MapConstIterator_T; typedef BomConstIterator_T<BOM_CONTENT_CHILD, typename BomChildrenList_T::const_reverse_iterator> MapConstReverseIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenList_T::iterator> MapIterator_T; + typename BomChildrenList_T::const_iterator> MapIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenList_T::reverse_iterator> MapReverseIterator_T; + typename BomChildrenList_T::const_reverse_iterator> MapReverseIterator_T; public: // /////////// Display support methods ///////// Modified: trunk/stdair/stdair/bom/BomIterator.hpp =================================================================== --- trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-05 08:16:51 UTC (rev 23) +++ trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-05 08:33:21 UTC (rev 24) @@ -211,7 +211,7 @@ typedef typename BOM_CONTENT::BomStructure_T BomStructure_T; // Define the pair of string and pointer of BOM_CONTENT. - typedef typename std::pair<std::string, BOM_CONTENT*> value_type; + typedef typename std::pair<std::string, const BOM_CONTENT*> value_type; // Definition allowing the retrieve the difference type of the ITERATOR. typedef typename ITERATOR::difference_type difference_type; @@ -249,7 +249,7 @@ // ////////////// Dereferencing Operators ////////////// /** Dereferencing operator for iterators on a list. */ - BOM_CONTENT& operator* () { + const BOM_CONTENT& operator* () { const BomStructure_T* lBomStruct_ptr = *Parent_T::_itBomStructureObject; assert (lBomStruct_ptr != NULL); BOM_CONTENT* lBomContent_ptr = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-05 08:16:58
|
Revision: 23 http://stdair.svn.sourceforge.net/stdair/?rev=23&view=rev Author: quannaus Date: 2009-10-05 08:16:51 +0000 (Mon, 05 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-05 08:15:29 UTC (rev 22) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-05 08:16:51 UTC (rev 23) @@ -38,15 +38,15 @@ typedef BomIterator_T<BOM_CONTENT_CHILD, typename BomChildrenOrderedList_T::iterator> ListIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenOrderedList_T::const_reverse_iterator> ListReverseIterator_T; + typename BomChildrenOrderedList_T::reverse_iterator> ListReverseIterator_T; typedef BomConstIterator_T<BOM_CONTENT_CHILD, typename BomChildrenList_T::const_iterator> MapConstIterator_T; typedef BomConstIterator_T<BOM_CONTENT_CHILD, typename BomChildrenList_T::const_reverse_iterator> MapConstReverseIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenList_T::const_iterator> MapIterator_T; + typename BomChildrenList_T::iterator> MapIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenList_T::const_reverse_iterator> MapReverseIterator_T; + typename BomChildrenList_T::reverse_iterator> MapReverseIterator_T; public: // /////////// Display support methods ///////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-05 08:15:40
|
Revision: 22 http://stdair.svn.sourceforge.net/stdair/?rev=22&view=rev Author: quannaus Date: 2009-10-05 08:15:29 +0000 (Mon, 05 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-05 08:07:44 UTC (rev 21) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-05 08:15:29 UTC (rev 22) @@ -36,7 +36,7 @@ typedef BomConstIterator_T<BOM_CONTENT_CHILD, typename BomChildrenOrderedList_T::const_reverse_iterator> ListConstReverseIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenOrderedList_T::const_iterator> ListIterator_T; + typename BomChildrenOrderedList_T::iterator> ListIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, typename BomChildrenOrderedList_T::const_reverse_iterator> ListReverseIterator_T; typedef BomConstIterator_T<BOM_CONTENT_CHILD, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-10-05 08:07:50
|
Revision: 21 http://stdair.svn.sourceforge.net/stdair/?rev=21&view=rev Author: quannaus Date: 2009-10-05 08:07:44 +0000 (Mon, 05 Oct 2009) Log Message: ----------- [Dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp trunk/stdair/stdair/bom/BomIterator.hpp Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-04 10:33:47 UTC (rev 20) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-05 08:07:44 UTC (rev 21) @@ -36,17 +36,17 @@ typedef BomConstIterator_T<BOM_CONTENT_CHILD, typename BomChildrenOrderedList_T::const_reverse_iterator> ListConstReverseIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenOrderedList_T::iterator> ListIterator_T; + typename BomChildrenOrderedList_T::const_iterator> ListIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenOrderedList_T::reverse_iterator> ListReverseIterator_T; + typename BomChildrenOrderedList_T::const_reverse_iterator> ListReverseIterator_T; typedef BomConstIterator_T<BOM_CONTENT_CHILD, typename BomChildrenList_T::const_iterator> MapConstIterator_T; typedef BomConstIterator_T<BOM_CONTENT_CHILD, typename BomChildrenList_T::const_reverse_iterator> MapConstReverseIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenList_T::iterator> MapIterator_T; + typename BomChildrenList_T::const_iterator> MapIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenList_T::reverse_iterator> MapReverseIterator_T; + typename BomChildrenList_T::const_reverse_iterator> MapReverseIterator_T; public: // /////////// Display support methods ///////// @@ -112,11 +112,7 @@ /** Initialise the internal iterators on bom objects: return the iterator at the begining of the list. */ ListIterator_T listIteratorBegin () { - typename BomChildrenOrderedList_T::iterator it = - _bomChildrenOrderedList.begin(); - typename BomChildrenOrderedList_T::const_iterator it2 = - _bomChildrenOrderedList.begin(); - return ListIterator_T (it); + return _bomChildrenOrderedList.begin(); } /** Initialise the internal iterators on bom objects: Modified: trunk/stdair/stdair/bom/BomIterator.hpp =================================================================== --- trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-04 10:33:47 UTC (rev 20) +++ trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-05 08:07:44 UTC (rev 21) @@ -144,7 +144,7 @@ // ////////////// Dereferencing Operators ////////////// /** Dereferencing operator for iterators on a list. */ const BOM_CONTENT& operator* () { - BomStructure_T* lBomStruct_ptr = *Parent_T::_itBomStructureObject; + const BomStructure_T* lBomStruct_ptr = *Parent_T::_itBomStructureObject; assert (lBomStruct_ptr != NULL); BOM_CONTENT* lBomContent_ptr = BomStructure::getBomContentPtr<BOM_CONTENT> (*lBomStruct_ptr); @@ -155,7 +155,8 @@ /** Dereferencing operator for iterators on a map. */ value_type* operator-> () { const MapKey_T& lKey = Parent_T::_itBomStructureObject->first; - BomStructure_T* lBomStruct_ptr = Parent_T::_itBomStructureObject->second; + const BomStructure_T* lBomStruct_ptr = + Parent_T::_itBomStructureObject->second; assert (lBomStruct_ptr != NULL); BOM_CONTENT* lBomContent_ptr = BomStructure::getBomContentPtr<BOM_CONTENT> (*lBomStruct_ptr); @@ -249,7 +250,7 @@ // ////////////// Dereferencing Operators ////////////// /** Dereferencing operator for iterators on a list. */ BOM_CONTENT& operator* () { - BomStructure_T* lBomStruct_ptr = *Parent_T::_itBomStructureObject; + const BomStructure_T* lBomStruct_ptr = *Parent_T::_itBomStructureObject; assert (lBomStruct_ptr != NULL); BOM_CONTENT* lBomContent_ptr = BomStructure::getBomContentPtr<BOM_CONTENT> (*lBomStruct_ptr); @@ -260,7 +261,8 @@ /** Dereferencing operator for iterators on a map. */ value_type* operator-> () { const MapKey_T& lKey = Parent_T::_itBomStructureObject->first; - BomStructure_T* lBomStruct_ptr = Parent_T::_itBomStructureObject->second; + const BomStructure_T* lBomStruct_ptr = + Parent_T::_itBomStructureObject->second; assert (lBomStruct_ptr != NULL); BOM_CONTENT* lBomContent_ptr = BomStructure::getBomContentPtr<BOM_CONTENT> (*lBomStruct_ptr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |