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/world/ConstellationVector.hpp" 25 : : #include "ad/rss/world/RssDynamics.hpp" 26 : : #include "ad/rss/world/TimeIndex.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 WorldModel 42 : : * 43 : : * The world model RSS requires as input describing a situation consisting of a time_index, the ego_vehicle_dynamics and 44 : : * object description as well as the list of relevant constellations. 45 : : */ 46 : : struct WorldModel 47 : : { 48 : : /*! 49 : : * \brief Smart pointer on WorldModel 50 : : */ 51 : : typedef std::shared_ptr<WorldModel> Ptr; 52 : : 53 : : /*! 54 : : * \brief Smart pointer on constant WorldModel 55 : : */ 56 : : typedef std::shared_ptr<WorldModel const> ConstPtr; 57 : : 58 : : /*! 59 : : * \brief standard constructor 60 : : */ 61 : 764 : WorldModel() = default; 62 : : 63 : : /*! 64 : : * \brief standard destructor 65 : : */ 66 : 776 : ~WorldModel() = default; 67 : : 68 : : /*! 69 : : * \brief standard copy constructor 70 : : */ 71 : 11 : WorldModel(const WorldModel &other) = default; 72 : : 73 : : /*! 74 : : * \brief standard move constructor 75 : : */ 76 : 1 : WorldModel(WorldModel &&other) = default; 77 : : 78 : : /** 79 : : * \brief standard assignment operator 80 : : * 81 : : * \param[in] other Other WorldModel 82 : : * 83 : : * \returns Reference to this WorldModel. 84 : : */ 85 : 10 : WorldModel &operator=(const WorldModel &other) = default; 86 : : 87 : : /** 88 : : * \brief standard move operator 89 : : * 90 : : * \param[in] other Other WorldModel 91 : : * 92 : : * \returns Reference to this WorldModel. 93 : : */ 94 : 1 : WorldModel &operator=(WorldModel &&other) = default; 95 : : 96 : : /** 97 : : * \brief standard comparison operator 98 : : * 99 : : * \param[in] other Other WorldModel 100 : : * 101 : : * \returns \c true if both WorldModel are equal 102 : : */ 103 : 12 : bool operator==(const WorldModel &other) const 104 : : { 105 : 12 : return (time_index == other.time_index) 106 [ + + ]: 10 : && (default_ego_vehicle_rss_dynamics == other.default_ego_vehicle_rss_dynamics) 107 [ + + + + ]: 22 : && (constellations == other.constellations); 108 : : } 109 : : 110 : : /** 111 : : * \brief standard comparison operator 112 : : * 113 : : * \param[in] other Other WorldModel. 114 : : * 115 : : * \returns \c true if both WorldModel are different 116 : : */ 117 : 4 : bool operator!=(const WorldModel &other) const 118 : : { 119 : 4 : return !operator==(other); 120 : : } 121 : : 122 : : /*! 123 : : * The time index is required to distinguish different points in time when tracking states or transforming responses 124 : : * back. Each world model referring to another point in time should get another time index. The time index of the 125 : : * world model must not be zero. 126 : : */ 127 : : ::ad::rss::world::TimeIndex time_index{0u}; 128 : : 129 : : /*! 130 : : * Defines the standard ego vehicle dynamics to be applied i.e. when there is no dangerous 131 : : * constellation. 132 : : * This parameters are provided in addtion on a per constellation basis to be able 133 : : * to adapt these e.g. in respect to object type or the weather conditions 134 : : */ 135 : : ::ad::rss::world::RssDynamics default_ego_vehicle_rss_dynamics; 136 : : 137 : : /*! 138 : : * All constellations. 139 : : */ 140 : : ::ad::rss::world::ConstellationVector constellations; 141 : : }; 142 : : 143 : : } // namespace world 144 : : } // namespace rss 145 : : } // namespace ad 146 : : 147 : : /*! 148 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 149 : : */ 150 : : #ifndef GEN_GUARD_AD_RSS_WORLD_WORLDMODEL 151 : : #define GEN_GUARD_AD_RSS_WORLD_WORLDMODEL 152 : : /*! 153 : : * @brief namespace ad 154 : : */ 155 : : namespace ad { 156 : : /*! 157 : : * @brief namespace rss 158 : : */ 159 : : namespace rss { 160 : : /*! 161 : : * @brief namespace world 162 : : */ 163 : : namespace world { 164 : : 165 : : /** 166 : : * \brief standard ostream operator 167 : : * 168 : : * \param[in] os The output stream to write to 169 : : * \param[in] _value WorldModel value 170 : : * 171 : : * \returns The stream object. 172 : : * 173 : : */ 174 : 2 : inline std::ostream &operator<<(std::ostream &os, WorldModel const &_value) 175 : : { 176 : 2 : os << "WorldModel("; 177 : 2 : os << "time_index:"; 178 : 2 : os << _value.time_index; 179 : 2 : os << ","; 180 : 2 : os << "default_ego_vehicle_rss_dynamics:"; 181 : 2 : os << _value.default_ego_vehicle_rss_dynamics; 182 : 2 : os << ","; 183 : 2 : os << "constellations:"; 184 : 2 : os << _value.constellations; 185 : 2 : os << ")"; 186 : 2 : return os; 187 : : } 188 : : 189 : : } // namespace world 190 : : } // namespace rss 191 : : } // namespace ad 192 : : 193 : : namespace std { 194 : : /*! 195 : : * \brief overload of the std::to_string for WorldModel 196 : : */ 197 : 1 : inline std::string to_string(::ad::rss::world::WorldModel const &value) 198 : : { 199 [ + - ]: 1 : stringstream sstream; 200 [ + - ]: 1 : sstream << value; 201 [ + - ]: 2 : return sstream.str(); 202 : 1 : } 203 : : } // namespace std 204 : : 205 : : /*! 206 : : * \brief overload of fmt::formatter calling std::to_string 207 : : */ 208 : : template <> struct fmt::formatter<::ad::rss::world::WorldModel> : formatter<string_view> 209 : : { 210 : 0 : template <typename FormatContext> auto format(::ad::rss::world::WorldModel const &value, FormatContext &ctx) 211 : : { 212 : 0 : return formatter<string_view>::format(std::to_string(value), ctx); 213 : : } 214 : : }; 215 : : 216 : : #endif // GEN_GUARD_AD_RSS_WORLD_WORLDMODEL