14 const std::string PartnershipTechnique::_labels[
LAST_VALUE] =
16 "RevenueAvailabilityExchangeDemandAggregation",
17 "RevenueAvailabilityExchangeYieldProration",
18 "InterlineBidPriceDemandAggregation",
19 "InterlineBidPriceYieldProration",
20 "NonProtectionistInterlineBidPriceYieldProration",
21 "RevenueManagementCooperation",
22 "AdvancedRevenueManagementCooperation"};
25 const char PartnershipTechnique::_techniqueLabels[
LAST_VALUE] = {
'N',
36 PartnershipTechnique::PartnershipTechnique() : _technique (
LAST_VALUE) {
41 PartnershipTechnique::
43 : _technique (iPartnershipTechnique._technique) {
47 PartnershipTechnique::
49 : _technique (iPartnershipTechnique) {
56 switch (iTechniqueChar) {
57 case 'N': oTechnique =
NONE;
break;
58 case 'r': oTechnique =
RAE_DA;
break;
59 case 'R': oTechnique =
RAE_YP;
break;
60 case 'i': oTechnique =
IBP_DA;
break;
61 case 'I': oTechnique =
IBP_YP;
break;
62 case 'U': oTechnique =
IBP_YP_U;
break;
63 case 'C': oTechnique =
RMC;
break;
64 case 'A': oTechnique =
A_RMC;
break;
70 std::ostringstream oMessage;
71 oMessage <<
"The partnership technique '"
73 <<
"' is not known. Known partnership techniques: "
82 PartnershipTechnique::PartnershipTechnique (
const char iTechniqueChar)
83 : _technique (getTechnique (iTechniqueChar)) {
87 PartnershipTechnique::
88 PartnershipTechnique (
const std::string& iTechniqueStr) {
90 const size_t lSize = iTechniqueStr.size();
92 const char lTechniqueChar = iTechniqueStr[0];
99 return _labels[iTechnique];
105 return _techniqueLabels[iTechnique];
111 std::ostringstream oStr;
112 oStr << _techniqueLabels[iTechnique];
118 std::ostringstream ostr;
119 for (
unsigned short idx = 0; idx !=
LAST_VALUE; ++idx) {
123 ostr << _labels[idx] <<
" (" << _techniqueLabels[idx] <<
")";
136 const char oTechniqueChar = _techniqueLabels[_technique];
137 return oTechniqueChar;
142 std::ostringstream oStr;
143 oStr << _techniqueLabels[_technique];
149 std::ostringstream ostr;
150 ostr << _labels[_technique];
157 return (_technique == iTechnique);