StdAir Logo  1.00.10
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;
47  template <class T> friend struct 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 /////////
225 
230 
235  };
236 
237 }
238 #endif // __STDAIR_BOM_FLIGHTDATE_HPP
239 
stdair::FacCloneBom
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
stdair::FlightDateKey::toString
const std::string toString() const
Definition: FlightDateKey.cpp:52
stdair::SegmentDateKey
Key of a given segment-date, made of an origin and a destination airports.
Definition: SegmentDateKey.hpp:24
stdair::FlightDate::getKey
const Key_T & getKey() const
Definition: FlightDate.hpp:60
stdair::FacBom
Base class for Factory layer.
Definition: FacBom.hpp:22
stdair::FlightDateKey
Key of a given flight-date, made of a flight number and a departure date.
Definition: FlightDateKey.hpp:28
stdair::AirlineCode_T
std::string AirlineCode_T
Definition: stdair_basic_types.hpp:31
stdair::FlightDate::toString
std::string toString() const
Definition: FlightDate.cpp:45
stdair::FlightDate::getDepartureDate
const Date_T & getDepartureDate() const
Definition: FlightDate.hpp:75
stdair::LegDate
Definition: LegDate.hpp:25
stdair::FlightDate::getFlightNumber
const FlightNumber_T & getFlightNumber() const
Definition: FlightDate.hpp:70
stdair_inventory_types.hpp
stdair::FlightDateKey::getDepartureDate
const Date_T & getDepartureDate() const
Definition: FlightDateKey.hpp:63
stdair::FlightDateKey::getFlightNumber
const FlightNumber_T & getFlightNumber() const
Definition: FlightDateKey.hpp:58
stdair::FlightDate::getParent
BomAbstract *const getParent() const
Definition: FlightDate.hpp:65
stdair
Handle on the StdAir library context.
Definition: BasChronometer.cpp:9
stdair::HolderMap_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
stdair::BomAbstract
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
stdair::FlightDate::describeKey
const std::string describeKey() const
Definition: FlightDate.hpp:170
BomAbstract.hpp
stdair::LegDateKey
Definition: LegDateKey.hpp:16
stdair::FlightDate::Key_T
FlightDateKey Key_T
Definition: FlightDate.hpp:54
FlightDateKey.hpp
stdair::FlightDate
Class representing the actual attributes for an airline flight-date.
Definition: FlightDate.hpp:42
stdair::FlightDate::~FlightDate
virtual ~FlightDate()
Definition: FlightDate.cpp:33
stdair::FlightDate::_holderMap
HolderMap_T _holderMap
Definition: FlightDate.hpp:234
boost
Forward declarations.
Definition: AirlineClassList.hpp:16
stdair::FlightDate::getSegmentDate
SegmentDate * getSegmentDate(const std::string &iSegmentDateKeyStr) const
Definition: FlightDate.cpp:65
stdair::FlightNumber_T
unsigned short FlightNumber_T
Definition: stdair_basic_types.hpp:34
stdair::FlightDate::getAirlineCode
const AirlineCode_T & getAirlineCode() const
Definition: FlightDate.cpp:37
stdair::FlightDate::_parent
BomAbstract * _parent
Definition: FlightDate.hpp:229
FlightDateTypes.hpp
stdair::FlightDate::access
friend class boost::serialization::access
Definition: FlightDate.hpp:46
stdair::FlightDate::getHolderMap
const HolderMap_T & getHolderMap() const
Definition: FlightDate.hpp:91
stdair::FlightDate::toStream
void toStream(std::ostream &ioOut) const
Definition: FlightDate.hpp:150
stdair::FlightDate::getLegDate
LegDate * getLegDate(const std::string &iLegDateKeyStr) const
Definition: FlightDate.cpp:52
stdair::FlightDate::serialize
void serialize(Archive &ar, const unsigned int iFileVersion)
Definition: CmdBomSerialiser.cpp:187
stdair::FlightDate::_key
Key_T _key
Definition: FlightDate.hpp:224
stdair::FacBomManager
Utility class for linking StdAir-based objects.
Definition: FacBomManager.hpp:30
stdair::SegmentDate
Class representing the actual attributes for an airline segment-date.
Definition: SegmentDate.hpp:42
stdair::FlightDate::fromStream
void fromStream(std::istream &ioIn)
Definition: FlightDate.hpp:159
boost::archive::detail::heap_allocation
Definition: FlightDate.hpp:24
stdair::Date_T
boost::gregorian::date Date_T
Definition: stdair_date_time_types.hpp:20