Branch data Line data Source code
1 : : /* 2 : : * ----------------- BEGIN LICENSE BLOCK --------------------------------- 3 : : * 4 : : * Copyright (C) 2018-2020 Intel Corporation 5 : : * 6 : : * SPDX-License-Identifier: MIT 7 : : * 8 : : * ----------------- END LICENSE BLOCK ----------------------------------- 9 : : */ 10 : : 11 : : /** 12 : : * Generated file 13 : : * @file 14 : : * 15 : : * Generator Version : 11.0.0-1997 16 : : */ 17 : : 18 : : #include "ad/map/landmark/TrafficLightType.hpp" 19 : : #include <stdexcept> 20 : : 21 : 62 : std::string toString(::ad::map::landmark::TrafficLightType const e) 22 : : { 23 [ + + + + : 62 : switch (e) + + + + + + + + + + + + ] 24 : : { 25 : 32 : case ::ad::map::landmark::TrafficLightType::INVALID: 26 : 32 : return std::string("::ad::map::landmark::TrafficLightType::INVALID"); // LCOV_EXCL_BR_LINE 27 : 1 : case ::ad::map::landmark::TrafficLightType::UNKNOWN: 28 : 1 : return std::string("::ad::map::landmark::TrafficLightType::UNKNOWN"); // LCOV_EXCL_BR_LINE 29 : 1 : case ::ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW: 30 : 1 : return std::string("::ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW"); // LCOV_EXCL_BR_LINE 31 : 2 : case ::ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW_GREEN: 32 : 2 : return std::string("::ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW_GREEN"); // LCOV_EXCL_BR_LINE 33 : 1 : case ::ad::map::landmark::TrafficLightType::LEFT_RED_YELLOW_GREEN: 34 : 1 : return std::string("::ad::map::landmark::TrafficLightType::LEFT_RED_YELLOW_GREEN"); // LCOV_EXCL_BR_LINE 35 : 1 : case ::ad::map::landmark::TrafficLightType::RIGHT_RED_YELLOW_GREEN: 36 : 1 : return std::string("::ad::map::landmark::TrafficLightType::RIGHT_RED_YELLOW_GREEN"); // LCOV_EXCL_BR_LINE 37 : 1 : case ::ad::map::landmark::TrafficLightType::STRAIGHT_RED_YELLOW_GREEN: 38 : 1 : return std::string("::ad::map::landmark::TrafficLightType::STRAIGHT_RED_YELLOW_GREEN"); // LCOV_EXCL_BR_LINE 39 : 1 : case ::ad::map::landmark::TrafficLightType::LEFT_STRAIGHT_RED_YELLOW_GREEN: 40 : 1 : return std::string("::ad::map::landmark::TrafficLightType::LEFT_STRAIGHT_RED_YELLOW_GREEN"); // LCOV_EXCL_BR_LINE 41 : 1 : case ::ad::map::landmark::TrafficLightType::RIGHT_STRAIGHT_RED_YELLOW_GREEN: 42 : 1 : return std::string("::ad::map::landmark::TrafficLightType::RIGHT_STRAIGHT_RED_YELLOW_GREEN"); // LCOV_EXCL_BR_LINE 43 : 1 : case ::ad::map::landmark::TrafficLightType::PEDESTRIAN_RED_GREEN: 44 : 1 : return std::string("::ad::map::landmark::TrafficLightType::PEDESTRIAN_RED_GREEN"); // LCOV_EXCL_BR_LINE 45 : 1 : case ::ad::map::landmark::TrafficLightType::BIKE_RED_GREEN: 46 : 1 : return std::string("::ad::map::landmark::TrafficLightType::BIKE_RED_GREEN"); // LCOV_EXCL_BR_LINE 47 : 1 : case ::ad::map::landmark::TrafficLightType::BIKE_PEDESTRIAN_RED_GREEN: 48 : 1 : return std::string("::ad::map::landmark::TrafficLightType::BIKE_PEDESTRIAN_RED_GREEN"); // LCOV_EXCL_BR_LINE 49 : 1 : case ::ad::map::landmark::TrafficLightType::PEDESTRIAN_RED_YELLOW_GREEN: 50 : 1 : return std::string("::ad::map::landmark::TrafficLightType::PEDESTRIAN_RED_YELLOW_GREEN"); // LCOV_EXCL_BR_LINE 51 : 1 : case ::ad::map::landmark::TrafficLightType::BIKE_RED_YELLOW_GREEN: 52 : 1 : return std::string("::ad::map::landmark::TrafficLightType::BIKE_RED_YELLOW_GREEN"); // LCOV_EXCL_BR_LINE 53 : 1 : case ::ad::map::landmark::TrafficLightType::BIKE_PEDESTRIAN_RED_YELLOW_GREEN: 54 : : return std::string( 55 : 1 : "::ad::map::landmark::TrafficLightType::BIKE_PEDESTRIAN_RED_YELLOW_GREEN"); // LCOV_EXCL_BR_LINE 56 : 15 : default: 57 : 15 : return std::string("UNKNOWN ENUM VALUE"); // LCOV_EXCL_BR_LINE 58 : : } 59 : : } 60 : : 61 : 49 : template <>::ad::map::landmark::TrafficLightType fromString(std::string const &str) 62 : : { 63 : 49 : if (str == std::string("::ad::map::landmark::TrafficLightType::INVALID")) // LCOV_EXCL_BR_LINE 64 : : { 65 : 1 : return ::ad::map::landmark::TrafficLightType::INVALID; 66 : : } 67 : 48 : if (str == std::string("INVALID")) // LCOV_EXCL_BR_LINE 68 : : { 69 : 1 : return ::ad::map::landmark::TrafficLightType::INVALID; 70 : : } 71 : 47 : if (str == std::string("::ad::map::landmark::TrafficLightType::UNKNOWN")) // LCOV_EXCL_BR_LINE 72 : : { 73 : 1 : return ::ad::map::landmark::TrafficLightType::UNKNOWN; 74 : : } 75 : 46 : if (str == std::string("UNKNOWN")) // LCOV_EXCL_BR_LINE 76 : : { 77 : 1 : return ::ad::map::landmark::TrafficLightType::UNKNOWN; 78 : : } 79 : 45 : if (str == std::string("::ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW")) // LCOV_EXCL_BR_LINE 80 : : { 81 : 1 : return ::ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW; 82 : : } 83 : 44 : if (str == std::string("SOLID_RED_YELLOW")) // LCOV_EXCL_BR_LINE 84 : : { 85 : 1 : return ::ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW; 86 : : } 87 : 43 : if (str == std::string("::ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 88 : : { 89 : 1 : return ::ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW_GREEN; 90 : : } 91 : 42 : if (str == std::string("SOLID_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 92 : : { 93 : 1 : return ::ad::map::landmark::TrafficLightType::SOLID_RED_YELLOW_GREEN; 94 : : } 95 : 41 : if (str == std::string("::ad::map::landmark::TrafficLightType::LEFT_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 96 : : { 97 : 1 : return ::ad::map::landmark::TrafficLightType::LEFT_RED_YELLOW_GREEN; 98 : : } 99 : 40 : if (str == std::string("LEFT_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 100 : : { 101 : 1 : return ::ad::map::landmark::TrafficLightType::LEFT_RED_YELLOW_GREEN; 102 : : } 103 : 39 : if (str == std::string("::ad::map::landmark::TrafficLightType::RIGHT_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 104 : : { 105 : 1 : return ::ad::map::landmark::TrafficLightType::RIGHT_RED_YELLOW_GREEN; 106 : : } 107 : 38 : if (str == std::string("RIGHT_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 108 : : { 109 : 1 : return ::ad::map::landmark::TrafficLightType::RIGHT_RED_YELLOW_GREEN; 110 : : } 111 : 37 : if (str == std::string("::ad::map::landmark::TrafficLightType::STRAIGHT_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 112 : : { 113 : 1 : return ::ad::map::landmark::TrafficLightType::STRAIGHT_RED_YELLOW_GREEN; 114 : : } 115 : 36 : if (str == std::string("STRAIGHT_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 116 : : { 117 : 1 : return ::ad::map::landmark::TrafficLightType::STRAIGHT_RED_YELLOW_GREEN; 118 : : } 119 : 35 : if (str == std::string("::ad::map::landmark::TrafficLightType::LEFT_STRAIGHT_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 120 : : { 121 : 1 : return ::ad::map::landmark::TrafficLightType::LEFT_STRAIGHT_RED_YELLOW_GREEN; 122 : : } 123 : 34 : if (str == std::string("LEFT_STRAIGHT_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 124 : : { 125 : 19 : return ::ad::map::landmark::TrafficLightType::LEFT_STRAIGHT_RED_YELLOW_GREEN; 126 : : } 127 : 15 : if (str == std::string("::ad::map::landmark::TrafficLightType::RIGHT_STRAIGHT_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 128 : : { 129 : 1 : return ::ad::map::landmark::TrafficLightType::RIGHT_STRAIGHT_RED_YELLOW_GREEN; 130 : : } 131 : 14 : if (str == std::string("RIGHT_STRAIGHT_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 132 : : { 133 : 1 : return ::ad::map::landmark::TrafficLightType::RIGHT_STRAIGHT_RED_YELLOW_GREEN; 134 : : } 135 : 13 : if (str == std::string("::ad::map::landmark::TrafficLightType::PEDESTRIAN_RED_GREEN")) // LCOV_EXCL_BR_LINE 136 : : { 137 : 1 : return ::ad::map::landmark::TrafficLightType::PEDESTRIAN_RED_GREEN; 138 : : } 139 : 12 : if (str == std::string("PEDESTRIAN_RED_GREEN")) // LCOV_EXCL_BR_LINE 140 : : { 141 : 1 : return ::ad::map::landmark::TrafficLightType::PEDESTRIAN_RED_GREEN; 142 : : } 143 : 11 : if (str == std::string("::ad::map::landmark::TrafficLightType::BIKE_RED_GREEN")) // LCOV_EXCL_BR_LINE 144 : : { 145 : 1 : return ::ad::map::landmark::TrafficLightType::BIKE_RED_GREEN; 146 : : } 147 : 10 : if (str == std::string("BIKE_RED_GREEN")) // LCOV_EXCL_BR_LINE 148 : : { 149 : 1 : return ::ad::map::landmark::TrafficLightType::BIKE_RED_GREEN; 150 : : } 151 : 9 : if (str == std::string("::ad::map::landmark::TrafficLightType::BIKE_PEDESTRIAN_RED_GREEN")) // LCOV_EXCL_BR_LINE 152 : : { 153 : 1 : return ::ad::map::landmark::TrafficLightType::BIKE_PEDESTRIAN_RED_GREEN; 154 : : } 155 : 8 : if (str == std::string("BIKE_PEDESTRIAN_RED_GREEN")) // LCOV_EXCL_BR_LINE 156 : : { 157 : 1 : return ::ad::map::landmark::TrafficLightType::BIKE_PEDESTRIAN_RED_GREEN; 158 : : } 159 : 7 : if (str == std::string("::ad::map::landmark::TrafficLightType::PEDESTRIAN_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 160 : : { 161 : 1 : return ::ad::map::landmark::TrafficLightType::PEDESTRIAN_RED_YELLOW_GREEN; 162 : : } 163 : 6 : if (str == std::string("PEDESTRIAN_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 164 : : { 165 : 1 : return ::ad::map::landmark::TrafficLightType::PEDESTRIAN_RED_YELLOW_GREEN; 166 : : } 167 : 5 : if (str == std::string("::ad::map::landmark::TrafficLightType::BIKE_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 168 : : { 169 : 1 : return ::ad::map::landmark::TrafficLightType::BIKE_RED_YELLOW_GREEN; 170 : : } 171 : 4 : if (str == std::string("BIKE_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 172 : : { 173 : 1 : return ::ad::map::landmark::TrafficLightType::BIKE_RED_YELLOW_GREEN; 174 : : } 175 : 3 : if (str 176 : 3 : == std::string("::ad::map::landmark::TrafficLightType::BIKE_PEDESTRIAN_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 177 : : { 178 : 1 : return ::ad::map::landmark::TrafficLightType::BIKE_PEDESTRIAN_RED_YELLOW_GREEN; 179 : : } 180 : 2 : if (str == std::string("BIKE_PEDESTRIAN_RED_YELLOW_GREEN")) // LCOV_EXCL_BR_LINE 181 : : { 182 : 1 : return ::ad::map::landmark::TrafficLightType::BIKE_PEDESTRIAN_RED_YELLOW_GREEN; 183 : : } 184 : 1 : throw std::out_of_range("Invalid enum literal"); // LCOV_EXCL_BR_LINE 185 : : }