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 <limits> 22 : : #include <memory> 23 : : #include <sstream> 24 : : #include "ad/physics/MetricRange.hpp" 25 : : #include "ad/rss/world/LaneDrivingDirection.hpp" 26 : : #include "ad/rss/world/LaneSegmentId.hpp" 27 : : /*! 28 : : * @brief namespace ad 29 : : */ 30 : : namespace ad { 31 : : /*! 32 : : * @brief namespace rss 33 : : */ 34 : : namespace rss { 35 : : /*! 36 : : * @brief namespace world 37 : : */ 38 : : namespace world { 39 : : 40 : : /*! 41 : : * \brief DataType LaneSegment 42 : : * 43 : : * Defines a lane segment. 44 : : */ 45 : : struct LaneSegment 46 : : { 47 : : /*! 48 : : * \brief Smart pointer on LaneSegment 49 : : */ 50 : : typedef std::shared_ptr<LaneSegment> Ptr; 51 : : 52 : : /*! 53 : : * \brief Smart pointer on constant LaneSegment 54 : : */ 55 : : typedef std::shared_ptr<LaneSegment const> ConstPtr; 56 : : 57 : : /*! 58 : : * \brief standard constructor 59 : : */ 60 : 2677 : LaneSegment() = default; 61 : : 62 : : /*! 63 : : * \brief standard destructor 64 : : */ 65 : : ~LaneSegment() = default; 66 : : 67 : : /*! 68 : : * \brief standard copy constructor 69 : : */ 70 : : LaneSegment(const LaneSegment &other) = default; 71 : : 72 : : /*! 73 : : * \brief standard move constructor 74 : : */ 75 : : LaneSegment(LaneSegment &&other) = default; 76 : : 77 : : /** 78 : : * \brief standard assignment operator 79 : : * 80 : : * \param[in] other Other LaneSegment 81 : : * 82 : : * \returns Reference to this LaneSegment. 83 : : */ 84 : : LaneSegment &operator=(const LaneSegment &other) = default; 85 : : 86 : : /** 87 : : * \brief standard move operator 88 : : * 89 : : * \param[in] other Other LaneSegment 90 : : * 91 : : * \returns Reference to this LaneSegment. 92 : : */ 93 : : LaneSegment &operator=(LaneSegment &&other) = default; 94 : : 95 : : /** 96 : : * \brief standard comparison operator 97 : : * 98 : : * \param[in] other Other LaneSegment 99 : : * 100 : : * \returns \c true if both LaneSegment are equal 101 : : */ 102 : 50 : bool operator==(const LaneSegment &other) const 103 : : { 104 [ + + + + ]: 48 : return (id == other.id) && (driving_direction == other.driving_direction) && (length == other.length) 105 [ + + + + ]: 98 : && (width == other.width); 106 : : } 107 : : 108 : : /** 109 : : * \brief standard comparison operator 110 : : * 111 : : * \param[in] other Other LaneSegment. 112 : : * 113 : : * \returns \c true if both LaneSegment are different 114 : : */ 115 : 5 : bool operator!=(const LaneSegment &other) const 116 : : { 117 : 5 : return !operator==(other); 118 : : } 119 : : 120 : : /*! 121 : : * The id of the lane segment. 122 : : */ 123 : : ::ad::rss::world::LaneSegmentId id; 124 : : 125 : : /*! 126 : : * The nominal direction of the traffic flow of this lane segment in context of the RssArea it belongs to. 127 : : */ 128 : : ::ad::rss::world::LaneDrivingDirection driving_direction{::ad::rss::world::LaneDrivingDirection::Bidirectional}; 129 : : 130 : : /*! 131 : : * The metric range of the lane segments length. 132 : : */ 133 : : ::ad::physics::MetricRange length; 134 : : 135 : : /*! 136 : : * The metric range of the lane segments width. 137 : : */ 138 : : ::ad::physics::MetricRange width; 139 : : }; 140 : : 141 : : } // namespace world 142 : : } // namespace rss 143 : : } // namespace ad 144 : : 145 : : /*! 146 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 147 : : */ 148 : : #ifndef GEN_GUARD_AD_RSS_WORLD_LANESEGMENT 149 : : #define GEN_GUARD_AD_RSS_WORLD_LANESEGMENT 150 : : /*! 151 : : * @brief namespace ad 152 : : */ 153 : : namespace ad { 154 : : /*! 155 : : * @brief namespace rss 156 : : */ 157 : : namespace rss { 158 : : /*! 159 : : * @brief namespace world 160 : : */ 161 : : namespace world { 162 : : 163 : : /** 164 : : * \brief standard ostream operator 165 : : * 166 : : * \param[in] os The output stream to write to 167 : : * \param[in] _value LaneSegment value 168 : : * 169 : : * \returns The stream object. 170 : : * 171 : : */ 172 : 12 : inline std::ostream &operator<<(std::ostream &os, LaneSegment const &_value) 173 : : { 174 : 12 : os << "LaneSegment("; 175 : 12 : os << "id:"; 176 : 12 : os << _value.id; 177 : 12 : os << ","; 178 : 12 : os << "driving_direction:"; 179 : 12 : os << _value.driving_direction; 180 : 12 : os << ","; 181 : 12 : os << "length:"; 182 : 12 : os << _value.length; 183 : 12 : os << ","; 184 : 12 : os << "width:"; 185 : 12 : os << _value.width; 186 : 12 : os << ")"; 187 : 12 : return os; 188 : : } 189 : : 190 : : } // namespace world 191 : : } // namespace rss 192 : : } // namespace ad 193 : : 194 : : namespace std { 195 : : /*! 196 : : * \brief overload of the std::to_string for LaneSegment 197 : : */ 198 : 1 : inline std::string to_string(::ad::rss::world::LaneSegment const &value) 199 : : { 200 [ + - ]: 1 : stringstream sstream; 201 [ + - ]: 1 : sstream << value; 202 [ + - ]: 2 : return sstream.str(); 203 : 1 : } 204 : : } // namespace std 205 : : 206 : : /*! 207 : : * \brief overload of fmt::formatter calling std::to_string 208 : : */ 209 : : template <> struct fmt::formatter<::ad::rss::world::LaneSegment> : formatter<string_view> 210 : : { 211 : 0 : template <typename FormatContext> auto format(::ad::rss::world::LaneSegment const &value, FormatContext &ctx) 212 : : { 213 : 0 : return formatter<string_view>::format(std::to_string(value), ctx); 214 : : } 215 : : }; 216 : : 217 : : #endif // GEN_GUARD_AD_RSS_WORLD_LANESEGMENT