Branch data Line data Source code
1 : : /* 2 : : * ----------------- BEGIN LICENSE BLOCK --------------------------------- 3 : : * 4 : : * Copyright (C) 2018-2022 Intel Corporation 5 : : * 6 : : * SPDX-License-Identifier: LGPL-2.1-only 7 : : * 8 : : * ----------------- END LICENSE BLOCK ----------------------------------- 9 : : */ 10 : : 11 : : /** 12 : : * Generated file 13 : : * @file 14 : : * 15 : : * Generator Version : 11.0.0-2046 16 : : */ 17 : : 18 : : #include "ad/rss/map/RssRestrictSpeedLimitMode.hpp" 19 : : #include <stdexcept> 20 : : 21 : 20 : std::string toString(::ad::rss::map::RssRestrictSpeedLimitMode const e) 22 : : { 23 [ + + + + : 20 : switch (e) + ] 24 : : { 25 : 10 : case ::ad::rss::map::RssRestrictSpeedLimitMode::None: 26 : 10 : return std::string("::ad::rss::map::RssRestrictSpeedLimitMode::None"); // LCOV_EXCL_BR_LINE 27 : 1 : case ::ad::rss::map::RssRestrictSpeedLimitMode::ExactSpeedLimit: 28 : 1 : return std::string("::ad::rss::map::RssRestrictSpeedLimitMode::ExactSpeedLimit"); // LCOV_EXCL_BR_LINE 29 : 1 : case ::ad::rss::map::RssRestrictSpeedLimitMode::IncreasedSpeedLimit5: 30 : 1 : return std::string("::ad::rss::map::RssRestrictSpeedLimitMode::IncreasedSpeedLimit5"); // LCOV_EXCL_BR_LINE 31 : 1 : case ::ad::rss::map::RssRestrictSpeedLimitMode::IncreasedSpeedLimit10: 32 : 1 : return std::string("::ad::rss::map::RssRestrictSpeedLimitMode::IncreasedSpeedLimit10"); // LCOV_EXCL_BR_LINE 33 : 7 : default: 34 : 7 : return std::string("UNKNOWN ENUM VALUE"); // LCOV_EXCL_BR_LINE 35 : : } 36 : : } 37 : : 38 : 9 : template <>::ad::rss::map::RssRestrictSpeedLimitMode fromString(std::string const &str) 39 : : { 40 : 9 : if (str == std::string("::ad::rss::map::RssRestrictSpeedLimitMode::None")) // LCOV_EXCL_BR_LINE 41 : : { 42 : 1 : return ::ad::rss::map::RssRestrictSpeedLimitMode::None; 43 : : } 44 : 8 : if (str == std::string("None")) // LCOV_EXCL_BR_LINE 45 : : { 46 : 1 : return ::ad::rss::map::RssRestrictSpeedLimitMode::None; 47 : : } 48 : 7 : if (str == std::string("::ad::rss::map::RssRestrictSpeedLimitMode::ExactSpeedLimit")) // LCOV_EXCL_BR_LINE 49 : : { 50 : 1 : return ::ad::rss::map::RssRestrictSpeedLimitMode::ExactSpeedLimit; 51 : : } 52 : 6 : if (str == std::string("ExactSpeedLimit")) // LCOV_EXCL_BR_LINE 53 : : { 54 : 1 : return ::ad::rss::map::RssRestrictSpeedLimitMode::ExactSpeedLimit; 55 : : } 56 : 5 : if (str == std::string("::ad::rss::map::RssRestrictSpeedLimitMode::IncreasedSpeedLimit5")) // LCOV_EXCL_BR_LINE 57 : : { 58 : 1 : return ::ad::rss::map::RssRestrictSpeedLimitMode::IncreasedSpeedLimit5; 59 : : } 60 : 4 : if (str == std::string("IncreasedSpeedLimit5")) // LCOV_EXCL_BR_LINE 61 : : { 62 : 1 : return ::ad::rss::map::RssRestrictSpeedLimitMode::IncreasedSpeedLimit5; 63 : : } 64 : 3 : if (str == std::string("::ad::rss::map::RssRestrictSpeedLimitMode::IncreasedSpeedLimit10")) // LCOV_EXCL_BR_LINE 65 : : { 66 : 1 : return ::ad::rss::map::RssRestrictSpeedLimitMode::IncreasedSpeedLimit10; 67 : : } 68 : 2 : if (str == std::string("IncreasedSpeedLimit10")) // LCOV_EXCL_BR_LINE 69 : : { 70 : 1 : return ::ad::rss::map::RssRestrictSpeedLimitMode::IncreasedSpeedLimit10; 71 : : } 72 : 1 : throw std::out_of_range("Invalid enum literal"); // LCOV_EXCL_BR_LINE 73 : : }