StdAir Logo  1.00.3
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;
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  virtual ~FlightDate();
198 
199  private:
203  FlightDate();
204 
208  FlightDate (const FlightDate&);
209 
210 
211  protected:
212  // ////////// Attributes /////////
216  Key_T _key;
217 
222 
227  };
228 
229 }
230 #endif // __STDAIR_BOM_FLIGHTDATE_HPP
231 
const Date_T & getDepartureDate() const
Definition: FlightDate.hpp:67
void serialize(Archive &ar, const unsigned int iFileVersion)
Utility class for linking StdAir-based objects.
unsigned short FlightNumber_T
Class representing the actual attributes for an airline segment-date.
Definition: SegmentDate.hpp:36
HolderMap_T _holderMap
Definition: FlightDate.hpp:226
Handle on the StdAir library context.
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
std::string toString() const
Definition: FlightDate.cpp:45
std::string AirlineCode_T
void fromStream(std::istream &ioIn)
Definition: FlightDate.hpp:151
const FlightNumber_T & getFlightNumber() const
Definition: FlightDate.hpp:62
Base class for Factory layer.
Definition: FacBom.hpp:22
BomAbstract * _parent
Definition: FlightDate.hpp:221
const HolderMap_T & getHolderMap() const
Definition: FlightDate.hpp:83
Key of a given flight-date, made of a flight number and a departure date.
const AirlineCode_T & getAirlineCode() const
Definition: FlightDate.cpp:37
const Key_T & getKey() const
Definition: FlightDate.hpp:52
const Date_T & getDepartureDate() const
friend class boost::serialization::access
Definition: FlightDate.hpp:39
SegmentDate * getSegmentDate(const std::string &iSegmentDateKeyStr) const
Definition: FlightDate.cpp:65
Forward declarations.
boost::gregorian::date Date_T
virtual ~FlightDate()
Definition: FlightDate.cpp:33
FlightDateKey Key_T
Definition: FlightDate.hpp:46
void toStream(std::ostream &ioOut) const
Definition: FlightDate.hpp:142
const std::string toString() const
Key of a given segment-date, made of an origin and a destination airports.
LegDate * getLegDate(const std::string &iLegDateKeyStr) const
Definition: FlightDate.cpp:52
Class representing the actual attributes for an airline flight-date.
Definition: FlightDate.hpp:35
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
const std::string describeKey() const
Definition: FlightDate.hpp:162
BomAbstract *const getParent() const
Definition: FlightDate.hpp:57
const FlightNumber_T & getFlightNumber() const