StdAir Logo  1.00.5
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 }
22 
23 namespace stdair {
24 
26  struct LegDateKey;
27  class LegDate;
28  struct SegmentDateKey;
29  class SegmentDate;
30 
35  class FlightDate : public BomAbstract {
36  template <typename BOM> friend class FacBom;
37  template <typename BOM> friend class FacCloneBom;
38  friend class FacBomManager;
39  friend class boost::serialization::access;
40 
41  public:
42  // ////////// Type definitions ////////////
47 
48 
49  public:
50  // /////////// Getters ///////////////
52  const Key_T& getKey() const {
53  return _key;
54  }
55 
57  BomAbstract* const getParent() const {
58  return _parent;
59  }
60 
63  return _key.getFlightNumber();
64  }
65 
67  const Date_T& getDepartureDate() const {
68  return _key.getDepartureDate();
69  }
70 
78  const AirlineCode_T& getAirlineCode() const;
79 
83  const HolderMap_T& getHolderMap() const {
84  return _holderMap;
85  }
86 
97  LegDate* getLegDate (const std::string& iLegDateKeyStr) const;
98 
109  LegDate* getLegDate (const LegDateKey&) const;
110 
121  SegmentDate* getSegmentDate (const std::string& iSegmentDateKeyStr) const;
122 
133  SegmentDate* getSegmentDate (const SegmentDateKey&) const;
134 
135  public:
136  // /////////// Display support methods /////////
142  void toStream (std::ostream& ioOut) const {
143  ioOut << toString();
144  }
145 
151  void fromStream (std::istream& ioIn) {
152  }
153 
157  std::string toString() const;
158 
162  const std::string describeKey() const {
163  return _key.toString();
164  }
165 
166 
167  public:
168  // /////////// (Boost) Serialisation support methods /////////
172  template<class Archive>
173  void serialize (Archive& ar, const unsigned int iFileVersion);
174 
175  private:
183  void serialisationImplementationExport() const;
184  void serialisationImplementationImport();
185 
186 
187  protected:
188  // ////////// Constructors and destructors /////////
192  FlightDate (const Key_T&);
193 
197  // (Bad) work-around for an issue with Boost 1.63 Serialization
198 #if BOOST_VERSION == 106300
199  public:
200 #endif
201  virtual ~FlightDate();
202 
203  private:
207  FlightDate();
208 
212  FlightDate (const FlightDate&);
213 
214 
215  protected:
216  // ////////// Attributes /////////
220  Key_T _key;
221 
226 
231  };
232 
233 }
234 #endif // __STDAIR_BOM_FLIGHTDATE_HPP
235 
BomAbstract * _parent
Definition: FlightDate.hpp:225
Key of a given segment-date, made of an origin and a destination airports.
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
Class representing the actual attributes for an airline flight-date.
Definition: FlightDate.hpp:35
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
std::string AirlineCode_T
boost::gregorian::date Date_T
const Key_T & getKey() const
Definition: FlightDate.hpp:52
Forward declarations.
void fromStream(std::istream &ioIn)
Definition: FlightDate.hpp:151
FlightDateKey Key_T
Definition: FlightDate.hpp:46
BomAbstract *const getParent() const
Definition: FlightDate.hpp:57
unsigned short FlightNumber_T
HolderMap_T _holderMap
Definition: FlightDate.hpp:230
const std::string describeKey() const
Definition: FlightDate.hpp:162
const FlightNumber_T & getFlightNumber() const
Definition: FlightDate.hpp:62
Handle on the StdAir library context.
Class representing the actual attributes for an airline segment-date.
Definition: SegmentDate.hpp:36
Utility class for linking StdAir-based objects.
const HolderMap_T & getHolderMap() const
Definition: FlightDate.hpp:83
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
void toStream(std::ostream &ioOut) const
Definition: FlightDate.hpp:142
const Date_T & getDepartureDate() const
Definition: FlightDate.hpp:67
Key of a given flight-date, made of a flight number and a departure date.
Base class for Factory layer.
Definition: FacBom.hpp:22