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 map 35 : : */ 36 : : namespace map { 37 : : 38 : : /*! 39 : : * \brief DataType RssRestrictSpeedLimitMode 40 : : * 41 : : * The modes of speed limit consideration within RSS accelerated movement. 42 : : */ 43 : : enum class RssRestrictSpeedLimitMode : int32_t 44 : : { 45 : : /*! 46 : : * Do not change the objects max_speed_on_acceleration parameter of object_rss_dynamics. 47 : : */ 48 : : None = 0, 49 : : 50 : : /*! 51 : : * Set the objects max_speed_on_acceleration parameter of object_rss_dynamics to the maximal allowed speed of the 52 : : * relevant road section 53 : : */ 54 : : ExactSpeedLimit = 1, 55 : : 56 : : /*! 57 : : * Set the objects max_speed_on_acceleration parameter of object_rss_dynamics 58 : : * to the maximal allowed speed of the relevant road section +5 percent 59 : : */ 60 : : IncreasedSpeedLimit5 = 2, 61 : : 62 : : /*! 63 : : * Set the objects max_speed_on_acceleration parameter of object_rss_dynamics 64 : : * to the maximal allowed speed of the relevant road section +10 percent 65 : : */ 66 : : IncreasedSpeedLimit10 = 3 67 : : }; 68 : : 69 : : } // namespace map 70 : : } // namespace rss 71 : : } // namespace ad 72 : : /*! 73 : : * \brief Conversion of ::ad::rss::map::RssRestrictSpeedLimitMode to std::string helper. 74 : : */ 75 : : std::string toString(::ad::rss::map::RssRestrictSpeedLimitMode const e); 76 : : 77 : : /*! 78 : : * \brief Conversion from std::string to enum type T helper. 79 : : * 80 : : * \param [in] str - a fully qualified string name of enum class type 81 : : * 82 : : * \return T enum value 83 : : * 84 : : * \throws std::out_of_range exception if the given string does not match any enum type 85 : : * 86 : : * Example usage: 87 : : * \code 88 : : * auto value = fromString<SomeEnumType>("SomeEnumType::eValue"); 89 : : * assert(value == SomeEnumType::eValue); 90 : : * // Or: 91 : : * auto value = fromString<SomeEnumType>("eValue"); 92 : : * assert(value == SomeEnumType::eValue); 93 : : * \endcode 94 : : */ 95 : : template <typename EnumType> EnumType fromString(std::string const &str); 96 : : 97 : : /*! 98 : : * \brief Conversion from std::string to enum type T helper. 99 : : * 100 : : * \param [in] str - a fully qualified string name of enum class type 101 : : * 102 : : * \return T enum value 103 : : * 104 : : * \throws std::out_of_range exception if the given string does not match any enum type 105 : : * 106 : : * Example usage: 107 : : * \code 108 : : * auto value = fromString<SomeEnumType>("SomeEnumType::eValue"); 109 : : * assert(value == SomeEnumType::eValue); 110 : : * // Or: 111 : : * auto value = fromString<SomeEnumType>("eValue"); 112 : : * assert(value == SomeEnumType::eValue); 113 : : * \endcode 114 : : */ 115 : : template <>::ad::rss::map::RssRestrictSpeedLimitMode fromString(std::string const &str); 116 : : 117 : : /*! 118 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 119 : : */ 120 : : #ifndef GEN_GUARD_AD_RSS_MAP_RSSRESTRICTSPEEDLIMITMODE 121 : : #define GEN_GUARD_AD_RSS_MAP_RSSRESTRICTSPEEDLIMITMODE 122 : : /*! 123 : : * @brief namespace ad 124 : : */ 125 : : namespace ad { 126 : : /*! 127 : : * @brief namespace rss 128 : : */ 129 : : namespace rss { 130 : : /*! 131 : : * @brief namespace map 132 : : */ 133 : : namespace map { 134 : : 135 : : /** 136 : : * \brief standard ostream operator 137 : : * 138 : : * \param[in] os The output stream to write to 139 : : * \param[in] value RssRestrictSpeedLimitMode value 140 : : * 141 : : * \returns The stream object. 142 : : * 143 : : */ 144 : 11 : inline std::ostream &operator<<(std::ostream &os, RssRestrictSpeedLimitMode const &value) 145 : : { 146 [ + - ]: 11 : return os << toString(value); 147 : : } 148 : : 149 : : } // namespace map 150 : : } // namespace rss 151 : : } // namespace ad 152 : : 153 : : namespace std { 154 : : /*! 155 : : * \brief overload of the std::to_string for RssRestrictSpeedLimitMode 156 : : */ 157 : 3 : inline std::string to_string(::ad::rss::map::RssRestrictSpeedLimitMode const &value) 158 : : { 159 : 3 : return ::toString(value); 160 : : } 161 : : } // namespace std 162 : : 163 : : /*! 164 : : * \brief overload of fmt::formatter calling std::to_string 165 : : */ 166 : : template <> struct fmt::formatter<::ad::rss::map::RssRestrictSpeedLimitMode> : formatter<string_view> 167 : : { 168 : : template <typename FormatContext> 169 : 3 : auto format(::ad::rss::map::RssRestrictSpeedLimitMode const &value, FormatContext &ctx) 170 : : { 171 : 6 : return formatter<string_view>::format(std::to_string(value), ctx); 172 : : } 173 : : }; 174 : : 175 : : #endif // GEN_GUARD_AD_RSS_MAP_RSSRESTRICTSPEEDLIMITMODE