$treeview $search $mathjax
StdAir Logo  1.00.2
$projectbrief
$projectbrief
$searchbox

stdair/bom/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     template <typename BOM> friend class FacCloneBom;
00038     friend class FacBomManager;
00039     friend class boost::serialization::access;
00040 
00041   public:
00042     // ////////// Type definitions ////////////
00046     typedef FlightDateKey Key_T;
00047 
00048     
00049   public:
00050     // /////////// Getters ///////////////
00052     const Key_T& getKey() const {
00053       return _key;
00054     }
00055 
00057     BomAbstract* const getParent() const {
00058       return _parent;
00059     }
00060     
00062     const FlightNumber_T& getFlightNumber() const {
00063       return _key.getFlightNumber();
00064     }
00065 
00067     const Date_T& getDepartureDate() const {
00068       return _key.getDepartureDate();
00069     }
00070 
00078     const AirlineCode_T& getAirlineCode() const;
00079 
00083     const HolderMap_T& getHolderMap() const {
00084       return _holderMap;
00085     }
00086     
00097     LegDate* getLegDate (const std::string& iLegDateKeyStr) const;
00098 
00109     LegDate* getLegDate (const LegDateKey&) const;
00110 
00121     SegmentDate* getSegmentDate (const std::string& iSegmentDateKeyStr) const;
00122 
00133     SegmentDate* getSegmentDate (const SegmentDateKey&) const;
00134     
00135   public:
00136     // /////////// Display support methods /////////
00142     void toStream (std::ostream& ioOut) const {
00143       ioOut << toString();
00144     }
00145 
00151     void fromStream (std::istream& ioIn) {
00152     }
00153 
00157     std::string toString() const;
00158     
00162     const std::string describeKey() const {
00163       return _key.toString();
00164     }
00165     
00166     
00167   public:
00168     // /////////// (Boost) Serialisation support methods /////////
00172     template<class Archive>
00173     void serialize (Archive& ar, const unsigned int iFileVersion);
00174 
00175   private:
00183     void serialisationImplementationExport() const;
00184     void serialisationImplementationImport();
00185 
00186 
00187   protected:
00188     // ////////// Constructors and destructors /////////
00192     FlightDate (const Key_T&);
00193 
00197     virtual ~FlightDate();
00198 
00199   private:
00203     FlightDate();
00204 
00208     FlightDate (const FlightDate&);
00209     
00210 
00211   protected:
00212     // ////////// Attributes /////////
00216     Key_T _key;
00217 
00221     BomAbstract* _parent;
00222 
00226     HolderMap_T _holderMap;
00227   };
00228 
00229 }
00230 #endif // __STDAIR_BOM_FLIGHTDATE_HPP
00231