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 state 35 : : */ 36 : : namespace state { 37 : : 38 : : /*! 39 : : * \brief DataType LateralResponse 40 : : * 41 : : * Enumeration defining the possible lateral responses. 42 : : * Be aware: there has to be a strict order of the enumeration values according to 43 : : * the strictness of the response. 44 : : */ 45 : : enum class LateralResponse : int32_t 46 : : { 47 : : /*! 48 : : * No action required. 49 : : */ 50 : : None = 0, 51 : : 52 : : /*! 53 : : * Vehicle has to decerate at least with brake min laterally 54 : : */ 55 : : BrakeMin = 1 56 : : }; 57 : : 58 : : } // namespace state 59 : : } // namespace rss 60 : : } // namespace ad 61 : : /*! 62 : : * \brief Conversion of ::ad::rss::state::LateralResponse to std::string helper. 63 : : */ 64 : : std::string toString(::ad::rss::state::LateralResponse const e); 65 : : 66 : : /*! 67 : : * \brief Conversion from std::string to enum type T helper. 68 : : * 69 : : * \param [in] str - a fully qualified string name of enum class type 70 : : * 71 : : * \return T enum value 72 : : * 73 : : * \throws std::out_of_range exception if the given string does not match any enum type 74 : : * 75 : : * Example usage: 76 : : * \code 77 : : * auto value = fromString<SomeEnumType>("SomeEnumType::eValue"); 78 : : * assert(value == SomeEnumType::eValue); 79 : : * // Or: 80 : : * auto value = fromString<SomeEnumType>("eValue"); 81 : : * assert(value == SomeEnumType::eValue); 82 : : * \endcode 83 : : */ 84 : : template <typename EnumType> EnumType fromString(std::string const &str); 85 : : 86 : : /*! 87 : : * \brief Conversion from std::string to enum type T helper. 88 : : * 89 : : * \param [in] str - a fully qualified string name of enum class type 90 : : * 91 : : * \return T enum value 92 : : * 93 : : * \throws std::out_of_range exception if the given string does not match any enum type 94 : : * 95 : : * Example usage: 96 : : * \code 97 : : * auto value = fromString<SomeEnumType>("SomeEnumType::eValue"); 98 : : * assert(value == SomeEnumType::eValue); 99 : : * // Or: 100 : : * auto value = fromString<SomeEnumType>("eValue"); 101 : : * assert(value == SomeEnumType::eValue); 102 : : * \endcode 103 : : */ 104 : : template <>::ad::rss::state::LateralResponse fromString(std::string const &str); 105 : : 106 : : /*! 107 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 108 : : */ 109 : : #ifndef GEN_GUARD_AD_RSS_STATE_LATERALRESPONSE 110 : : #define GEN_GUARD_AD_RSS_STATE_LATERALRESPONSE 111 : : /*! 112 : : * @brief namespace ad 113 : : */ 114 : : namespace ad { 115 : : /*! 116 : : * @brief namespace rss 117 : : */ 118 : : namespace rss { 119 : : /*! 120 : : * @brief namespace state 121 : : */ 122 : : namespace state { 123 : : 124 : : /** 125 : : * \brief standard ostream operator 126 : : * 127 : : * \param[in] os The output stream to write to 128 : : * \param[in] value LateralResponse value 129 : : * 130 : : * \returns The stream object. 131 : : * 132 : : */ 133 : 15 : inline std::ostream &operator<<(std::ostream &os, LateralResponse const &value) 134 : : { 135 [ + - ]: 15 : return os << toString(value); 136 : : } 137 : : 138 : : } // namespace state 139 : : } // namespace rss 140 : : } // namespace ad 141 : : 142 : : namespace std { 143 : : /*! 144 : : * \brief overload of the std::to_string for LateralResponse 145 : : */ 146 : 0 : inline std::string to_string(::ad::rss::state::LateralResponse const &value) 147 : : { 148 : 0 : return ::toString(value); 149 : : } 150 : : } // namespace std 151 : : 152 : : /*! 153 : : * \brief overload of fmt::formatter calling std::to_string 154 : : */ 155 : : template <> struct fmt::formatter<::ad::rss::state::LateralResponse> : formatter<string_view> 156 : : { 157 : 0 : template <typename FormatContext> auto format(::ad::rss::state::LateralResponse const &value, FormatContext &ctx) 158 : : { 159 : 0 : return formatter<string_view>::format(std::to_string(value), ctx); 160 : : } 161 : : }; 162 : : 163 : : #endif // GEN_GUARD_AD_RSS_STATE_LATERALRESPONSE