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/rss/core/RelativeConstellationId.hpp" 25 : : #include "ad/rss/core/RelativeObjectState.hpp" 26 : : #include "ad/rss/core/RelativePosition.hpp" 27 : : #include "ad/rss/world/ConstellationType.hpp" 28 : : #include "ad/rss/world/ObjectId.hpp" 29 : : #include "ad/rss/world/WorldModelIndexVector.hpp" 30 : : /*! 31 : : * @brief namespace ad 32 : : */ 33 : : namespace ad { 34 : : /*! 35 : : * @brief namespace rss 36 : : */ 37 : : namespace rss { 38 : : /*! 39 : : * @brief namespace core 40 : : */ 41 : : namespace core { 42 : : 43 : : /*! 44 : : * \brief DataType RelativeConstellation 45 : : * 46 : : * Describes a RSS constellation within the constellation specific lane coordinate 47 : : * system. 48 : : * A constellation always considers the relative relation between two objects: the 49 : : * ego vehicle and one other vehicle. The constellation lane coordinate system is 50 : : * unique for one specific constellation. As a consequence the vehicle state of the 51 : : * ego vehicle in different RSS constellations cannot be compared to each other. Consists 52 : : * of a constellation id and type, the VehicleState of the ego vehicle, the VehicleState 53 : : * of the other vehicle and the RelativePosition between ego vehicle and other vehicle. 54 : : */ 55 : : struct RelativeConstellation 56 : : { 57 : : /*! 58 : : * \brief Smart pointer on RelativeConstellation 59 : : */ 60 : : typedef std::shared_ptr<RelativeConstellation> Ptr; 61 : : 62 : : /*! 63 : : * \brief Smart pointer on constant RelativeConstellation 64 : : */ 65 : : typedef std::shared_ptr<RelativeConstellation const> ConstPtr; 66 : : 67 : : /*! 68 : : * \brief standard constructor 69 : : */ 70 : 5096 : RelativeConstellation() = default; 71 : : 72 : : /*! 73 : : * \brief standard destructor 74 : : */ 75 : 65036 : ~RelativeConstellation() = default; 76 : : 77 : : /*! 78 : : * \brief standard copy constructor 79 : : */ 80 : 59254 : RelativeConstellation(const RelativeConstellation &other) = default; 81 : : 82 : : /*! 83 : : * \brief standard move constructor 84 : : */ 85 : 701 : RelativeConstellation(RelativeConstellation &&other) = default; 86 : : 87 : : /** 88 : : * \brief standard assignment operator 89 : : * 90 : : * \param[in] other Other RelativeConstellation 91 : : * 92 : : * \returns Reference to this RelativeConstellation. 93 : : */ 94 : 16 : RelativeConstellation &operator=(const RelativeConstellation &other) = default; 95 : : 96 : : /** 97 : : * \brief standard move operator 98 : : * 99 : : * \param[in] other Other RelativeConstellation 100 : : * 101 : : * \returns Reference to this RelativeConstellation. 102 : : */ 103 : 1 : RelativeConstellation &operator=(RelativeConstellation &&other) = default; 104 : : 105 : : /** 106 : : * \brief standard comparison operator 107 : : * 108 : : * \param[in] other Other RelativeConstellation 109 : : * 110 : : * \returns \c true if both RelativeConstellation are equal 111 : : */ 112 : 30 : bool operator==(const RelativeConstellation &other) const 113 : : { 114 [ + + + + ]: 26 : return (ego_id == other.ego_id) && (object_id == other.object_id) && (constellation_id == other.constellation_id) 115 [ + + + + ]: 22 : && (constellation_type == other.constellation_type) && (ego_state == other.ego_state) 116 [ + + + + ]: 18 : && (other_state == other.other_state) && (relative_position == other.relative_position) 117 [ + + + + ]: 56 : && (world_model_indices == other.world_model_indices); 118 : : } 119 : : 120 : : /** 121 : : * \brief standard comparison operator 122 : : * 123 : : * \param[in] other Other RelativeConstellation. 124 : : * 125 : : * \returns \c true if both RelativeConstellation are different 126 : : */ 127 : 9 : bool operator!=(const RelativeConstellation &other) const 128 : : { 129 : 9 : return !operator==(other); 130 : : } 131 : : 132 : : /*! 133 : : * Defines the unique id of the ego. This id has to be constant over time. 134 : : */ 135 : : ::ad::rss::world::ObjectId ego_id{0}; 136 : : 137 : : /*! 138 : : * Defines the unique id of an object. This id has to be constant over time for the same object. 139 : : */ 140 : : ::ad::rss::world::ObjectId object_id{0}; 141 : : 142 : : /*! 143 : : * The unique id of the constellation. 144 : : * The constellation id has to be constant over time for a pair of ego vehicle and 145 : : * specific constellation between another vehicle. 146 : : */ 147 : : ::ad::rss::core::RelativeConstellationId constellation_id{0}; 148 : : 149 : : /*! 150 : : * The type of the current constellation. 151 : : */ 152 : : ::ad::rss::world::ConstellationType constellation_type{::ad::rss::world::ConstellationType::NotRelevant}; 153 : : 154 : : /*! 155 : : * The vehicle state of the ego vehicle within the constellation specific lane coordinate system. 156 : : */ 157 : : ::ad::rss::core::RelativeObjectState ego_state; 158 : : 159 : : /*! 160 : : * The vehicle state of the other vehicle within the constellation specific lane coordinate system. 161 : : */ 162 : : ::ad::rss::core::RelativeObjectState other_state; 163 : : 164 : : /*! 165 : : * The relative position between the ego vehicle and the other vehicle within the constellation specific lane 166 : : * coordinate system. 167 : : */ 168 : : ::ad::rss::core::RelativePosition relative_position; 169 : : 170 : : /*! 171 : : * The indices of the input Constellation within the WorldModel.constellations ConstellationVector which this 172 : : * RelativeConstellation is based on. 173 : : */ 174 : : ::ad::rss::world::WorldModelIndexVector world_model_indices; 175 : : }; 176 : : 177 : : } // namespace core 178 : : } // namespace rss 179 : : } // namespace ad 180 : : 181 : : /*! 182 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 183 : : */ 184 : : #ifndef GEN_GUARD_AD_RSS_CORE_RELATIVECONSTELLATION 185 : : #define GEN_GUARD_AD_RSS_CORE_RELATIVECONSTELLATION 186 : : /*! 187 : : * @brief namespace ad 188 : : */ 189 : : namespace ad { 190 : : /*! 191 : : * @brief namespace rss 192 : : */ 193 : : namespace rss { 194 : : /*! 195 : : * @brief namespace core 196 : : */ 197 : : namespace core { 198 : : 199 : : /** 200 : : * \brief standard ostream operator 201 : : * 202 : : * \param[in] os The output stream to write to 203 : : * \param[in] _value RelativeConstellation value 204 : : * 205 : : * \returns The stream object. 206 : : * 207 : : */ 208 : 4 : inline std::ostream &operator<<(std::ostream &os, RelativeConstellation const &_value) 209 : : { 210 : 4 : os << "RelativeConstellation("; 211 : 4 : os << "ego_id:"; 212 : 4 : os << _value.ego_id; 213 : 4 : os << ","; 214 : 4 : os << "object_id:"; 215 : 4 : os << _value.object_id; 216 : 4 : os << ","; 217 : 4 : os << "constellation_id:"; 218 : 4 : os << _value.constellation_id; 219 : 4 : os << ","; 220 : 4 : os << "constellation_type:"; 221 : 4 : os << _value.constellation_type; 222 : 4 : os << ","; 223 : 4 : os << "ego_state:"; 224 : 4 : os << _value.ego_state; 225 : 4 : os << ","; 226 : 4 : os << "other_state:"; 227 : 4 : os << _value.other_state; 228 : 4 : os << ","; 229 : 4 : os << "relative_position:"; 230 : 4 : os << _value.relative_position; 231 : 4 : os << ","; 232 : 4 : os << "world_model_indices:"; 233 : 4 : os << _value.world_model_indices; 234 : 4 : os << ")"; 235 : 4 : return os; 236 : : } 237 : : 238 : : } // namespace core 239 : : } // namespace rss 240 : : } // namespace ad 241 : : 242 : : namespace std { 243 : : /*! 244 : : * \brief overload of the std::to_string for RelativeConstellation 245 : : */ 246 : 1 : inline std::string to_string(::ad::rss::core::RelativeConstellation const &value) 247 : : { 248 [ + - ]: 1 : stringstream sstream; 249 [ + - ]: 1 : sstream << value; 250 [ + - ]: 2 : return sstream.str(); 251 : 1 : } 252 : : } // namespace std 253 : : 254 : : /*! 255 : : * \brief overload of fmt::formatter calling std::to_string 256 : : */ 257 : : template <> struct fmt::formatter<::ad::rss::core::RelativeConstellation> : formatter<string_view> 258 : : { 259 : 0 : template <typename FormatContext> auto format(::ad::rss::core::RelativeConstellation const &value, FormatContext &ctx) 260 : : { 261 : 0 : return formatter<string_view>::format(std::to_string(value), ctx); 262 : : } 263 : : }; 264 : : 265 : : #endif // GEN_GUARD_AD_RSS_CORE_RELATIVECONSTELLATION