Branch data Line data Source code
1 : : /* 2 : : * ----------------- BEGIN LICENSE BLOCK --------------------------------- 3 : : * 4 : : * Copyright (C) 2018-2020 Intel Corporation 5 : : * 6 : : * SPDX-License-Identifier: MIT 7 : : * 8 : : * ----------------- END LICENSE BLOCK ----------------------------------- 9 : : */ 10 : : 11 : : /** 12 : : * Generated file 13 : : * @file 14 : : * 15 : : * Generator Version : 11.0.0-1997 16 : : */ 17 : : 18 : : #pragma once 19 : : 20 : : #include <iostream> 21 : : #include <memory> 22 : : #include <string> 23 : : /*! 24 : : * @brief namespace ad 25 : : */ 26 : : namespace ad { 27 : : /*! 28 : : * @brief namespace map 29 : : */ 30 : : namespace map { 31 : : /*! 32 : : * @brief namespace access 33 : : * 34 : : * Accessing map data 35 : : */ 36 : : namespace access { 37 : : 38 : : /*! 39 : : * \brief DataType TrafficType 40 : : * 41 : : * Country specific standard traffic regulation, in bidirectional traffic, of keeping to one side of the road. 42 : : */ 43 : : enum class TrafficType : int32_t 44 : : { 45 : : /*! 46 : : * Invalid value. 47 : : */ 48 : : INVALID = 0, 49 : : 50 : : /*! 51 : : * Traffic is on left side of the road (e.g. in UK) 52 : : */ 53 : : LEFT_HAND_TRAFFIC = 1, 54 : : 55 : : /*! 56 : : * Traffic is on right side of the road. 57 : : */ 58 : : RIGHT_HAND_TRAFFIC = 2 59 : : }; 60 : : 61 : : } // namespace access 62 : : } // namespace map 63 : : } // namespace ad 64 : : /*! 65 : : * \brief Conversion of ::ad::map::access::TrafficType to std::string helper. 66 : : */ 67 : : std::string toString(::ad::map::access::TrafficType const e); 68 : : 69 : : /*! 70 : : * \brief Conversion from std::string to enum type T helper. 71 : : * 72 : : * \param [in] str - a fully qualified string name of enum class type 73 : : * 74 : : * \return T enum value 75 : : * 76 : : * \throws std::out_of_range exception if the given string does not match any enum type 77 : : * 78 : : * Example usage: 79 : : * \code 80 : : * auto value = fromString<SomeEnumType>("SomeEnumType::eValue"); 81 : : * assert(value == SomeEnumType::eValue); 82 : : * // Or: 83 : : * auto value = fromString<SomeEnumType>("eValue"); 84 : : * assert(value == SomeEnumType::eValue); 85 : : * \endcode 86 : : */ 87 : : template <typename EnumType> EnumType fromString(std::string const &str); 88 : : 89 : : /*! 90 : : * \brief Conversion from std::string to enum type T helper. 91 : : * 92 : : * \param [in] str - a fully qualified string name of enum class type 93 : : * 94 : : * \return T enum value 95 : : * 96 : : * \throws std::out_of_range exception if the given string does not match any enum type 97 : : * 98 : : * Example usage: 99 : : * \code 100 : : * auto value = fromString<SomeEnumType>("SomeEnumType::eValue"); 101 : : * assert(value == SomeEnumType::eValue); 102 : : * // Or: 103 : : * auto value = fromString<SomeEnumType>("eValue"); 104 : : * assert(value == SomeEnumType::eValue); 105 : : * \endcode 106 : : */ 107 : : template <>::ad::map::access::TrafficType fromString(std::string const &str); 108 : : 109 : : /*! 110 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 111 : : */ 112 : : #ifndef GEN_GUARD_AD_MAP_ACCESS_TRAFFICTYPE 113 : : #define GEN_GUARD_AD_MAP_ACCESS_TRAFFICTYPE 114 : : /*! 115 : : * @brief namespace ad 116 : : */ 117 : : namespace ad { 118 : : /*! 119 : : * @brief namespace map 120 : : */ 121 : : namespace map { 122 : : /*! 123 : : * @brief namespace access 124 : : * 125 : : * Accessing map data 126 : : */ 127 : : namespace access { 128 : : 129 : : /** 130 : : * \brief standard ostream operator 131 : : * 132 : : * \param[in] os The output stream to write to 133 : : * \param[in] value TrafficType value 134 : : * 135 : : * \returns The stream object. 136 : : * 137 : : */ 138 : 11 : inline std::ostream &operator<<(std::ostream &os, TrafficType const &value) 139 : : { 140 [ + - ]: 11 : return os << toString(value); 141 : : } 142 : : 143 : : } // namespace access 144 : : } // namespace map 145 : : } // namespace ad 146 : : 147 : : namespace std { 148 : : /*! 149 : : * \brief overload of the std::to_string for TrafficType 150 : : */ 151 : : inline std::string to_string(::ad::map::access::TrafficType const &value) 152 : : { 153 : : return ::toString(value); 154 : : } 155 : : } // namespace std 156 : : #endif // GEN_GUARD_AD_MAP_ACCESS_TRAFFICTYPE