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/world/ConstellationType.hpp" 19 : : #include <stdexcept> 20 : : 21 : 95 : std::string toString(::ad::rss::world::ConstellationType const e) 22 : : { 23 [ + + + + : 95 : switch (e) + + + + ] 24 : : { 25 : 56 : case ::ad::rss::world::ConstellationType::NotRelevant: 26 : 56 : return std::string("::ad::rss::world::ConstellationType::NotRelevant"); // LCOV_EXCL_BR_LINE 27 : 30 : case ::ad::rss::world::ConstellationType::SameDirection: 28 : 30 : return std::string("::ad::rss::world::ConstellationType::SameDirection"); // LCOV_EXCL_BR_LINE 29 : 1 : case ::ad::rss::world::ConstellationType::OppositeDirection: 30 : 1 : return std::string("::ad::rss::world::ConstellationType::OppositeDirection"); // LCOV_EXCL_BR_LINE 31 : 1 : case ::ad::rss::world::ConstellationType::IntersectionEgoHasPriority: 32 : 1 : return std::string("::ad::rss::world::ConstellationType::IntersectionEgoHasPriority"); // LCOV_EXCL_BR_LINE 33 : 1 : case ::ad::rss::world::ConstellationType::IntersectionObjectHasPriority: 34 : 1 : return std::string("::ad::rss::world::ConstellationType::IntersectionObjectHasPriority"); // LCOV_EXCL_BR_LINE 35 : 1 : case ::ad::rss::world::ConstellationType::IntersectionSamePriority: 36 : 1 : return std::string("::ad::rss::world::ConstellationType::IntersectionSamePriority"); // LCOV_EXCL_BR_LINE 37 : 3 : case ::ad::rss::world::ConstellationType::Unstructured: 38 : 3 : return std::string("::ad::rss::world::ConstellationType::Unstructured"); // LCOV_EXCL_BR_LINE 39 : 2 : default: 40 : 2 : return std::string("UNKNOWN ENUM VALUE"); // LCOV_EXCL_BR_LINE 41 : : } 42 : : } 43 : : 44 : 15 : template <>::ad::rss::world::ConstellationType fromString(std::string const &str) 45 : : { 46 : 15 : if (str == std::string("::ad::rss::world::ConstellationType::NotRelevant")) // LCOV_EXCL_BR_LINE 47 : : { 48 : 1 : return ::ad::rss::world::ConstellationType::NotRelevant; 49 : : } 50 : 14 : if (str == std::string("NotRelevant")) // LCOV_EXCL_BR_LINE 51 : : { 52 : 1 : return ::ad::rss::world::ConstellationType::NotRelevant; 53 : : } 54 : 13 : if (str == std::string("::ad::rss::world::ConstellationType::SameDirection")) // LCOV_EXCL_BR_LINE 55 : : { 56 : 1 : return ::ad::rss::world::ConstellationType::SameDirection; 57 : : } 58 : 12 : if (str == std::string("SameDirection")) // LCOV_EXCL_BR_LINE 59 : : { 60 : 1 : return ::ad::rss::world::ConstellationType::SameDirection; 61 : : } 62 : 11 : if (str == std::string("::ad::rss::world::ConstellationType::OppositeDirection")) // LCOV_EXCL_BR_LINE 63 : : { 64 : 1 : return ::ad::rss::world::ConstellationType::OppositeDirection; 65 : : } 66 : 10 : if (str == std::string("OppositeDirection")) // LCOV_EXCL_BR_LINE 67 : : { 68 : 1 : return ::ad::rss::world::ConstellationType::OppositeDirection; 69 : : } 70 : 9 : if (str == std::string("::ad::rss::world::ConstellationType::IntersectionEgoHasPriority")) // LCOV_EXCL_BR_LINE 71 : : { 72 : 1 : return ::ad::rss::world::ConstellationType::IntersectionEgoHasPriority; 73 : : } 74 : 8 : if (str == std::string("IntersectionEgoHasPriority")) // LCOV_EXCL_BR_LINE 75 : : { 76 : 1 : return ::ad::rss::world::ConstellationType::IntersectionEgoHasPriority; 77 : : } 78 : 7 : if (str == std::string("::ad::rss::world::ConstellationType::IntersectionObjectHasPriority")) // LCOV_EXCL_BR_LINE 79 : : { 80 : 1 : return ::ad::rss::world::ConstellationType::IntersectionObjectHasPriority; 81 : : } 82 : 6 : if (str == std::string("IntersectionObjectHasPriority")) // LCOV_EXCL_BR_LINE 83 : : { 84 : 1 : return ::ad::rss::world::ConstellationType::IntersectionObjectHasPriority; 85 : : } 86 : 5 : if (str == std::string("::ad::rss::world::ConstellationType::IntersectionSamePriority")) // LCOV_EXCL_BR_LINE 87 : : { 88 : 1 : return ::ad::rss::world::ConstellationType::IntersectionSamePriority; 89 : : } 90 : 4 : if (str == std::string("IntersectionSamePriority")) // LCOV_EXCL_BR_LINE 91 : : { 92 : 1 : return ::ad::rss::world::ConstellationType::IntersectionSamePriority; 93 : : } 94 : 3 : if (str == std::string("::ad::rss::world::ConstellationType::Unstructured")) // LCOV_EXCL_BR_LINE 95 : : { 96 : 1 : return ::ad::rss::world::ConstellationType::Unstructured; 97 : : } 98 : 2 : if (str == std::string("Unstructured")) // LCOV_EXCL_BR_LINE 99 : : { 100 : 1 : return ::ad::rss::world::ConstellationType::Unstructured; 101 : : } 102 : 1 : throw std::out_of_range("Invalid enum literal"); // LCOV_EXCL_BR_LINE 103 : : }