From: <den...@us...> - 2010-01-01 19:42:49
|
Revision: 81 http://stdair.svn.sourceforge.net/stdair/?rev=81&view=rev Author: denis_arnaud Date: 2010-01-01 19:02:08 +0000 (Fri, 01 Jan 2010) Log Message: ----------- [Struct] Added the BomManager, BookingRequestStruct and TravelSolutionStruct structures. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp trunk/stdair/stdair/bom/AirlineFeature.cpp trunk/stdair/stdair/bom/AirlineFeature.hpp trunk/stdair/stdair/bom/AirlineFeatureSet.cpp trunk/stdair/stdair/bom/AirlineFeatureSet.hpp trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp trunk/stdair/stdair/bom/BomContent.hpp trunk/stdair/stdair/bom/BomKey.hpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/BomStopStructure.hpp trunk/stdair/stdair/bom/BomStructure.hpp trunk/stdair/stdair/bom/StructAbstract.hpp trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/BomManager.hpp trunk/stdair/stdair/bom/BookingRequestStruct.hpp trunk/stdair/stdair/bom/TravelSolutionStruct.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -342,6 +342,12 @@ /** Define the total revenue of an unconstrained policy. */ typedef double PolicyRevenue_T; + + // ///////////// Technical //////////////// + /** File or directory name. + <br>It may contain paths, relative or absolute (e.g., /foo/bar + or C:\foo\bar). */ + typedef std::string Filename_T; } #endif // __STDAIR_STDAIR_TYPES_HPP Modified: trunk/stdair/stdair/bom/AirlineFeature.cpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-01-01 19:02:08 UTC (rev 81) @@ -1,8 +1,11 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> +// STL +#include <cassert> +#include <istream> +#include <ostream> +#include <sstream> // STDAIR #include <stdair/bom/AirlineFeatureStructure.hpp> #include <stdair/bom/AirlineFeature.hpp> Modified: trunk/stdair/stdair/bom/AirlineFeature.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,6 +4,9 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +#include <string> // STDAIR #include <stdair/bom/AirlineFeatureSet.hpp> #include <stdair/bom/AirlineFeatureStructure.hpp> @@ -12,17 +15,20 @@ #include <stdair/bom/AirlineFeatureTypes.hpp> namespace stdair { + // Forward declarations class FacBomContent; struct AirlineFeatureKey_T; + /** Class representing the actual functional/business content for a segment-cabin. */ class AirlineFeature : public AirlineFeatureContent { friend class FacBomContent; + public: - // Type definitions + // //////////// Type definitions ////////////// /** Definition allowing to retrieve the associated parent BOM content type. */ typedef AirlineFeatureSet Parent_T; @@ -36,15 +42,17 @@ /** Definition allowing to retrieve the associated BOM content child type. */ typedef AirlineFeature ContentChild_T; + public: - // //////////// Setters ////////// - /** Intialization method. */ + // //////////// Setters ///////////// + /** Intialisation method. */ void init (const ForecasterMode_T&, const HistoricalDataLimit_T&, const OptimizerStruct_T&, const ControlMode_T&); + public: - // /////////// Display support methods ///////// + // /////////// Display support methods ///////////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ void toStream (std::ostream& ioOut) const; @@ -67,13 +75,16 @@ /** Give a description of the structure (for display purposes). */ const std::string describe() const; + private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { return _airlineFeatureStructure; } + protected: + // ///////////////// Constructors and destructors ///////////////// /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ @@ -84,8 +95,9 @@ /** Destructor. */ virtual ~AirlineFeature(); + protected: - // Attributes + // ////////////////////// Attributes /////////////////////////// /** Reference structure. */ BomStructure_T& _airlineFeatureStructure; }; Modified: trunk/stdair/stdair/bom/AirlineFeatureSet.cpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSet.cpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/AirlineFeatureSet.cpp 2010-01-01 19:02:08 UTC (rev 81) @@ -3,6 +3,9 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> +#include <istream> +#include <ostream> +#include <sstream> // STDAIR #include <stdair/bom/AirlineFeatureSetStructure.hpp> #include <stdair/bom/AirlineFeatureSet.hpp> @@ -25,6 +28,30 @@ } // ////////////////////////////////////////////////////////////////////// + void AirlineFeatureSet::toStream (std::ostream& ioOut) const { + ioOut << toString(); + } + + // ////////////////////////////////////////////////////////////////////// + void AirlineFeatureSet::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string AirlineFeatureSet::toString() const { + return describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string AirlineFeatureSet::describeKey() const { + return std::string (""); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string AirlineFeatureSet::describeShortKey() const { + return std::string (""); + } + + // ////////////////////////////////////////////////////////////////////// const std::string AirlineFeatureSet::display() const { // Store current formatting flags of std::cout std::ios::fmtflags oldFlags = std::cout.flags(); Modified: trunk/stdair/stdair/bom/AirlineFeatureSet.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSet.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/AirlineFeatureSet.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,6 +4,9 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +#include <string> // STDAIR #include <stdair/bom/AirlineFeatureSetStructure.hpp> #include <stdair/bom/AirlineFeatureSetContent.hpp> @@ -11,16 +14,19 @@ #include <stdair/bom/AirlineFeatureTypes.hpp> namespace stdair { + // Forward declarations. class FacBomContent; class AirlineFeature; struct AirlineFeatureKey_T; struct AirlineFeatureSetKey_T; + /** Class representing the actual functional/business content for the Bom root. */ class AirlineFeatureSet : public AirlineFeatureSetContent { friend class FacBomContent; + public: // ///////////////////////////////////////////////////////////////////////// @@ -35,29 +41,31 @@ typedef AirlineFeature ContentChild_T; // ///////////////////////////////////////////////////////////////////////// + public: - // /////////// Display support methods ///////// + // /////////// Display support methods ///////////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ - void toStream (std::ostream& ioOut) const { ioOut << toString(); } + void toStream (std::ostream& ioOut) const; /** Read a Business Object from an input stream. @param istream& the input stream. */ - void fromStream (std::istream& ioIn) { } + void fromStream (std::istream& ioIn); - /** Get the serialised version of the Business Object. */ - std::string toString() const { return describeKey(); } + /** 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 { return std::string (""); } + const std::string describeKey() const; /** Get a string describing the short key (differentiating two objects at the same level). */ - const std::string describeShortKey() const { return std::string (""); } + const std::string describeShortKey() const; /** Display the full context of the set of airline features. */ const std::string display() const; + public: // /////////// Getters ///////////// @@ -72,13 +80,16 @@ /** Get a AirlineFeatureMap_T for iteration methods. */ AirlineFeatureMap_T getAirlineFeatureMap () const; + private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { return _bomStructure; } - + + protected: + // ///////////////// Constructors and destructors ///////////////// /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ @@ -88,8 +99,9 @@ /** Destructor. */ virtual ~AirlineFeatureSet(); + private: - // Attributes + // ////////////////////// Attributes /////////////////////////// /** Reference structure. */ BomStructure_T& _bomStructure; }; Modified: trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,6 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> // MPL #include <boost/mpl/vector.hpp> // STDAIR @@ -105,7 +107,6 @@ /** The actual functional (Business Object) content. */ BOM_CONTENT* _content; - }; } Modified: trunk/stdair/stdair/bom/BomContent.hpp =================================================================== --- trunk/stdair/stdair/bom/BomContent.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/BomContent.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -5,9 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STL -#include <istream> -#include <ostream> -#include <sstream> +#include <iosfwd> #include <string> namespace stdair { Modified: trunk/stdair/stdair/bom/BomKey.hpp =================================================================== --- trunk/stdair/stdair/bom/BomKey.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/BomKey.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -5,9 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STL -#include <istream> -#include <ostream> -#include <sstream> +#include <iosfwd> #include <string> namespace stdair { Added: trunk/stdair/stdair/bom/BomManager.cpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.cpp (rev 0) +++ trunk/stdair/stdair/bom/BomManager.cpp 2010-01-01 19:02:08 UTC (rev 81) @@ -0,0 +1,88 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +#include <ostream> +// STDAIR +#include <stdair/bom/BomRoot.hpp> +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/FlightDate.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> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> +#include <stdair/bom/AirlineFeatureSet.hpp> +#include <stdair/bom/AirlineFeature.hpp> +#include <stdair/bom/BomManager.hpp> + +namespace stdair { + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, const BomRoot& iBomRoot) { + + // Browse the Inventory objects + const InventoryList_T lInventoryList= iBomRoot.getInventoryList (); + for (InventoryList_T::iterator itInv = lInventoryList.begin(); + itInv != lInventoryList.end(); ++itInv) { + const Inventory& lCurrentInventory = *itInv; + oStream << "Inventory: " << lCurrentInventory.toString(); + + // Browse the FlightDate objects + const FlightDateList_T lFDList = + lCurrentInventory.getFlightDateList (); + for (FlightDateList_T::iterator itFD = lFDList.begin(); + itFD != lFDList.end(); ++itFD) { + const FlightDate& lCurrentFD = *itFD; + oStream << "Flight-date: " << lCurrentFD.toString(); + + // Browse the LegDate objects + const LegDateList_T lLDList = lCurrentFD.getLegDateList(); + for (LegDateList_T::iterator itLD = lLDList.begin(); + itLD != lLDList.end(); ++itLD) { + const LegDate& lCurrentLD = *itLD; + oStream << "Leg-date: " << lCurrentLD.toString(); + + // Browse the LegCabin objects + const LegCabinList_T lLCList = lCurrentLD.getLegCabinList(); + for (LegCabinList_T::iterator itLC = lLCList.begin(); + itLC != lLCList.end(); ++itLC) { + const LegCabin& lCurrentLC = *itLC; + oStream << "Leg-cabin: " << lCurrentLC.toString(); + } + } + + // Browse the SegmentDate objects + const SegmentDateList_T lSDList = + lCurrentFD.getSegmentDateList(); + for (SegmentDateList_T::iterator itSD = lSDList.begin(); + itSD != lSDList.end(); ++itSD) { + const SegmentDate& lCurrentSD = *itSD; + oStream << "Segment-date: " << lCurrentSD.toString(); + + // Browse the SegmentCabin objects + const SegmentCabinList_T lSCList = + lCurrentSD.getSegmentCabinList(); + for (SegmentCabinList_T::iterator itSC = lSCList.begin(); + itSC != lSCList.end(); ++itSC) { + const SegmentCabin& lCurrentSC = *itSC; + oStream << "Segment-cabin: " << lCurrentSC.toString(); + + // Browse the BookingClass objects + const BookingClassList_T lBCList = + lCurrentSC.getBookingClassList (); + for (BookingClassList_T::iterator itBC = lBCList.begin(); + itBC != lBCList.end(); ++itBC) { + const BookingClass& lCurrentBC = *itBC; + oStream << "Booking class: " << lCurrentBC.toString(); + } + } + } + } + } + } + +} Added: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp (rev 0) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -0,0 +1,28 @@ +#ifndef __STDAIR_BOM_BOMMANAGER_HPP +#define __STDAIR_BOM_BOMMANAGER_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> + +namespace stdair { + + // Forward declarations + class BomRoot; + + + /** Utility class for StdAir objects. */ + class BomManager { + public: + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const BomRoot& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const BomRoot&); + }; + +} +#endif // __STDAIR_BOM_BOMMANAGER_HPP Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,6 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> // STDAIR #include <stdair/bom/BomRootStructure.hpp> #include <stdair/bom/BomRootContent.hpp> Modified: trunk/stdair/stdair/bom/BomStopStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/BomStopStructure.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/BomStopStructure.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,6 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <iostream> // STDAIR #include <stdair/bom/BomStructure.hpp> #include <stdair/bom/BomKey.hpp> Modified: trunk/stdair/stdair/bom/BomStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/BomStructure.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/BomStructure.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,12 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> // STL -#include <istream> -#include <ostream> -#include <sstream> +#include <iosfwd> #include <string> namespace stdair { Added: trunk/stdair/stdair/bom/BookingRequestStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingRequestStruct.hpp (rev 0) +++ trunk/stdair/stdair/bom/BookingRequestStruct.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -0,0 +1,42 @@ +#ifndef __STDAIR_BOM_BOOKINGREQUESTSTRUCT_HPP +#define __STDAIR_BOM_BOOKINGREQUESTSTRUCT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +#include <string> +// StdAir +#include <stdair/bom/StructAbstract.hpp> + +namespace stdair { + + /** Structure holding the elements of a booking request. */ + struct BookingRequestStruct : public StructAbstract { + public: + + // /////////// Display support method ///////////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { + ioOut << describe(); + } + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn) { + } + + /** Display of the structure. */ + const std::string describe() const { + return ""; + } + + + private: + + }; + +} +#endif // __STDAIR_BOM_BOOKINGREQUESTSTRUCT_HPP Modified: trunk/stdair/stdair/bom/StructAbstract.hpp =================================================================== --- trunk/stdair/stdair/bom/StructAbstract.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/StructAbstract.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -5,8 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STL -#include <iostream> -#include <sstream> +#include <iosfwd> namespace stdair { Added: trunk/stdair/stdair/bom/TravelSolutionStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.hpp (rev 0) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -0,0 +1,42 @@ +#ifndef __STDAIR_BOM_TRAVELSOLUTIONSTRUCT_HPP +#define __STDAIR_BOM_TRAVELSOLUTIONSTRUCT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +#include <string> +// StdAir +#include <stdair/bom/StructAbstract.hpp> + +namespace stdair { + + /** Structure holding the elements of a travel solution. */ + struct TravelSolutionStruct : public StructAbstract { + public: + + // /////////// Display support method ///////////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { + ioOut << describe(); + } + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn) { + } + + /** Display of the structure. */ + const std::string describe() const { + return ""; + } + + + private: + + }; + +} +#endif // __STDAIR_BOM_TRAVELSOLUTIONSTRUCT_HPP Modified: trunk/stdair/stdair/bom/sources.mk =================================================================== --- trunk/stdair/stdair/bom/sources.mk 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/sources.mk 2010-01-01 19:02:08 UTC (rev 81) @@ -61,7 +61,10 @@ $(top_srcdir)/stdair/bom/BomChildrenHolderImp.hpp \ $(top_srcdir)/stdair/bom/BomIterator.hpp \ $(top_srcdir)/stdair/bom/OptimizerStruct.hpp \ - $(top_srcdir)/stdair/bom/DoWStruct.hpp + $(top_srcdir)/stdair/bom/DoWStruct.hpp \ + $(top_srcdir)/stdair/bom/TravelSolutionStruct.hpp \ + $(top_srcdir)/stdair/bom/BookingRequestStruct.hpp \ + $(top_srcdir)/stdair/bom/BomManager.hpp bom_cc_sources = \ $(top_srcdir)/stdair/bom/BomRootKey.cpp \ $(top_srcdir)/stdair/bom/InventoryKey.cpp \ @@ -94,5 +97,6 @@ $(top_srcdir)/stdair/bom/AirlineFeature.cpp \ $(top_srcdir)/stdair/bom/AirlineFeatureContent.cpp \ $(top_srcdir)/stdair/bom/OptimizerStruct.cpp \ - $(top_srcdir)/stdair/bom/DoWStruct.cpp + $(top_srcdir)/stdair/bom/DoWStruct.cpp \ + $(top_srcdir)/stdair/bom/BomManager.cpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |