$treeview $search $mathjax
StdAir Logo  1.00.1
$projectbrief
$projectbrief
$searchbox

stdair/bom/FareFeatures.hpp

Go to the documentation of this file.
00001 #ifndef __STDAIR_BOM_FAREFEATURES_HPP
00002 #define __STDAIR_BOM_FAREFEATURES_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // StdAir
00008 #include <stdair/bom/BomAbstract.hpp>
00009 #include <stdair/bom/FareFeaturesKey.hpp>
00010 #include <stdair/bom/FareFeaturesTypes.hpp>
00011 
00012 // Forward declaration
00013 namespace stdair {
00014 
00018   class FareFeatures : public BomAbstract {
00019     template <typename BOM> friend class FacBom; 
00020     template <typename BOM> friend class FacCloneBom;
00021     friend class FacBomManager;
00022 
00023   public:
00024     // //////////// Type definitions //////////////
00028     typedef FareFeaturesKey Key_T;
00029   
00030   public:
00031     // /////////// Display support methods /////////
00037     void toStream (std::ostream& ioOut) const {
00038       ioOut << toString();
00039     }
00040 
00046     void fromStream (std::istream& ioIn) {
00047     }
00048 
00052     std::string toString() const;
00053     
00057     const std::string describeKey() const {
00058       return _key.toString();
00059     }
00060 
00061 
00062   public:
00063     // ////////// Getters ////////////
00067     const Key_T& getKey() const {
00068       return _key;
00069     }
00070 
00074     BomAbstract* const getParent() const {
00075       return _parent;
00076     }
00077 
00081     const HolderMap_T& getHolderMap() const {
00082       return _holderMap;
00083     }
00084 
00088     const TripType_T& getTripType() const {
00089       return _key.getTripType();
00090     }
00091 
00095     const DayDuration_T& getAdvancePurchase() const {
00096       return _key.getAdvancePurchase();
00097     }
00098 
00102     const SaturdayStay_T& getSaturdayStay() const {
00103       return _key.getSaturdayStay();
00104     }   
00105 
00109     const ChangeFees_T& getChangeFees() const {
00110       return _key.getChangeFees();
00111     }
00112 
00116     const NonRefundable_T& getRefundableOption() const {
00117       return _key.getRefundableOption();
00118     }
00119 
00123     const DayDuration_T& getMinimumStay() const {
00124       return _key.getMinimumStay();
00125     }
00126 
00127 
00128   public:
00129     // ////////////// Business methods ///////////////
00134     bool isTripTypeValid (const TripType_T&) const;
00135     
00140     bool isStayDurationValid (const DayDuration_T&) const;
00141 
00146     bool isAdvancePurchaseValid (const DateTime_T& iBookingRequestDateTime,
00147                                  const DateTime_T& iFlightDateTime) const;
00148     
00149 
00150   protected:
00151     // ////////// Constructors and destructors /////////
00155     FareFeatures (const Key_T&);
00159     virtual ~FareFeatures ();
00160 
00161   private:
00165     FareFeatures ();
00169     FareFeatures (const FareFeatures&);
00170 
00171   protected:
00172     // ///////////// Attributes /////////////
00176     Key_T _key;
00177 
00181     BomAbstract* _parent;
00182 
00186     HolderMap_T _holderMap;
00187   };
00188 
00189 }
00190 #endif // __STDAIR_BOM_FAREFEATURES_HPP
00191