00001 #ifndef __STDAIR_BOM_SEGMENTDATE_HPP 00002 #define __STDAIR_BOM_SEGMENTDATE_HPP 00003 00004 // ////////////////////////////////////////////////////////////////////// 00005 // Import section 00006 // ////////////////////////////////////////////////////////////////////// 00007 // STL 00008 #include <iosfwd> 00009 #include <string> 00010 // StdAir 00011 #include <stdair/stdair_inventory_types.hpp> 00012 #include <stdair/bom/BomAbstract.hpp> 00013 #include <stdair/bom/SegmentDateKey.hpp> 00014 #include <stdair/bom/SegmentDateTypes.hpp> 00015 00017 namespace boost { 00018 namespace serialization { 00019 class access; 00020 } 00021 } 00022 00023 namespace stdair { 00024 00026 struct SegmentCabinKey; 00027 class SegmentCabin; 00028 00033 class SegmentDate : public BomAbstract { 00034 template <typename BOM> friend class FacBom; 00035 friend class FacBomManager; 00036 friend class boost::serialization::access; 00037 00038 public: 00039 // ////////// Type definitions //////////// 00043 typedef SegmentDateKey Key_T; 00044 00045 00046 public: 00047 // /////////// Getters ///////////// 00049 const Key_T& getKey() const { 00050 return _key; 00051 } 00052 00054 BomAbstract* const getParent() const { 00055 return _parent; 00056 } 00057 00059 const AirportCode_T& getBoardingPoint() const { 00060 return _key.getBoardingPoint(); 00061 } 00062 00064 const AirportCode_T& getOffPoint() const { 00065 return _key.getOffPoint(); 00066 } 00067 00069 const HolderMap_T& getHolderMap() const { 00070 return _holderMap; 00071 } 00072 00074 const Date_T& getBoardingDate() const { 00075 return _boardingDate; 00076 } 00077 00079 const Duration_T& getBoardingTime() const { 00080 return _boardingTime; 00081 } 00082 00084 const Date_T& getOffDate() const { 00085 return _offDate; 00086 } 00087 00089 const Duration_T& getOffTime() const { 00090 return _offTime; 00091 } 00092 00094 const Duration_T& getElapsedTime() const { 00095 return _elapsedTime; 00096 } 00097 00099 const Distance_T& getDistance() const { 00100 return _distance; 00101 } 00102 00104 const DateOffset_T getDateOffset() const { 00105 return _offDate - _boardingDate; 00106 } 00107 00116 const Duration_T getTimeOffset() const; 00117 00121 const bool isOtherAirlineOperating () const { 00122 return _isOtherAirlineOperating; 00123 } 00124 00125 public: 00126 // ///////// Setters ////////// 00128 void setBoardingDate (const Date_T& iBoardingDate) { 00129 _boardingDate = iBoardingDate; 00130 } 00131 00133 void setBoardingTime (const Duration_T& iBoardingTime) { 00134 _boardingTime = iBoardingTime; 00135 } 00136 00138 void setOffDate (const Date_T& iOffDate) { 00139 _offDate = iOffDate; 00140 } 00141 00143 void setOffTime (const Duration_T& iOffTime) { 00144 _offTime = iOffTime; 00145 } 00146 00148 void setElapsedTime (const Duration_T& iElapsedTime) { 00149 _elapsedTime = iElapsedTime; 00150 } 00151 00153 void setDistance (const Distance_T& iDistance) { 00154 _distance = iDistance; 00155 } 00156 00158 void setIsOtherAirlineOperating (const bool iBool) { 00159 _isOtherAirlineOperating = iBool; 00160 } 00161 00162 public: 00163 // /////////// Display support methods ///////// 00169 void toStream (std::ostream& ioOut) const { 00170 ioOut << toString(); 00171 } 00172 00178 void fromStream (std::istream& ioIn) { 00179 } 00180 00184 std::string toString() const; 00185 00189 const std::string describeKey() const { 00190 return _key.toString(); 00191 } 00192 00193 00194 public: 00195 // /////////// (Boost) Serialisation support methods ///////// 00199 template<class Archive> 00200 void serialize (Archive& ar, const unsigned int iFileVersion); 00201 00202 private: 00207 void serialisationImplementation(); 00208 00209 00210 protected: 00211 // ////////// Constructors and destructors ///////// 00215 SegmentDate (const Key_T&); 00216 00220 virtual ~SegmentDate(); 00221 00222 private: 00226 SegmentDate(); 00227 00231 SegmentDate (const SegmentDate&); 00232 00233 00234 protected: 00235 // ////////// Attributes ///////// 00239 Key_T _key; 00240 00244 BomAbstract* _parent; 00245 00249 HolderMap_T _holderMap; 00250 00254 bool _isOtherAirlineOperating; 00255 00259 Date_T _boardingDate; 00260 00264 Duration_T _boardingTime; 00265 00269 Date_T _offDate; 00270 00274 Duration_T _offTime; 00275 00279 Duration_T _elapsedTime; 00280 00284 Distance_T _distance; 00285 }; 00286 00287 } 00288 #endif // __STDAIR_BOM_SEGMENTDATE_HPP 00289