static std::string TraffTypeToString(TRAFF_TYPE type);
static TRAFF_TYPE StringToTraffType(const std::string& value);
+ static TRAFF_TYPE IntToTraffType(int value);
virtual ~TARIFF() {}
virtual double GetPriceWithTraffType(uint64_t up,
return stream;
}
+inline
+TARIFF::TRAFF_TYPE TARIFF::IntToTraffType(int value)
+{
+ if (value < 0 || value > TRAFF_MAX)
+ return TRAFF_UP_DOWN;
+ return static_cast<TRAFF_TYPE>(value);
+}
+
#endif