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/ObjectType.hpp" 19 : : #include <stdexcept> 20 : : 21 : 125 : std::string toString(::ad::rss::world::ObjectType const e) 22 : : { 23 [ + + + + : 125 : switch (e) + + + + + + ] 24 : : { 25 : 94 : case ::ad::rss::world::ObjectType::Invalid: 26 : 94 : return std::string("::ad::rss::world::ObjectType::Invalid"); // LCOV_EXCL_BR_LINE 27 : 4 : case ::ad::rss::world::ObjectType::EgoVehicle: 28 : 4 : return std::string("::ad::rss::world::ObjectType::EgoVehicle"); // LCOV_EXCL_BR_LINE 29 : 4 : case ::ad::rss::world::ObjectType::OtherVehicle: 30 : 4 : return std::string("::ad::rss::world::ObjectType::OtherVehicle"); // LCOV_EXCL_BR_LINE 31 : 1 : case ::ad::rss::world::ObjectType::Pedestrian: 32 : 1 : return std::string("::ad::rss::world::ObjectType::Pedestrian"); // LCOV_EXCL_BR_LINE 33 : 1 : case ::ad::rss::world::ObjectType::ArtificialObject: 34 : 1 : return std::string("::ad::rss::world::ObjectType::ArtificialObject"); // LCOV_EXCL_BR_LINE 35 : 1 : case ::ad::rss::world::ObjectType::ArtificialVehicle: 36 : 1 : return std::string("::ad::rss::world::ObjectType::ArtificialVehicle"); // LCOV_EXCL_BR_LINE 37 : 1 : case ::ad::rss::world::ObjectType::ArtificialPedestrian: 38 : 1 : return std::string("::ad::rss::world::ObjectType::ArtificialPedestrian"); // LCOV_EXCL_BR_LINE 39 : 1 : case ::ad::rss::world::ObjectType::Bicycle: 40 : 1 : return std::string("::ad::rss::world::ObjectType::Bicycle"); // LCOV_EXCL_BR_LINE 41 : 1 : case ::ad::rss::world::ObjectType::OtherObject: 42 : 1 : return std::string("::ad::rss::world::ObjectType::OtherObject"); // LCOV_EXCL_BR_LINE 43 : 17 : default: 44 : 17 : return std::string("UNKNOWN ENUM VALUE"); // LCOV_EXCL_BR_LINE 45 : : } 46 : : } 47 : : 48 : 19 : template <>::ad::rss::world::ObjectType fromString(std::string const &str) 49 : : { 50 : 19 : if (str == std::string("::ad::rss::world::ObjectType::Invalid")) // LCOV_EXCL_BR_LINE 51 : : { 52 : 1 : return ::ad::rss::world::ObjectType::Invalid; 53 : : } 54 : 18 : if (str == std::string("Invalid")) // LCOV_EXCL_BR_LINE 55 : : { 56 : 1 : return ::ad::rss::world::ObjectType::Invalid; 57 : : } 58 : 17 : if (str == std::string("::ad::rss::world::ObjectType::EgoVehicle")) // LCOV_EXCL_BR_LINE 59 : : { 60 : 1 : return ::ad::rss::world::ObjectType::EgoVehicle; 61 : : } 62 : 16 : if (str == std::string("EgoVehicle")) // LCOV_EXCL_BR_LINE 63 : : { 64 : 1 : return ::ad::rss::world::ObjectType::EgoVehicle; 65 : : } 66 : 15 : if (str == std::string("::ad::rss::world::ObjectType::OtherVehicle")) // LCOV_EXCL_BR_LINE 67 : : { 68 : 1 : return ::ad::rss::world::ObjectType::OtherVehicle; 69 : : } 70 : 14 : if (str == std::string("OtherVehicle")) // LCOV_EXCL_BR_LINE 71 : : { 72 : 1 : return ::ad::rss::world::ObjectType::OtherVehicle; 73 : : } 74 : 13 : if (str == std::string("::ad::rss::world::ObjectType::Pedestrian")) // LCOV_EXCL_BR_LINE 75 : : { 76 : 1 : return ::ad::rss::world::ObjectType::Pedestrian; 77 : : } 78 : 12 : if (str == std::string("Pedestrian")) // LCOV_EXCL_BR_LINE 79 : : { 80 : 1 : return ::ad::rss::world::ObjectType::Pedestrian; 81 : : } 82 : 11 : if (str == std::string("::ad::rss::world::ObjectType::ArtificialObject")) // LCOV_EXCL_BR_LINE 83 : : { 84 : 1 : return ::ad::rss::world::ObjectType::ArtificialObject; 85 : : } 86 : 10 : if (str == std::string("ArtificialObject")) // LCOV_EXCL_BR_LINE 87 : : { 88 : 1 : return ::ad::rss::world::ObjectType::ArtificialObject; 89 : : } 90 : 9 : if (str == std::string("::ad::rss::world::ObjectType::ArtificialVehicle")) // LCOV_EXCL_BR_LINE 91 : : { 92 : 1 : return ::ad::rss::world::ObjectType::ArtificialVehicle; 93 : : } 94 : 8 : if (str == std::string("ArtificialVehicle")) // LCOV_EXCL_BR_LINE 95 : : { 96 : 1 : return ::ad::rss::world::ObjectType::ArtificialVehicle; 97 : : } 98 : 7 : if (str == std::string("::ad::rss::world::ObjectType::ArtificialPedestrian")) // LCOV_EXCL_BR_LINE 99 : : { 100 : 1 : return ::ad::rss::world::ObjectType::ArtificialPedestrian; 101 : : } 102 : 6 : if (str == std::string("ArtificialPedestrian")) // LCOV_EXCL_BR_LINE 103 : : { 104 : 1 : return ::ad::rss::world::ObjectType::ArtificialPedestrian; 105 : : } 106 : 5 : if (str == std::string("::ad::rss::world::ObjectType::Bicycle")) // LCOV_EXCL_BR_LINE 107 : : { 108 : 1 : return ::ad::rss::world::ObjectType::Bicycle; 109 : : } 110 : 4 : if (str == std::string("Bicycle")) // LCOV_EXCL_BR_LINE 111 : : { 112 : 1 : return ::ad::rss::world::ObjectType::Bicycle; 113 : : } 114 : 3 : if (str == std::string("::ad::rss::world::ObjectType::OtherObject")) // LCOV_EXCL_BR_LINE 115 : : { 116 : 1 : return ::ad::rss::world::ObjectType::OtherObject; 117 : : } 118 : 2 : if (str == std::string("OtherObject")) // LCOV_EXCL_BR_LINE 119 : : { 120 : 1 : return ::ad::rss::world::ObjectType::OtherObject; 121 : : } 122 : 1 : throw std::out_of_range("Invalid enum literal"); // LCOV_EXCL_BR_LINE 123 : : }