StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
FareFeatures.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_FAREFEATURES_HPP
2 #define __STDAIR_BOM_FAREFEATURES_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // StdAir
11 
12 // Forward declaration
13 namespace stdair {
14 
18  class FareFeatures : public BomAbstract {
19  template <typename BOM> friend class FacBom;
20  template <typename BOM> friend class FacCloneBom;
21  friend class FacBomManager;
22 
23  public:
24  // //////////// Type definitions //////////////
29 
30  public:
31  // /////////// Display support methods /////////
37  void toStream (std::ostream& ioOut) const {
38  ioOut << toString();
39  }
40 
46  void fromStream (std::istream& ioIn) {
47  }
48 
52  std::string toString() const;
53 
57  const std::string describeKey() const {
58  return _key.toString();
59  }
60 
61 
62  public:
63  // ////////// Getters ////////////
67  const Key_T& getKey() const {
68  return _key;
69  }
70 
74  BomAbstract* const getParent() const {
75  return _parent;
76  }
77 
81  const HolderMap_T& getHolderMap() const {
82  return _holderMap;
83  }
84 
88  const TripType_T& getTripType() const {
89  return _key.getTripType();
90  }
91 
96  return _key.getAdvancePurchase();
97  }
98 
103  return _key.getSaturdayStay();
104  }
105 
109  const ChangeFees_T& getChangeFees() const {
110  return _key.getChangeFees();
111  }
112 
117  return _key.getRefundableOption();
118  }
119 
123  const DayDuration_T& getMinimumStay() const {
124  return _key.getMinimumStay();
125  }
126 
127 
128  public:
129  // ////////////// Business methods ///////////////
134  bool isTripTypeValid (const TripType_T&) const;
135 
140  bool isStayDurationValid (const DayDuration_T&) const;
141 
146  bool isAdvancePurchaseValid (const DateTime_T& iBookingRequestDateTime,
147  const DateTime_T& iFlightDateTime) const;
148 
149 
150  protected:
151  // ////////// Constructors and destructors /////////
155  FareFeatures (const Key_T&);
159  virtual ~FareFeatures ();
160 
161  private:
165  FareFeatures ();
169  FareFeatures (const FareFeatures&);
170 
171  protected:
172  // ///////////// Attributes /////////////
176  Key_T _key;
177 
182 
187  };
188 
189 }
190 #endif // __STDAIR_BOM_FAREFEATURES_HPP
191 
Class representing the actual attributes for a fare date-period.
const ChangeFees_T & getChangeFees() const
boost::posix_time::ptime DateTime_T
const std::string toString() const
const DayDuration_T & getAdvancePurchase() const
Utility class for linking StdAir-based objects.
std::string TripType_T
const Key_T & getKey() const
Handle on the StdAir library context.
bool isAdvancePurchaseValid(const DateTime_T &iBookingRequestDateTime, const DateTime_T &iFlightDateTime) const
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
Key of date-period.
std::string toString() const
void toStream(std::ostream &ioOut) const
const NonRefundable_T & getRefundableOption() const
const std::string describeKey() const
const DayDuration_T & getMinimumStay() const
const NonRefundable_T & getRefundableOption() const
const SaturdayStay_T & getSaturdayStay() const
Base class for Factory layer.
Definition: FacBom.hpp:22
const SaturdayStay_T & getSaturdayStay() const
const TripType_T & getTripType() const
const ChangeFees_T & getChangeFees() const
BomAbstract *const getParent() const
const TripType_T & getTripType() const
BomAbstract * _parent
bool isStayDurationValid(const DayDuration_T &) const
FareFeaturesKey Key_T
const HolderMap_T & getHolderMap() const
const DayDuration_T & getAdvancePurchase() const
void fromStream(std::istream &ioIn)
const DayDuration_T & getMinimumStay() const
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
bool isTripTypeValid(const TripType_T &) const