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 : : #pragma once 19 : : 20 : : #include <iostream> 21 : : #include <memory> 22 : : #include <string> 23 : : #include "spdlog/fmt/ostr.h" 24 : : #include "spdlog/spdlog.h" 25 : : /*! 26 : : * @brief namespace ad 27 : : */ 28 : : namespace ad { 29 : : /*! 30 : : * @brief namespace rss 31 : : */ 32 : : namespace rss { 33 : : /*! 34 : : * @brief namespace world 35 : : */ 36 : : namespace world { 37 : : 38 : : /*! 39 : : * \brief DataType ConstellationType 40 : : * 41 : : * Enumeration describing the type of constellation. 42 : : */ 43 : : enum class ConstellationType : int32_t 44 : : { 45 : : /*! 46 : : * The other vehicle cannot conflict with the ego vehicle. This kind of constellations are always considered to be 47 : : * safe. Use this constellation type to make the object visible in the result vector to be a known object, but not 48 : : * relevant for RSS (e.g. object in opposite direction, but already passed by). 49 : : */ 50 : : NotRelevant = 0, 51 : : 52 : : /*! 53 : : * Both drive on the same road in the same direction. 54 : : */ 55 : : SameDirection = 1, 56 : : 57 : : /*! 58 : : * Both drive on the same road in the opposite direction. 59 : : */ 60 : : OppositeDirection = 2, 61 : : 62 : : /*! 63 : : * Both drive on individual roads which intersect at the end. Ego vehicle has priority over object. 64 : : */ 65 : : IntersectionEgoHasPriority = 3, 66 : : 67 : : /*! 68 : : * Both drive on individual roads which intersect at the end. Object has priority over ego vehicle. 69 : : */ 70 : : IntersectionObjectHasPriority = 4, 71 : : 72 : : /*! 73 : : * Both drive on individual roads which intersect at the end. Object and ego vehicle have same priority. 74 : : */ 75 : : IntersectionSamePriority = 5, 76 : : 77 : : /*! 78 : : * An unstructured constellation. 79 : : */ 80 : : Unstructured = 6 81 : : }; 82 : : 83 : : } // namespace world 84 : : } // namespace rss 85 : : } // namespace ad 86 : : /*! 87 : : * \brief Conversion of ::ad::rss::world::ConstellationType to std::string helper. 88 : : */ 89 : : std::string toString(::ad::rss::world::ConstellationType const e); 90 : : 91 : : /*! 92 : : * \brief Conversion from std::string to enum type T helper. 93 : : * 94 : : * \param [in] str - a fully qualified string name of enum class type 95 : : * 96 : : * \return T enum value 97 : : * 98 : : * \throws std::out_of_range exception if the given string does not match any enum type 99 : : * 100 : : * Example usage: 101 : : * \code 102 : : * auto value = fromString<SomeEnumType>("SomeEnumType::eValue"); 103 : : * assert(value == SomeEnumType::eValue); 104 : : * // Or: 105 : : * auto value = fromString<SomeEnumType>("eValue"); 106 : : * assert(value == SomeEnumType::eValue); 107 : : * \endcode 108 : : */ 109 : : template <typename EnumType> EnumType fromString(std::string const &str); 110 : : 111 : : /*! 112 : : * \brief Conversion from std::string to enum type T helper. 113 : : * 114 : : * \param [in] str - a fully qualified string name of enum class type 115 : : * 116 : : * \return T enum value 117 : : * 118 : : * \throws std::out_of_range exception if the given string does not match any enum type 119 : : * 120 : : * Example usage: 121 : : * \code 122 : : * auto value = fromString<SomeEnumType>("SomeEnumType::eValue"); 123 : : * assert(value == SomeEnumType::eValue); 124 : : * // Or: 125 : : * auto value = fromString<SomeEnumType>("eValue"); 126 : : * assert(value == SomeEnumType::eValue); 127 : : * \endcode 128 : : */ 129 : : template <>::ad::rss::world::ConstellationType fromString(std::string const &str); 130 : : 131 : : /*! 132 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 133 : : */ 134 : : #ifndef GEN_GUARD_AD_RSS_WORLD_CONSTELLATIONTYPE 135 : : #define GEN_GUARD_AD_RSS_WORLD_CONSTELLATIONTYPE 136 : : /*! 137 : : * @brief namespace ad 138 : : */ 139 : : namespace ad { 140 : : /*! 141 : : * @brief namespace rss 142 : : */ 143 : : namespace rss { 144 : : /*! 145 : : * @brief namespace world 146 : : */ 147 : : namespace world { 148 : : 149 : : /** 150 : : * \brief standard ostream operator 151 : : * 152 : : * \param[in] os The output stream to write to 153 : : * \param[in] value ConstellationType value 154 : : * 155 : : * \returns The stream object. 156 : : * 157 : : */ 158 : 13 : inline std::ostream &operator<<(std::ostream &os, ConstellationType const &value) 159 : : { 160 [ + - ]: 13 : return os << toString(value); 161 : : } 162 : : 163 : : } // namespace world 164 : : } // namespace rss 165 : : } // namespace ad 166 : : 167 : : namespace std { 168 : : /*! 169 : : * \brief overload of the std::to_string for ConstellationType 170 : : */ 171 : 0 : inline std::string to_string(::ad::rss::world::ConstellationType const &value) 172 : : { 173 : 0 : return ::toString(value); 174 : : } 175 : : } // namespace std 176 : : 177 : : /*! 178 : : * \brief overload of fmt::formatter calling std::to_string 179 : : */ 180 : : template <> struct fmt::formatter<::ad::rss::world::ConstellationType> : formatter<string_view> 181 : : { 182 : 0 : template <typename FormatContext> auto format(::ad::rss::world::ConstellationType const &value, FormatContext &ctx) 183 : : { 184 : 0 : return formatter<string_view>::format(std::to_string(value), ctx); 185 : : } 186 : : }; 187 : : 188 : : #endif // GEN_GUARD_AD_RSS_WORLD_CONSTELLATIONTYPE