1.00.26
C++ Standard Airline IT Object Library
Toggle main menu visibility
Loading...
Searching...
No Matches
FRAT5CurveHolderStruct.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/service/Logger.hpp
>
9
#include <
stdair/bom/FRAT5CurveHolderStruct.hpp
>
10
11
namespace
stdair
{
12
13
// ////////////////////////////////////////////////////////////////////
14
FRAT5CurveHolderStruct::FRAT5CurveHolderStruct
() {
15
}
16
17
// ////////////////////////////////////////////////////////////////////
18
FRAT5CurveHolderStruct::
19
FRAT5CurveHolderStruct
(
const
FRAT5CurveHolderStruct
& iHolder)
20
: _frat5CurveHolder (iHolder._frat5CurveHolder) {
21
}
22
23
// ////////////////////////////////////////////////////////////////////
24
FRAT5CurveHolderStruct::~FRAT5CurveHolderStruct
() {
25
}
26
27
// ////////////////////////////////////////////////////////////////////
28
const
FRAT5Curve_T
&
FRAT5CurveHolderStruct::
29
getFRAT5Curve
(
const
std::string& iKey)
const
{
30
FRAT5CurveHolder_T::const_iterator itCurve = _frat5CurveHolder.find (iKey);
31
if
(itCurve == _frat5CurveHolder.end()) {
32
STDAIR_LOG_DEBUG
(
"Cannot find the FRAT5 curve correponding to the "
33
<<
"given key: "
<< iKey);
34
assert (
false
);
35
}
36
37
return
itCurve->second;
38
}
39
40
// ////////////////////////////////////////////////////////////////////
41
void
FRAT5CurveHolderStruct::
42
addCurve
(
const
std::string& iKey,
const
FRAT5Curve_T
& iCurve) {
43
bool
insert = _frat5CurveHolder.insert (FRAT5CurveHolder_T::value_type(iKey, iCurve)).second;
44
if
(insert ==
false
) {
45
STDAIR_LOG_DEBUG
(
"Cannot add the FRAT5 curve correponding to the "
46
<<
"given key: "
<< iKey
47
<<
", the key may already exist."
);
48
assert (
false
);
49
}
50
}
51
52
// ////////////////////////////////////////////////////////////////////
53
void
FRAT5CurveHolderStruct::toStream
(std::ostream& ioOut)
const
{
54
ioOut <<
describe
();
55
}
56
57
// ////////////////////////////////////////////////////////////////////
58
void
FRAT5CurveHolderStruct::fromStream
(std::istream& ioIn) {
59
}
60
61
// ////////////////////////////////////////////////////////////////////
62
const
std::string
FRAT5CurveHolderStruct::describe
()
const
{
63
std::ostringstream oStr;
64
for
(FRAT5CurveHolder_T::const_iterator itCurve = _frat5CurveHolder.begin();
65
itCurve != _frat5CurveHolder.end(); ++itCurve) {
66
const
std::string& lKey = itCurve->first;
67
const
FRAT5Curve_T
& lCurve = itCurve->second;
68
oStr << lKey <<
"; "
;
69
for
(FRAT5Curve_T::const_reverse_iterator itFRAT5 = lCurve.rbegin();
70
itFRAT5 != lCurve.rend(); ++itFRAT5) {
71
const
DTD_T
& lDTD = itFRAT5->first;
72
const
double
& lFRAT5 = itFRAT5->second;
73
oStr << lDTD <<
":"
<< lFRAT5 <<
";"
;
74
}
75
oStr << std::endl;
76
}
77
return
oStr.str();
78
}
79
80
}
FRAT5CurveHolderStruct.hpp
Logger.hpp
STDAIR_LOG_DEBUG
#define STDAIR_LOG_DEBUG(iToBeLogged)
Definition
Logger.hpp:32
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::DTD_T
short DTD_T
Definition
stdair_inventory_types.hpp:90
stdair::FRAT5Curve_T
std::map< const DTD_T, FRAT5_T > FRAT5Curve_T
Definition
stdair_rm_types.hpp:52
stdair::FRAT5CurveHolderStruct::FRAT5CurveHolderStruct
FRAT5CurveHolderStruct()
Definition
FRAT5CurveHolderStruct.cpp:14
stdair::FRAT5CurveHolderStruct::addCurve
void addCurve(const std::string &, const FRAT5Curve_T &)
Definition
FRAT5CurveHolderStruct.cpp:42
stdair::FRAT5CurveHolderStruct::~FRAT5CurveHolderStruct
~FRAT5CurveHolderStruct()
Definition
FRAT5CurveHolderStruct.cpp:24
stdair::FRAT5CurveHolderStruct::getFRAT5Curve
const FRAT5Curve_T & getFRAT5Curve(const std::string &) const
Definition
FRAT5CurveHolderStruct.cpp:29
stdair::FRAT5CurveHolderStruct::fromStream
void fromStream(std::istream &ioIn)
Definition
FRAT5CurveHolderStruct.cpp:58
stdair::FRAT5CurveHolderStruct::toStream
void toStream(std::ostream &ioOut) const
Definition
FRAT5CurveHolderStruct.cpp:53
stdair::FRAT5CurveHolderStruct::describe
const std::string describe() const
Definition
FRAT5CurveHolderStruct.cpp:62
Generated for StdAir by
1.17.0