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 friend class FacBomManager; 00021 00022 public: 00023 // //////////// Type definitions ////////////// 00027 typedef FareFeaturesKey Key_T; 00028 00029 public: 00030 // /////////// Display support methods ///////// 00036 void toStream (std::ostream& ioOut) const { 00037 ioOut << toString(); 00038 } 00039 00045 void fromStream (std::istream& ioIn) { 00046 } 00047 00051 std::string toString() const; 00052 00056 const std::string describeKey() const { 00057 return _key.toString(); 00058 } 00059 00060 00061 public: 00062 // ////////// Getters //////////// 00066 const Key_T& getKey() const { 00067 return _key; 00068 } 00069 00073 BomAbstract* const getParent() const { 00074 return _parent; 00075 } 00076 00080 const HolderMap_T& getHolderMap() const { 00081 return _holderMap; 00082 } 00083 00087 const TripType_T& getTripType() const { 00088 return _key.getTripType(); 00089 } 00090 00094 const DayDuration_T& getAdvancePurchase() const { 00095 return _key.getAdvancePurchase(); 00096 } 00097 00101 const SaturdayStay_T& getSaturdayStay() const { 00102 return _key.getSaturdayStay(); 00103 } 00104 00108 const ChangeFees_T& getChangeFees() const { 00109 return _key.getChangeFees(); 00110 } 00111 00115 const NonRefundable_T& getRefundableOption() const { 00116 return _key.getRefundableOption(); 00117 } 00118 00122 const DayDuration_T& getMinimumStay() const { 00123 return _key.getMinimumStay(); 00124 } 00125 00126 00127 public: 00128 // ////////////// Business methods /////////////// 00133 bool isTripTypeValid (const TripType_T&) const; 00134 00139 bool isStayDurationValid (const DayDuration_T&) const; 00140 00145 bool isAdvancePurchaseValid (const DateTime_T& iBookingRequestDateTime, 00146 const DateTime_T& iFlightDateTime) const; 00147 00148 00149 protected: 00150 // ////////// Constructors and destructors ///////// 00154 FareFeatures (const Key_T&); 00158 virtual ~FareFeatures (); 00159 00160 private: 00164 FareFeatures (); 00168 FareFeatures (const FareFeatures&); 00169 00170 protected: 00171 // ///////////// Attributes ///////////// 00175 Key_T _key; 00176 00180 BomAbstract* _parent; 00181 00185 HolderMap_T _holderMap; 00186 }; 00187 00188 } 00189 #endif // __STDAIR_BOM_FAREFEATURES_HPP 00190