StdAir Logo  1.00.6
C++ Standard Airline IT Object Library
FlightDate.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_FLIGHTDATE_HPP
2 #define __STDAIR_BOM_FLIGHTDATE_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // StdAir
15 
17 namespace boost {
18  namespace serialization {
19  class access;
20  }
21  namespace archive {
22  namespace detail {
23  template <class T>
25  }
26  }
27 }
28 
29 
30 namespace stdair {
31 
33  struct LegDateKey;
34  class LegDate;
35  struct SegmentDateKey;
36  class SegmentDate;
37 
42  class FlightDate : public BomAbstract {
43  template <typename BOM> friend class FacBom;
44  template <typename BOM> friend class FacCloneBom;
45  friend class FacBomManager;
46  friend class boost::serialization::access;
47  template <class T> friend class boost::archive::detail::heap_allocation;
48 
49  public:
50  // ////////// Type definitions ////////////
55 
56 
57  public:
58  // /////////// Getters ///////////////
60  const Key_T& getKey() const {
61  return _key;
62  }
63 
65  BomAbstract* const getParent() const {
66  return _parent;
67  }
68 
71  return _key.getFlightNumber();
72  }
73 
75  const Date_T& getDepartureDate() const {
76  return _key.getDepartureDate();
77  }
78 
86  const AirlineCode_T& getAirlineCode() const;
87 
91  const HolderMap_T& getHolderMap() const {
92  return _holderMap;
93  }
94 
105  LegDate* getLegDate (const std::string& iLegDateKeyStr) const;
106 
117  LegDate* getLegDate (const LegDateKey&) const;
118 
129  SegmentDate* getSegmentDate (const std::string& iSegmentDateKeyStr) const;
130 
141  SegmentDate* getSegmentDate (const SegmentDateKey&) const;
142 
143  public:
144  // /////////// Display support methods /////////
150  void toStream (std::ostream& ioOut) const {
151  ioOut << toString();
152  }
153 
159  void fromStream (std::istream& ioIn) {
160  }
161 
165  std::string toString() const;
166 
170  const std::string describeKey() const {
171  return _key.toString();
172  }
173 
174 
175  public:
176  // /////////// (Boost) Serialisation support methods /////////
180  template<class Archive>
181  void serialize (Archive& ar, const unsigned int iFileVersion);
182 
183  private:
191  void serialisationImplementationExport() const;
192  void serialisationImplementationImport();
193 
194 
195  protected:
196  // ////////// Constructors and destructors /////////
200  FlightDate (const Key_T&);
201 
205  virtual ~FlightDate();
206 
207  private:
211  FlightDate();
212 
216  FlightDate (const FlightDate&);
217 
218 
219  protected:
220  // ////////// Attributes /////////
224  Key_T _key;
225 
230 
235  };
236 
237 }
238 #endif // __STDAIR_BOM_FLIGHTDATE_HPP
239 
const FlightNumber_T & getFlightNumber() const
Definition: FlightDate.hpp:70
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
const HolderMap_T & getHolderMap() const
Definition: FlightDate.hpp:91
std::string AirlineCode_T
Key of a given segment-date, made of an origin and a destination airports.
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
boost::gregorian::date Date_T
Forward declarations.
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
const std::string describeKey() const
Definition: FlightDate.hpp:170
const Date_T & getDepartureDate() const
Definition: FlightDate.hpp:75
Class representing the actual attributes for an airline flight-date.
Definition: FlightDate.hpp:42
const Key_T & getKey() const
Definition: FlightDate.hpp:60
unsigned short FlightNumber_T
Class representing the actual attributes for an airline segment-date.
Definition: SegmentDate.hpp:42
Utility class for linking StdAir-based objects.
BomAbstract *const getParent() const
Definition: FlightDate.hpp:65
Handle on the StdAir library context.
Key of a given flight-date, made of a flight number and a departure date.
Base class for Factory layer.
Definition: FacBom.hpp:22
void toStream(std::ostream &ioOut) const
Definition: FlightDate.hpp:150
void fromStream(std::istream &ioIn)
Definition: FlightDate.hpp:159
BomAbstract * _parent
Definition: FlightDate.hpp:229
FlightDateKey Key_T
Definition: FlightDate.hpp:54
HolderMap_T _holderMap
Definition: FlightDate.hpp:234