1.00.26
C++ Standard Airline IT Object Library
Toggle main menu visibility
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
8
#include <
stdair/basic/BasConst_Inventory.hpp
>
9
#include <
stdair/bom/BomManager.hpp
>
10
#include <
stdair/bom/Inventory.hpp
>
11
#include <
stdair/bom/FlightDate.hpp
>
12
#include <
stdair/bom/LegDate.hpp
>
13
#include <
stdair/bom/SegmentDate.hpp
>
14
15
namespace
stdair
{
16
17
// ////////////////////////////////////////////////////////////////////
18
FlightDate::FlightDate
()
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
// ////////////////////////////////////////////////////////////////////
33
FlightDate::~FlightDate
() {
34
}
35
36
// ////////////////////////////////////////////////////////////////////
37
const
AirlineCode_T
&
FlightDate::getAirlineCode
()
const
{
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
// ////////////////////////////////////////////////////////////////////
64
SegmentDate
*
FlightDate::
65
getSegmentDate
(
const
std::string& iSegmentDateKeyStr)
const
{
66
SegmentDate
* oSegmentDate_ptr =
67
BomManager::getObjectPtr<SegmentDate>
(*
this
, iSegmentDateKeyStr);
68
return
oSegmentDate_ptr;
69
}
70
71
// ////////////////////////////////////////////////////////////////////
72
SegmentDate
*
FlightDate::
73
getSegmentDate
(
const
SegmentDateKey
& iSegmentDateKey)
const
{
74
return
getSegmentDate
(iSegmentDateKey.
toString
());
75
}
76
77
}
78
BasConst_Inventory.hpp
BomManager.hpp
FlightDate.hpp
Inventory.hpp
LegDate.hpp
SegmentDate.hpp
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::AirlineCode_T
std::string AirlineCode_T
Definition
stdair_basic_types.hpp:31
stdair::DEFAULT_DEPARTURE_DATE
const Date_T DEFAULT_DEPARTURE_DATE
stdair::DEFAULT_FLIGHT_NUMBER
const FlightNumber_T DEFAULT_FLIGHT_NUMBER
stdair::BomManager::getObjectPtr
static OBJECT2 * getObjectPtr(const OBJECT1 &, const MapKey_T &)
Definition
BomManager.hpp:241
stdair::FlightDate::_key
Key_T _key
Definition
FlightDate.hpp:224
stdair::FlightDate::describeKey
const std::string describeKey() const
Definition
FlightDate.hpp:170
stdair::FlightDate::getSegmentDate
SegmentDate * getSegmentDate(const std::string &iSegmentDateKeyStr) const
Definition
FlightDate.cpp:65
stdair::FlightDate::~FlightDate
virtual ~FlightDate()
Definition
FlightDate.cpp:33
stdair::FlightDate::getAirlineCode
const AirlineCode_T & getAirlineCode() const
Definition
FlightDate.cpp:37
stdair::FlightDate::getParent
BomAbstract *const getParent() const
Definition
FlightDate.hpp:65
stdair::FlightDate::getLegDate
LegDate * getLegDate(const std::string &iLegDateKeyStr) const
Definition
FlightDate.cpp:52
stdair::FlightDate::_parent
BomAbstract * _parent
Definition
FlightDate.hpp:229
stdair::FlightDate::Key_T
FlightDateKey Key_T
Definition
FlightDate.hpp:54
stdair::FlightDate::toString
std::string toString() const
Definition
FlightDate.cpp:45
stdair::FlightDate::FlightDate
FlightDate(const Key_T &)
Definition
FlightDate.cpp:29
stdair::Inventory
Class representing the actual attributes for an airline inventory.
Definition
Inventory.hpp:41
stdair::Inventory::getAirlineCode
const AirlineCode_T & getAirlineCode() const
Definition
Inventory.hpp:64
stdair::LegDate
Definition
LegDate.hpp:25
stdair::LegDateKey
Definition
LegDateKey.hpp:16
stdair::LegDateKey::toString
const std::string toString() const
Definition
LegDateKey.cpp:42
stdair::SegmentDate
Class representing the actual attributes for an airline segment-date.
Definition
SegmentDate.hpp:42
stdair::SegmentDateKey
Key of a given segment-date, made of an origin and a destination airports.
Definition
SegmentDateKey.hpp:24
stdair::SegmentDateKey::toString
const std::string toString() const
Definition
SegmentDateKey.cpp:49
Generated for StdAir by
1.17.0