StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
FlightDate.hpp
Go to the documentation of this file.
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:
00182     void serialisationImplementationExport() const;
00183     void serialisationImplementationImport();
00184 
00185 
00186   protected:
00187     // ////////// Constructors and destructors /////////
00191     FlightDate (const Key_T&);
00192 
00196     virtual ~FlightDate();
00197 
00198   private:
00202     FlightDate();
00203 
00207     FlightDate (const FlightDate&);
00208     
00209 
00210   protected:
00211     // ////////// Attributes /////////
00215     Key_T _key;
00216 
00220     BomAbstract* _parent;
00221 
00225     HolderMap_T _holderMap;
00226   };
00227 
00228 }
00229 #endif // __STDAIR_BOM_FLIGHTDATE_HPP
00230 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines