StdAir Logo  1.00.18
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
FlightDate.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <cassert>
6#include <sstream>
7// StdAir
14
15namespace stdair {
16
17 // ////////////////////////////////////////////////////////////////////
19 : _key (DEFAULT_FLIGHT_NUMBER, DEFAULT_DEPARTURE_DATE), _parent (NULL) {
20 // That constructor is used by the serialisation process
21 }
22
23 // ////////////////////////////////////////////////////////////////////
24 FlightDate::FlightDate (const FlightDate& iFlightDate)
25 : _key (iFlightDate._key), _parent (NULL) {
26 }
27
28 // ////////////////////////////////////////////////////////////////////
29 FlightDate::FlightDate (const Key_T& iKey) : _key (iKey), _parent (NULL) {
30 }
31
32 // ////////////////////////////////////////////////////////////////////
35
36 // ////////////////////////////////////////////////////////////////////
38 const Inventory* lInventory_ptr =
39 static_cast<const Inventory*> (getParent());
40 assert (lInventory_ptr != NULL);
41 return lInventory_ptr->getAirlineCode();
42 }
43
44 // ////////////////////////////////////////////////////////////////////
45 std::string FlightDate::toString() const {
46 std::ostringstream oStr;
47 oStr << describeKey();
48 return oStr.str();
49 }
50
51 // ////////////////////////////////////////////////////////////////////
52 LegDate* FlightDate::getLegDate (const std::string& iLegDateKeyStr) const {
53 LegDate* oLegDate_ptr =
54 BomManager::getObjectPtr<LegDate> (*this, iLegDateKeyStr);
55 return oLegDate_ptr;
56 }
57
58 // ////////////////////////////////////////////////////////////////////
59 LegDate* FlightDate::getLegDate (const LegDateKey& iLegDateKey) const {
60 return getLegDate (iLegDateKey.toString());
61 }
62
63 // ////////////////////////////////////////////////////////////////////
65 getSegmentDate (const std::string& iSegmentDateKeyStr) const {
66 SegmentDate* oSegmentDate_ptr =
67 BomManager::getObjectPtr<SegmentDate> (*this, iSegmentDateKeyStr);
68 return oSegmentDate_ptr;
69 }
70
71 // ////////////////////////////////////////////////////////////////////
73 getSegmentDate (const SegmentDateKey& iSegmentDateKey) const {
74 return getSegmentDate (iSegmentDateKey.toString());
75 }
76
77}
78
Handle on the StdAir library context.
std::string AirlineCode_T
const Date_T DEFAULT_DEPARTURE_DATE
const FlightNumber_T DEFAULT_FLIGHT_NUMBER
static OBJECT2 * getObjectPtr(const OBJECT1 &, const MapKey_T &)
const std::string describeKey() const
SegmentDate * getSegmentDate(const std::string &iSegmentDateKeyStr) const
virtual ~FlightDate()
const AirlineCode_T & getAirlineCode() const
BomAbstract *const getParent() const
LegDate * getLegDate(const std::string &iLegDateKeyStr) const
BomAbstract * _parent
FlightDateKey Key_T
std::string toString() const
FlightDate(const Key_T &)
Class representing the actual attributes for an airline inventory.
Definition Inventory.hpp:41
const AirlineCode_T & getAirlineCode() const
Definition Inventory.hpp:64
const std::string toString() const
Class representing the actual attributes for an airline segment-date.
Key of a given segment-date, made of an origin and a destination airports.
const std::string toString() const