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 core 35 : : */ 36 : : namespace core { 37 : : 38 : : /*! 39 : : * \brief DataType LateralRelativePosition 40 : : * 41 : : * Enumeration describing the relative lateral position between two objects, a and b, within their constellation 42 : : * specific lane coordinate system. 43 : : */ 44 : : enum class LateralRelativePosition : int32_t 45 : : { 46 : : /*! 47 : : * The object a is completely left of object b. This means there is an actual lateral space between them. 48 : : */ 49 : : AtLeft = 0, 50 : : 51 : : /*! 52 : : * The objects overlap. The left border of object a is left of the left border of object b AND the right border of 53 : : * object a is left of the right border of object b. 54 : : */ 55 : : OverlapLeft = 1, 56 : : 57 : : /*! 58 : : * The objects overlap, but neither the conditions for OverlapLeft nor OverlapRight are applicable. 59 : : */ 60 : : Overlap = 2, 61 : : 62 : : /*! 63 : : * The objects overlap. The left border of object a is right of the left border of object b AND the right border of 64 : : * object a is right of the right border of object b. 65 : : */ 66 : : OverlapRight = 3, 67 : : 68 : : /*! 69 : : * The object a is completely right of object b. This means there is an actual lateral space between them. 70 : : */ 71 : : AtRight = 4 72 : : }; 73 : : 74 : : } // namespace core 75 : : } // namespace rss 76 : : } // namespace ad 77 : : /*! 78 : : * \brief Conversion of ::ad::rss::core::LateralRelativePosition to std::string helper. 79 : : */ 80 : : std::string toString(::ad::rss::core::LateralRelativePosition const e); 81 : : 82 : : /*! 83 : : * \brief Conversion from std::string to enum type T helper. 84 : : * 85 : : * \param [in] str - a fully qualified string name of enum class type 86 : : * 87 : : * \return T enum value 88 : : * 89 : : * \throws std::out_of_range exception if the given string does not match any enum type 90 : : * 91 : : * Example usage: 92 : : * \code 93 : : * auto value = fromString<SomeEnumType>("SomeEnumType::eValue"); 94 : : * assert(value == SomeEnumType::eValue); 95 : : * // Or: 96 : : * auto value = fromString<SomeEnumType>("eValue"); 97 : : * assert(value == SomeEnumType::eValue); 98 : : * \endcode 99 : : */ 100 : : template <typename EnumType> EnumType fromString(std::string const &str); 101 : : 102 : : /*! 103 : : * \brief Conversion from std::string to enum type T helper. 104 : : * 105 : : * \param [in] str - a fully qualified string name of enum class type 106 : : * 107 : : * \return T enum value 108 : : * 109 : : * \throws std::out_of_range exception if the given string does not match any enum type 110 : : * 111 : : * Example usage: 112 : : * \code 113 : : * auto value = fromString<SomeEnumType>("SomeEnumType::eValue"); 114 : : * assert(value == SomeEnumType::eValue); 115 : : * // Or: 116 : : * auto value = fromString<SomeEnumType>("eValue"); 117 : : * assert(value == SomeEnumType::eValue); 118 : : * \endcode 119 : : */ 120 : : template <>::ad::rss::core::LateralRelativePosition fromString(std::string const &str); 121 : : 122 : : /*! 123 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 124 : : */ 125 : : #ifndef GEN_GUARD_AD_RSS_CORE_LATERALRELATIVEPOSITION 126 : : #define GEN_GUARD_AD_RSS_CORE_LATERALRELATIVEPOSITION 127 : : /*! 128 : : * @brief namespace ad 129 : : */ 130 : : namespace ad { 131 : : /*! 132 : : * @brief namespace rss 133 : : */ 134 : : namespace rss { 135 : : /*! 136 : : * @brief namespace core 137 : : */ 138 : : namespace core { 139 : : 140 : : /** 141 : : * \brief standard ostream operator 142 : : * 143 : : * \param[in] os The output stream to write to 144 : : * \param[in] value LateralRelativePosition value 145 : : * 146 : : * \returns The stream object. 147 : : * 148 : : */ 149 : 7 : inline std::ostream &operator<<(std::ostream &os, LateralRelativePosition const &value) 150 : : { 151 [ + - ]: 7 : return os << toString(value); 152 : : } 153 : : 154 : : } // namespace core 155 : : } // namespace rss 156 : : } // namespace ad 157 : : 158 : : namespace std { 159 : : /*! 160 : : * \brief overload of the std::to_string for LateralRelativePosition 161 : : */ 162 : 0 : inline std::string to_string(::ad::rss::core::LateralRelativePosition const &value) 163 : : { 164 : 0 : return ::toString(value); 165 : : } 166 : : } // namespace std 167 : : 168 : : /*! 169 : : * \brief overload of fmt::formatter calling std::to_string 170 : : */ 171 : : template <> struct fmt::formatter<::ad::rss::core::LateralRelativePosition> : formatter<string_view> 172 : : { 173 : : template <typename FormatContext> 174 : 0 : auto format(::ad::rss::core::LateralRelativePosition const &value, FormatContext &ctx) 175 : : { 176 : 0 : return formatter<string_view>::format(std::to_string(value), ctx); 177 : : } 178 : : }; 179 : : 180 : : #endif // GEN_GUARD_AD_RSS_CORE_LATERALRELATIVEPOSITION