From: <qua...@us...> - 2010-05-03 14:57:14
|
Revision: 189 http://stdair.svn.sourceforge.net/stdair/?rev=189&view=rev Author: quannaus Date: 2010-05-03 14:57:07 +0000 (Mon, 03 May 2010) Log Message: ----------- [dev] added some getters. Modified Paths: -------------- trunk/stdair/stdair/bom/SegmentCabin.cpp trunk/stdair/stdair/bom/SegmentCabin.hpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentDate.hpp trunk/stdair/stdair/command/CmdBomManager.cpp trunk/stdair/stdair/command/CmdBomManager.hpp Modified: trunk/stdair/stdair/bom/SegmentCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-05-03 11:50:17 UTC (rev 188) +++ trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-05-03 14:57:07 UTC (rev 189) @@ -63,6 +63,12 @@ BookingClassMap_T SegmentCabin::getBookingClassMap () const { return _structure.getChildrenHolder<BookingClass>(); } + + // //////////////////////////////////////////////////////////////////// + BookingClass* SegmentCabin:: + getBookingClass (const ClassCode_T& iClassCode) const { + return _structure.getChildPtr<BookingClass> (iClassCode); + } } Modified: trunk/stdair/stdair/bom/SegmentCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-05-03 11:50:17 UTC (rev 188) +++ trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-05-03 14:57:07 UTC (rev 189) @@ -46,6 +46,11 @@ BookingClassList_T getBookingClassList () const; BookingClassMap_T getBookingClassMap () const; + /** Retrieve, if existing, the BookingClass corresponding to the + given class code. + <br>If not existing, return the NULL pointer. */ + BookingClass* getBookingClass (const ClassCode_T&) const; + public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. Modified: trunk/stdair/stdair/bom/SegmentDate.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.cpp 2010-05-03 11:50:17 UTC (rev 188) +++ trunk/stdair/stdair/bom/SegmentDate.cpp 2010-05-03 14:57:07 UTC (rev 189) @@ -105,6 +105,12 @@ const FlightNumber_T& SegmentDate::getFlightNumber () const { return _structure.getParent().getKey().getFlightNumber(); } + + // //////////////////////////////////////////////////////////////////// + SegmentCabin* SegmentDate:: + getSegmentCabin (const CabinCode_T& iCabinCode) const { + return _structure.getChildPtr<SegmentCabin> (iCabinCode); + } } Modified: trunk/stdair/stdair/bom/SegmentDate.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.hpp 2010-05-03 11:50:17 UTC (rev 188) +++ trunk/stdair/stdair/bom/SegmentDate.hpp 2010-05-03 14:57:07 UTC (rev 189) @@ -54,6 +54,11 @@ /** Get the airline code of the segment. */ const AirlineCode_T& getAirlineCode () const; + /** Retrieve, if existing, the SegmentCabin corresponding to the + given cabin code. + <br>If not existing, return the NULL pointer. */ + SegmentCabin* getSegmentCabin (const CabinCode_T&) const; + public: // /////////// Business Methods ////////////// /** States whether or not the given SegmentDate may connect with the Modified: trunk/stdair/stdair/command/CmdBomManager.cpp =================================================================== --- trunk/stdair/stdair/command/CmdBomManager.cpp 2010-05-03 11:50:17 UTC (rev 188) +++ trunk/stdair/stdair/command/CmdBomManager.cpp 2010-05-03 14:57:07 UTC (rev 189) @@ -129,14 +129,17 @@ } // //////////////////////////////////////////////////////////////////// - void CmdBomManager::createBookingClass (const SegmentCabin& iSegmentCabin, - const ClassCode_T& iClassCode) { + BookingClass& CmdBomManager:: + createBookingClass (const SegmentCabin& iSegmentCabin, + const ClassCode_T& iClassCode) { // Instantiate a booking class object with the given class code const BookingClassKey_T lClassKey (iClassCode); - BookingClass& lClass = + BookingClass& oClass = FacBomContent::instance().create<BookingClass> (lClassKey); // Link the created booking-class with its parent segment-cabin. - FacBomContent::linkWithParent (lClass, iSegmentCabin); + FacBomContent::linkWithParent (oClass, iSegmentCabin); + + return oClass; } // ////////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/command/CmdBomManager.hpp =================================================================== --- trunk/stdair/stdair/command/CmdBomManager.hpp 2010-05-03 11:50:17 UTC (rev 188) +++ trunk/stdair/stdair/command/CmdBomManager.hpp 2010-05-03 14:57:07 UTC (rev 189) @@ -16,9 +16,9 @@ class FlightDate; class SegmentDate; class SegmentCabin; + class BookingClass; class LegDate; class LegCabin; - class Bucket; class Network; class NetworkDate; class AirportDate; @@ -69,7 +69,8 @@ const CabinCode_T&); /** Create the booking class corresponding to the given class code. */ - static void createBookingClass (const SegmentCabin&, const ClassCode_T&); + static BookingClass& createBookingClass (const SegmentCabin&, + const ClassCode_T&); /** Create the inventory corresponding to the given network key, then link it to the BomRoot object. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |