00001 #ifndef __STDAIR_BOM_FLIGHTDATE_HPP 00002 #define __STDAIR_BOM_FLIGHTDATE_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/FlightDateKey.hpp> 00014 #include <stdair/bom/FlightDateTypes.hpp> 00015 00017 namespace boost { 00018 namespace serialization { 00019 class access; 00020 } 00021 } 00022 00023 namespace stdair { 00024 00026 struct LegDateKey; 00027 class LegDate; 00028 struct SegmentDateKey; 00029 class SegmentDate; 00030 00035 class FlightDate : public BomAbstract { 00036 template <typename BOM> friend class FacBom; 00037 friend class FacBomManager; 00038 friend class boost::serialization::access; 00039 00040 public: 00041 // ////////// Type definitions //////////// 00045 typedef FlightDateKey Key_T; 00046 00047 00048 public: 00049 // /////////// Getters /////////////// 00051 const Key_T& getKey() const { 00052 return _key; 00053 } 00054 00056 BomAbstract* const getParent() const { 00057 return _parent; 00058 } 00059 00061 const FlightNumber_T& getFlightNumber() const { 00062 return _key.getFlightNumber(); 00063 } 00064 00066 const Date_T& getDepartureDate() const { 00067 return _key.getDepartureDate(); 00068 } 00069 00077 const AirlineCode_T& getAirlineCode() const; 00078 00082 const HolderMap_T& getHolderMap() const { 00083 return _holderMap; 00084 } 00085 00096 LegDate* getLegDate (const std::string& iLegDateKeyStr) const; 00097 00108 LegDate* getLegDate (const LegDateKey&) const; 00109 00120 SegmentDate* getSegmentDate (const std::string& iSegmentDateKeyStr) const; 00121 00132 SegmentDate* getSegmentDate (const SegmentDateKey&) const; 00133 00134 public: 00135 // /////////// Display support methods ///////// 00141 void toStream (std::ostream& ioOut) const { 00142 ioOut << toString(); 00143 } 00144 00150 void fromStream (std::istream& ioIn) { 00151 } 00152 00156 std::string toString() const; 00157 00161 const std::string describeKey() const { 00162 return _key.toString(); 00163 } 00164 00165 00166 public: 00167 // /////////// (Boost) Serialisation support methods ///////// 00171 template<class Archive> 00172 void serialize (Archive& ar, const unsigned int iFileVersion); 00173 00174 private: 00179 void serialisationImplementation(); 00180 00181 00182 protected: 00183 // ////////// Constructors and destructors ///////// 00187 FlightDate (const Key_T&); 00188 00192 virtual ~FlightDate(); 00193 00194 private: 00198 FlightDate(); 00199 00203 FlightDate (const FlightDate&); 00204 00205 00206 protected: 00207 // ////////// Attributes ///////// 00211 Key_T _key; 00212 00216 BomAbstract* _parent; 00217 00221 HolderMap_T _holderMap; 00222 }; 00223 00224 } 00225 #endif // __STDAIR_BOM_FLIGHTDATE_HPP 00226