StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TravelSolutionStruct.hpp
Go to the documentation of this file.
00001 #ifndef __STDAIR_BOM_TRAVELSOLUTIONSTRUCT_HPP
00002 #define __STDAIR_BOM_TRAVELSOLUTIONSTRUCT_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <iosfwd>
00009 #include <string>
00010 #include <vector>
00011 // StdAir
00012 #include <stdair/stdair_basic_types.hpp>
00013 #include <stdair/basic/StructAbstract.hpp>
00014 #include <stdair/bom/BookingClassTypes.hpp>
00015 #include <stdair/bom/FareOptionStruct.hpp>
00016 #include <stdair/bom/FareOptionTypes.hpp>
00017 #include <stdair/bom/TravelSolutionTypes.hpp>
00018 
00019 namespace stdair {
00020 
00024   struct TravelSolutionStruct : public StructAbstract {
00025   public:
00026     // /////////// Getters ///////////////
00028     const SegmentPath_T& getSegmentPath() const {
00029       return _segmentPath;
00030     }
00031 
00033     const ClassAvailabilityMapHolder_T& getClassAvailabilityMapHolder() const {
00034       return _classAvailabilityMapHolder;
00035     }
00036 
00038     const ClassYieldMapHolder_T& getClassYieldMapHolder() const {
00039       return _classYieldMapHolder;
00040     }
00041 
00043     const BidPriceVectorHolder_T& getBidPriceVectorHolder() const {
00044       return _bidPriceVectorHolder;
00045     }
00046     
00048     const ClassBpvMapHolder_T& getClassBpvMapHolder() const {
00049       return _classBpvMapHolder;
00050     }
00051 
00053     const FareOptionList_T& getFareOptionList() const {
00054       return _fareOptionList;
00055     }
00056 
00058     FareOptionList_T& getFareOptionListRef() {
00059       return _fareOptionList;
00060     }
00061 
00063     const FareOptionStruct& getChosenFareOption() const {
00064       assert (_chosenFareOption != NULL);
00065       return *_chosenFareOption;
00066     }
00067     
00068   public:
00069     // /////////// Setters ///////////////
00071     void addSegment (const std::string&);
00072 
00074     void addClassAvailabilityMap (const ClassAvailabilityMap_T&);
00075 
00077     void addClassYieldMap (const ClassYieldMap_T&);
00078 
00080     void addBidPriceVector (const BidPriceVector_T&);
00081 
00083     void addClassBpvMap (const ClassBpvMap_T&);
00084 
00086     void addFareOption (const FareOptionStruct&);
00087 
00089     void setChosenFareOption (const FareOptionStruct& iChosenFO) {
00090       _chosenFareOption = &iChosenFO;
00091     }
00092 
00093 
00094   public:
00095     // /////////// Display support method /////////////
00101     void toStream (std::ostream& ioOut) const;
00102 
00107     void fromStream (std::istream& ioIn);
00108 
00112     const std::string describe() const;
00113   
00117     const std::string display() const;
00118   
00119 
00120   public:
00121     // //////////// Constructors & Destructor ///////////////
00125     TravelSolutionStruct();
00126 
00130     ~TravelSolutionStruct();
00131     
00132 
00133   private:
00134     // ///////////////////// Attributes //////////////////////
00138     SegmentPath_T _segmentPath;
00139 
00143     ClassAvailabilityMapHolder_T _classAvailabilityMapHolder;
00144     
00148     ClassYieldMapHolder_T _classYieldMapHolder;
00149     
00153     BidPriceVectorHolder_T _bidPriceVectorHolder;
00154     
00158     ClassBpvMapHolder_T _classBpvMapHolder;
00159 
00163     FareOptionList_T _fareOptionList;
00164 
00168     const FareOptionStruct* _chosenFareOption;
00169   };
00170 
00171 }
00172 #endif // __STDAIR_BOM_TRAVELSOLUTIONSTRUCT_HPP