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 <sstream> 23 : : #include "ad/rss/world/ConstellationType.hpp" 24 : : #include "ad/rss/world/Object.hpp" 25 : : #include "ad/rss/world/RoadArea.hpp" 26 : : #include "ad/rss/world/RssDynamics.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 Constellation 42 : : * 43 : : * A Constellation defines the relation between the ego vehicle and another object. It consists of the type of 44 : : * constellation between these two, the objects rss dynamics and the corresponding road areas of interest. All lane 45 : : * segments on the route between ego vehicle and the object have to be part of this. RSS has to be able to calculate 46 : : * minimum and maximum distances between ego vehicle and object as well as accelerated movements within this area. 47 : : */ 48 : : struct Constellation 49 : : { 50 : : /*! 51 : : * \brief Smart pointer on Constellation 52 : : */ 53 : : typedef std::shared_ptr<Constellation> Ptr; 54 : : 55 : : /*! 56 : : * \brief Smart pointer on constant Constellation 57 : : */ 58 : : typedef std::shared_ptr<Constellation const> ConstPtr; 59 : : 60 : : /*! 61 : : * \brief standard constructor 62 : : */ 63 : 903 : Constellation() = default; 64 : : 65 : : /*! 66 : : * \brief standard destructor 67 : : */ 68 : 10093 : ~Constellation() = default; 69 : : 70 : : /*! 71 : : * \brief standard copy constructor 72 : : */ 73 [ + + + + : 9297 : Constellation(const Constellation &other) = default; + + ] 74 : : 75 : : /*! 76 : : * \brief standard move constructor 77 : : */ 78 : 115 : Constellation(Constellation &&other) = default; 79 : : 80 : : /** 81 : : * \brief standard assignment operator 82 : : * 83 : : * \param[in] other Other Constellation 84 : : * 85 : : * \returns Reference to this Constellation. 86 : : */ 87 : 15 : Constellation &operator=(const Constellation &other) = default; 88 : : 89 : : /** 90 : : * \brief standard move operator 91 : : * 92 : : * \param[in] other Other Constellation 93 : : * 94 : : * \returns Reference to this Constellation. 95 : : */ 96 : 1 : Constellation &operator=(Constellation &&other) = default; 97 : : 98 : : /** 99 : : * \brief standard comparison operator 100 : : * 101 : : * \param[in] other Other Constellation 102 : : * 103 : : * \returns \c true if both Constellation are equal 104 : : */ 105 : 28 : bool operator==(const Constellation &other) const 106 : : { 107 [ + + ]: 24 : return (constellation_type == other.constellation_type) && (ego_vehicle == other.ego_vehicle) 108 [ + + + + ]: 22 : && (ego_vehicle_rss_dynamics == other.ego_vehicle_rss_dynamics) && (object == other.object) 109 [ + + + + ]: 18 : && (object_rss_dynamics == other.object_rss_dynamics) && (intersecting_road == other.intersecting_road) 110 [ + + + + ]: 52 : && (ego_vehicle_road == other.ego_vehicle_road); 111 : : } 112 : : 113 : : /** 114 : : * \brief standard comparison operator 115 : : * 116 : : * \param[in] other Other Constellation. 117 : : * 118 : : * \returns \c true if both Constellation are different 119 : : */ 120 : 8 : bool operator!=(const Constellation &other) const 121 : : { 122 : 8 : return !operator==(other); 123 : : } 124 : : 125 : : /*! 126 : : * The type of the current constellation. Depending on this type the other fields of the RssArea might be left empty. 127 : : */ 128 : : ::ad::rss::world::ConstellationType constellation_type{::ad::rss::world::ConstellationType::SameDirection}; 129 : : 130 : : /*! 131 : : * The ego vehicle in the context of this constellation. 132 : : */ 133 : : ::ad::rss::world::Object ego_vehicle; 134 : : 135 : : /*! 136 : : * Defines the ego vehicle dynamics to be applied. 137 : : * This parameters are provided on a per constellation basis to be able to adapt these 138 : : * e.g. in respect to object type. 139 : : */ 140 : : ::ad::rss::world::RssDynamics ego_vehicle_rss_dynamics; 141 : : 142 : : /*! 143 : : * The object this constellation refers to. 144 : : */ 145 : : ::ad::rss::world::Object object; 146 : : 147 : : /*! 148 : : * Defines the objects dynamics to be applied. This parameters are provided on a per object basis to be able to adapt 149 : : * these e.g. in respect to object type or the weather conditions. 150 : : */ 151 : : ::ad::rss::world::RssDynamics object_rss_dynamics; 152 : : 153 : : /*! 154 : : * The RssRoadArea an intersecting vehicle is driving in. The driving direction of the intersecting vehicle define the 155 : : * ordering of the road segments. The road area should contain all neigboring lanes the other vehcile is able to drive 156 : : * in. In non-intersection constellations this road area is empty. 157 : : */ 158 : : ::ad::rss::world::RoadArea intersecting_road; 159 : : 160 : : /*! 161 : : * The RssRoadArea the ego vehicle is driving in. The driving direction of the ego vehicle define the ordering of the 162 : : * road segments. In non-intersection constellations the object is also driving in this road area. 163 : : */ 164 : : ::ad::rss::world::RoadArea ego_vehicle_road; 165 : : }; 166 : : 167 : : } // namespace world 168 : : } // namespace rss 169 : : } // namespace ad 170 : : 171 : : /*! 172 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 173 : : */ 174 : : #ifndef GEN_GUARD_AD_RSS_WORLD_CONSTELLATION 175 : : #define GEN_GUARD_AD_RSS_WORLD_CONSTELLATION 176 : : /*! 177 : : * @brief namespace ad 178 : : */ 179 : : namespace ad { 180 : : /*! 181 : : * @brief namespace rss 182 : : */ 183 : : namespace rss { 184 : : /*! 185 : : * @brief namespace world 186 : : */ 187 : : namespace world { 188 : : 189 : : /** 190 : : * \brief standard ostream operator 191 : : * 192 : : * \param[in] os The output stream to write to 193 : : * \param[in] _value Constellation value 194 : : * 195 : : * \returns The stream object. 196 : : * 197 : : */ 198 : 4 : inline std::ostream &operator<<(std::ostream &os, Constellation const &_value) 199 : : { 200 : 4 : os << "Constellation("; 201 : 4 : os << "constellation_type:"; 202 : 4 : os << _value.constellation_type; 203 : 4 : os << ","; 204 : 4 : os << "ego_vehicle:"; 205 : 4 : os << _value.ego_vehicle; 206 : 4 : os << ","; 207 : 4 : os << "ego_vehicle_rss_dynamics:"; 208 : 4 : os << _value.ego_vehicle_rss_dynamics; 209 : 4 : os << ","; 210 : 4 : os << "object:"; 211 : 4 : os << _value.object; 212 : 4 : os << ","; 213 : 4 : os << "object_rss_dynamics:"; 214 : 4 : os << _value.object_rss_dynamics; 215 : 4 : os << ","; 216 : 4 : os << "intersecting_road:"; 217 : 4 : os << _value.intersecting_road; 218 : 4 : os << ","; 219 : 4 : os << "ego_vehicle_road:"; 220 : 4 : os << _value.ego_vehicle_road; 221 : 4 : os << ")"; 222 : 4 : return os; 223 : : } 224 : : 225 : : } // namespace world 226 : : } // namespace rss 227 : : } // namespace ad 228 : : 229 : : namespace std { 230 : : /*! 231 : : * \brief overload of the std::to_string for Constellation 232 : : */ 233 : 1 : inline std::string to_string(::ad::rss::world::Constellation const &value) 234 : : { 235 [ + - ]: 1 : stringstream sstream; 236 [ + - ]: 1 : sstream << value; 237 [ + - ]: 2 : return sstream.str(); 238 : 1 : } 239 : : } // namespace std 240 : : 241 : : /*! 242 : : * \brief overload of fmt::formatter calling std::to_string 243 : : */ 244 : : template <> struct fmt::formatter<::ad::rss::world::Constellation> : formatter<string_view> 245 : : { 246 : 0 : template <typename FormatContext> auto format(::ad::rss::world::Constellation const &value, FormatContext &ctx) 247 : : { 248 : 0 : return formatter<string_view>::format(std::to_string(value), ctx); 249 : : } 250 : : }; 251 : : 252 : : #endif // GEN_GUARD_AD_RSS_WORLD_CONSTELLATION