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/Distance.hpp" 25 : : #include "ad/rss/world/Velocity.hpp" 26 : : /*! 27 : : * @brief namespace ad 28 : : */ 29 : : namespace ad { 30 : : /*! 31 : : * @brief namespace rss 32 : : */ 33 : : namespace rss { 34 : : /*! 35 : : * @brief namespace core 36 : : */ 37 : : namespace core { 38 : : 39 : : /*! 40 : : * \brief DataType StructuredObjectState 41 : : * 42 : : * The state of an object within the constellation specific lane coordinate system. 43 : : * The state consists of the following components in respect to the constellation lane 44 : : * coordinate system: the velocity, the distance to the intersection (if applicable 45 : : * ), a Right-of-Way priority flag as well as a flag stating if the vehicle is driving 46 : : * in its correct lane. 47 : : */ 48 : : struct StructuredObjectState 49 : : { 50 : : /*! 51 : : * \brief Smart pointer on StructuredObjectState 52 : : */ 53 : : typedef std::shared_ptr<StructuredObjectState> Ptr; 54 : : 55 : : /*! 56 : : * \brief Smart pointer on constant StructuredObjectState 57 : : */ 58 : : typedef std::shared_ptr<StructuredObjectState const> ConstPtr; 59 : : 60 : : /*! 61 : : * \brief standard constructor 62 : : */ 63 : 10805 : StructuredObjectState() = default; 64 : : 65 : : /*! 66 : : * \brief standard destructor 67 : : */ 68 : : ~StructuredObjectState() = default; 69 : : 70 : : /*! 71 : : * \brief standard copy constructor 72 : : */ 73 : : StructuredObjectState(const StructuredObjectState &other) = default; 74 : : 75 : : /*! 76 : : * \brief standard move constructor 77 : : */ 78 : : StructuredObjectState(StructuredObjectState &&other) = default; 79 : : 80 : : /** 81 : : * \brief standard assignment operator 82 : : * 83 : : * \param[in] other Other StructuredObjectState 84 : : * 85 : : * \returns Reference to this StructuredObjectState. 86 : : */ 87 : : StructuredObjectState &operator=(const StructuredObjectState &other) = default; 88 : : 89 : : /** 90 : : * \brief standard move operator 91 : : * 92 : : * \param[in] other Other StructuredObjectState 93 : : * 94 : : * \returns Reference to this StructuredObjectState. 95 : : */ 96 : : StructuredObjectState &operator=(StructuredObjectState &&other) = default; 97 : : 98 : : /** 99 : : * \brief standard comparison operator 100 : : * 101 : : * \param[in] other Other StructuredObjectState 102 : : * 103 : : * \returns \c true if both StructuredObjectState are equal 104 : : */ 105 : 58 : bool operator==(const StructuredObjectState &other) const 106 : : { 107 [ + + ]: 112 : return (velocity == other.velocity) && (has_priority == other.has_priority) 108 [ + + ]: 52 : && (is_in_correct_lane == other.is_in_correct_lane) 109 [ + + ]: 50 : && (distance_to_enter_intersection == other.distance_to_enter_intersection) 110 [ + + + + ]: 112 : && (distance_to_leave_intersection == other.distance_to_leave_intersection); 111 : : } 112 : : 113 : : /** 114 : : * \brief standard comparison operator 115 : : * 116 : : * \param[in] other Other StructuredObjectState. 117 : : * 118 : : * \returns \c true if both StructuredObjectState are different 119 : : */ 120 : 6 : bool operator!=(const StructuredObjectState &other) const 121 : : { 122 : 6 : return !operator==(other); 123 : : } 124 : : 125 : : /*! 126 : : * The constellation specific velocity range. 127 : : */ 128 : : ::ad::rss::world::Velocity velocity; 129 : : 130 : : /*! 131 : : * Flag indicating if the constellation specific Right-of-Way relation. 132 : : */ 133 : : bool has_priority{false}; 134 : : 135 : : /*! 136 : : * Flag indicating if the vehicle driving in the correct lane 137 : : */ 138 : : bool is_in_correct_lane{false}; 139 : : 140 : : /*! 141 : : * The minimum distance to be covered by the vehicle to enter the intersection. 142 : : */ 143 : : ::ad::physics::Distance distance_to_enter_intersection{std::numeric_limits<::ad::physics::Distance>::max()}; 144 : : 145 : : /*! 146 : : * The maximum distance to cover by the vehicle to leave the intersection completely. 147 : : */ 148 : : ::ad::physics::Distance distance_to_leave_intersection{std::numeric_limits<::ad::physics::Distance>::max()}; 149 : : }; 150 : : 151 : : } // namespace core 152 : : } // namespace rss 153 : : } // namespace ad 154 : : 155 : : /*! 156 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 157 : : */ 158 : : #ifndef GEN_GUARD_AD_RSS_CORE_STRUCTUREDOBJECTSTATE 159 : : #define GEN_GUARD_AD_RSS_CORE_STRUCTUREDOBJECTSTATE 160 : : /*! 161 : : * @brief namespace ad 162 : : */ 163 : : namespace ad { 164 : : /*! 165 : : * @brief namespace rss 166 : : */ 167 : : namespace rss { 168 : : /*! 169 : : * @brief namespace core 170 : : */ 171 : : namespace core { 172 : : 173 : : /** 174 : : * \brief standard ostream operator 175 : : * 176 : : * \param[in] os The output stream to write to 177 : : * \param[in] _value StructuredObjectState value 178 : : * 179 : : * \returns The stream object. 180 : : * 181 : : */ 182 : 12 : inline std::ostream &operator<<(std::ostream &os, StructuredObjectState const &_value) 183 : : { 184 : 12 : os << "StructuredObjectState("; 185 : 12 : os << "velocity:"; 186 : 12 : os << _value.velocity; 187 : 12 : os << ","; 188 : 12 : os << "has_priority:"; 189 : 12 : os << _value.has_priority; 190 : 12 : os << ","; 191 : 12 : os << "is_in_correct_lane:"; 192 : 12 : os << _value.is_in_correct_lane; 193 : 12 : os << ","; 194 : 12 : os << "distance_to_enter_intersection:"; 195 : 12 : os << _value.distance_to_enter_intersection; 196 : 12 : os << ","; 197 : 12 : os << "distance_to_leave_intersection:"; 198 : 12 : os << _value.distance_to_leave_intersection; 199 : 12 : os << ")"; 200 : 12 : return os; 201 : : } 202 : : 203 : : } // namespace core 204 : : } // namespace rss 205 : : } // namespace ad 206 : : 207 : : namespace std { 208 : : /*! 209 : : * \brief overload of the std::to_string for StructuredObjectState 210 : : */ 211 : 1 : inline std::string to_string(::ad::rss::core::StructuredObjectState const &value) 212 : : { 213 [ + - ]: 1 : stringstream sstream; 214 [ + - ]: 1 : sstream << value; 215 [ + - ]: 2 : return sstream.str(); 216 : 1 : } 217 : : } // namespace std 218 : : 219 : : /*! 220 : : * \brief overload of fmt::formatter calling std::to_string 221 : : */ 222 : : template <> struct fmt::formatter<::ad::rss::core::StructuredObjectState> : formatter<string_view> 223 : : { 224 : 0 : template <typename FormatContext> auto format(::ad::rss::core::StructuredObjectState const &value, FormatContext &ctx) 225 : : { 226 : 0 : return formatter<string_view>::format(std::to_string(value), ctx); 227 : : } 228 : : }; 229 : : 230 : : #endif // GEN_GUARD_AD_RSS_CORE_STRUCTUREDOBJECTSTATE