14 const std::string PreOptimisationMethod::_labels[
LAST_VALUE] =
15 {
"None",
"Fare Adjustment",
"Marginal Revenue Transformation"};
18 const char PreOptimisationMethod::
23 PreOptimisationMethod::PreOptimisationMethod()
29 PreOptimisationMethod::
31 : _method (iPreOptimisationMethod._method) {
35 PreOptimisationMethod::
37 : _method (iPreOptimisationMethod) {
41 PreOptimisationMethod::PreOptimisationMethod (
const char iMethod) {
43 case 'N': _method =
NONE;
break;
44 case 'F': _method =
FA;
break;
45 case 'M': _method =
MRT;
break;
51 std::ostringstream oMessage;
52 oMessage <<
"The pre-optimisation method '" << iMethod
53 <<
"' is not known. Known pre-optimisation methods: " << lLabels;
61 return _labels[iMethod];
66 return _methodLabels[iMethod];
72 std::ostringstream oStr;
73 oStr << _methodLabels[iMethod];
79 std::ostringstream ostr;
80 for (
unsigned short idx = 0; idx !=
LAST_VALUE; ++idx) {
84 ostr << _labels[idx] <<
" (" << _methodLabels[idx] <<
")";
96 std::ostringstream oStr;
97 oStr << _methodLabels[_method];
103 std::ostringstream ostr;
104 ostr << _labels[_method];
111 return (_method == iMethod);
static std::string describeLabels()
EN_PreOptimisationMethod getMethod() const
Handle on the StdAir library context.
bool operator==(const EN_PreOptimisationMethod &) const
static char getMethodLabel(const EN_PreOptimisationMethod &)
static std::string getMethodLabelAsString(const EN_PreOptimisationMethod &)
static const std::string & getLabel(const EN_PreOptimisationMethod &)
std::string getMethodAsString() const
const std::string describe() const