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/state/LateralRssState.hpp" 26 : : #include "ad/rss/state/LongitudinalRssState.hpp" 27 : : #include "ad/rss/state/UnstructuredConstellationRssState.hpp" 28 : : #include "ad/rss/world/ConstellationType.hpp" 29 : : #include "ad/rss/world/ObjectId.hpp" 30 : : /*! 31 : : * @brief namespace ad 32 : : */ 33 : : namespace ad { 34 : : /*! 35 : : * @brief namespace rss 36 : : */ 37 : : namespace rss { 38 : : /*! 39 : : * @brief namespace state 40 : : */ 41 : : namespace state { 42 : : 43 : : /*! 44 : : * \brief DataType RssState 45 : : * 46 : : * Struct defining the RSS state of a single object. 47 : : */ 48 : : struct RssState 49 : : { 50 : : /*! 51 : : * \brief Smart pointer on RssState 52 : : */ 53 : : typedef std::shared_ptr<RssState> Ptr; 54 : : 55 : : /*! 56 : : * \brief Smart pointer on constant RssState 57 : : */ 58 : : typedef std::shared_ptr<RssState const> ConstPtr; 59 : : 60 : : /*! 61 : : * \brief standard constructor 62 : : */ 63 : 67344 : RssState() = default; 64 : : 65 : : /*! 66 : : * \brief standard destructor 67 : : */ 68 : 193954 : ~RssState() = default; 69 : : 70 : : /*! 71 : : * \brief standard copy constructor 72 : : */ 73 : 58134 : RssState(const RssState &other) = default; 74 : : 75 : : /*! 76 : : * \brief standard move constructor 77 : : */ 78 : 68476 : RssState(RssState &&other) = default; 79 : : 80 : : /** 81 : : * \brief standard assignment operator 82 : : * 83 : : * \param[in] other Other RssState 84 : : * 85 : : * \returns Reference to this RssState. 86 : : */ 87 : 16 : RssState &operator=(const RssState &other) = default; 88 : : 89 : : /** 90 : : * \brief standard move operator 91 : : * 92 : : * \param[in] other Other RssState 93 : : * 94 : : * \returns Reference to this RssState. 95 : : */ 96 : 142 : RssState &operator=(RssState &&other) = default; 97 : : 98 : : /** 99 : : * \brief standard comparison operator 100 : : * 101 : : * \param[in] other Other RssState 102 : : * 103 : : * \returns \c true if both RssState are equal 104 : : */ 105 : 32 : bool operator==(const RssState &other) const 106 : : { 107 [ + + + + ]: 28 : return (ego_id == other.ego_id) && (object_id == other.object_id) && (constellation_id == other.constellation_id) 108 [ + + + + ]: 24 : && (longitudinal_state == other.longitudinal_state) && (lateral_state_right == other.lateral_state_right) 109 [ + + ]: 20 : && (lateral_state_left == other.lateral_state_left) 110 [ + + ]: 18 : && (unstructured_constellation_state == other.unstructured_constellation_state) 111 [ + + + + ]: 60 : && (constellation_type == other.constellation_type); 112 : : } 113 : : 114 : : /** 115 : : * \brief standard comparison operator 116 : : * 117 : : * \param[in] other Other RssState. 118 : : * 119 : : * \returns \c true if both RssState are different 120 : : */ 121 : 9 : bool operator!=(const RssState &other) const 122 : : { 123 : 9 : return !operator==(other); 124 : : } 125 : : 126 : : /*! 127 : : * Defines the unique id of the ego. This id has to be constant over time. 128 : : */ 129 : : ::ad::rss::world::ObjectId ego_id{0}; 130 : : 131 : : /*! 132 : : * Defines the unique id of an object. This id has to be constant over time for the same object. 133 : : */ 134 : : ::ad::rss::world::ObjectId object_id; 135 : : 136 : : /*! 137 : : * Id of the constellation this state refers to. 138 : : * The id has to remain unique over time representing the constellation (ego-vehicle 139 : : * / object pair) under investigation. 140 : : * It is used to track the state of the ego-vehicle / object constellation i.e. at 141 : : * point of danger threshold time. 142 : : */ 143 : : ::ad::rss::core::RelativeConstellationId constellation_id{0u}; 144 : : 145 : : /*! 146 : : * The current longitudinal rss state. 147 : : */ 148 : : ::ad::rss::state::LongitudinalRssState longitudinal_state; 149 : : 150 : : /*! 151 : : * The current lateral rss state at right side in respect to ego-vehicle driving direction. 152 : : */ 153 : : ::ad::rss::state::LateralRssState lateral_state_right; 154 : : 155 : : /*! 156 : : * The current lateral rss state at left side in respect to ego-vehicle driving direction. 157 : : */ 158 : : ::ad::rss::state::LateralRssState lateral_state_left; 159 : : 160 : : /*! 161 : : * The state of the unstructured constellation. 162 : : */ 163 : : ::ad::rss::state::UnstructuredConstellationRssState unstructured_constellation_state; 164 : : 165 : : /*! 166 : : * This type of constellation this RssState was calculated on. 167 : : */ 168 : : ::ad::rss::world::ConstellationType constellation_type; 169 : : }; 170 : : 171 : : } // namespace state 172 : : } // namespace rss 173 : : } // namespace ad 174 : : 175 : : /*! 176 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 177 : : */ 178 : : #ifndef GEN_GUARD_AD_RSS_STATE_RSSSTATE 179 : : #define GEN_GUARD_AD_RSS_STATE_RSSSTATE 180 : : /*! 181 : : * @brief namespace ad 182 : : */ 183 : : namespace ad { 184 : : /*! 185 : : * @brief namespace rss 186 : : */ 187 : : namespace rss { 188 : : /*! 189 : : * @brief namespace state 190 : : */ 191 : : namespace state { 192 : : 193 : : /** 194 : : * \brief standard ostream operator 195 : : * 196 : : * \param[in] os The output stream to write to 197 : : * \param[in] _value RssState value 198 : : * 199 : : * \returns The stream object. 200 : : * 201 : : */ 202 : 4 : inline std::ostream &operator<<(std::ostream &os, RssState const &_value) 203 : : { 204 : 4 : os << "RssState("; 205 : 4 : os << "ego_id:"; 206 : 4 : os << _value.ego_id; 207 : 4 : os << ","; 208 : 4 : os << "object_id:"; 209 : 4 : os << _value.object_id; 210 : 4 : os << ","; 211 : 4 : os << "constellation_id:"; 212 : 4 : os << _value.constellation_id; 213 : 4 : os << ","; 214 : 4 : os << "longitudinal_state:"; 215 : 4 : os << _value.longitudinal_state; 216 : 4 : os << ","; 217 : 4 : os << "lateral_state_right:"; 218 : 4 : os << _value.lateral_state_right; 219 : 4 : os << ","; 220 : 4 : os << "lateral_state_left:"; 221 : 4 : os << _value.lateral_state_left; 222 : 4 : os << ","; 223 : 4 : os << "unstructured_constellation_state:"; 224 : 4 : os << _value.unstructured_constellation_state; 225 : 4 : os << ","; 226 : 4 : os << "constellation_type:"; 227 : 4 : os << _value.constellation_type; 228 : 4 : os << ")"; 229 : 4 : return os; 230 : : } 231 : : 232 : : } // namespace state 233 : : } // namespace rss 234 : : } // namespace ad 235 : : 236 : : namespace std { 237 : : /*! 238 : : * \brief overload of the std::to_string for RssState 239 : : */ 240 : 1 : inline std::string to_string(::ad::rss::state::RssState const &value) 241 : : { 242 [ + - ]: 1 : stringstream sstream; 243 [ + - ]: 1 : sstream << value; 244 [ + - ]: 2 : return sstream.str(); 245 : 1 : } 246 : : } // namespace std 247 : : 248 : : /*! 249 : : * \brief overload of fmt::formatter calling std::to_string 250 : : */ 251 : : template <> struct fmt::formatter<::ad::rss::state::RssState> : formatter<string_view> 252 : : { 253 : 0 : template <typename FormatContext> auto format(::ad::rss::state::RssState const &value, FormatContext &ctx) 254 : : { 255 : 0 : return formatter<string_view>::format(std::to_string(value), ctx); 256 : : } 257 : : }; 258 : : 259 : : #endif // GEN_GUARD_AD_RSS_STATE_RSSSTATE