LCOV - code coverage report
Current view: top level - generated/include/ad/rss/state - ProperResponse.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 50 52 96.2 %
Date: 2025-07-22 06:53:46 Functions: 10 11 90.9 %
Branches: 22 28 78.6 %

           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/geometry/HeadingRangeVector.hpp"
      25                 :            : #include "ad/rss/state/AccelerationRestriction.hpp"
      26                 :            : #include "ad/rss/state/LateralResponse.hpp"
      27                 :            : #include "ad/rss/state/LongitudinalResponse.hpp"
      28                 :            : #include "ad/rss/state/UnstructuredConstellationResponse.hpp"
      29                 :            : #include "ad/rss/world/ObjectIdVector.hpp"
      30                 :            : #include "ad/rss/world/TimeIndex.hpp"
      31                 :            : /*!
      32                 :            :  * @brief namespace ad
      33                 :            :  */
      34                 :            : namespace ad {
      35                 :            : /*!
      36                 :            :  * @brief namespace rss
      37                 :            :  */
      38                 :            : namespace rss {
      39                 :            : /*!
      40                 :            :  * @brief namespace state
      41                 :            :  */
      42                 :            : namespace state {
      43                 :            : 
      44                 :            : /*!
      45                 :            :  * \brief DataType ProperResponse
      46                 :            :  *
      47                 :            :  * The overall proper response RSS calculated from the individual responses of the RssStateSnapshot.
      48                 :            :  */
      49                 :            : struct ProperResponse
      50                 :            : {
      51                 :            :   /*!
      52                 :            :    * \brief Smart pointer on ProperResponse
      53                 :            :    */
      54                 :            :   typedef std::shared_ptr<ProperResponse> Ptr;
      55                 :            : 
      56                 :            :   /*!
      57                 :            :    * \brief Smart pointer on constant ProperResponse
      58                 :            :    */
      59                 :            :   typedef std::shared_ptr<ProperResponse const> ConstPtr;
      60                 :            : 
      61                 :            :   /*!
      62                 :            :    * \brief standard constructor
      63                 :            :    */
      64         [ #  # ]:        807 :   ProperResponse() = default;
      65                 :            : 
      66                 :            :   /*!
      67                 :            :    * \brief standard destructor
      68                 :            :    */
      69                 :        831 :   ~ProperResponse() = default;
      70                 :            : 
      71                 :            :   /*!
      72                 :            :    * \brief standard copy constructor
      73                 :            :    */
      74         [ +  - ]:         23 :   ProperResponse(const ProperResponse &other) = default;
      75                 :            : 
      76                 :            :   /*!
      77                 :            :    * \brief standard move constructor
      78                 :            :    */
      79                 :          1 :   ProperResponse(ProperResponse &&other) = default;
      80                 :            : 
      81                 :            :   /**
      82                 :            :    * \brief standard assignment operator
      83                 :            :    *
      84                 :            :    * \param[in] other Other ProperResponse
      85                 :            :    *
      86                 :            :    * \returns Reference to this ProperResponse.
      87                 :            :    */
      88                 :         16 :   ProperResponse &operator=(const ProperResponse &other) = default;
      89                 :            : 
      90                 :            :   /**
      91                 :            :    * \brief standard move operator
      92                 :            :    *
      93                 :            :    * \param[in] other Other ProperResponse
      94                 :            :    *
      95                 :            :    * \returns Reference to this ProperResponse.
      96                 :            :    */
      97                 :          1 :   ProperResponse &operator=(ProperResponse &&other) = default;
      98                 :            : 
      99                 :            :   /**
     100                 :            :    * \brief standard comparison operator
     101                 :            :    *
     102                 :            :    * \param[in] other Other ProperResponse
     103                 :            :    *
     104                 :            :    * \returns \c true if both ProperResponse are equal
     105                 :            :    */
     106                 :         24 :   bool operator==(const ProperResponse &other) const
     107                 :            :   {
     108         [ +  + ]:         22 :     return (time_index == other.time_index) && (is_safe == other.is_safe)
     109   [ +  +  +  + ]:         20 :       && (dangerous_objects == other.dangerous_objects) && (longitudinal_response == other.longitudinal_response)
     110         [ +  + ]:         16 :       && (lateral_response_right == other.lateral_response_right)
     111   [ +  +  +  + ]:         14 :       && (lateral_response_left == other.lateral_response_left) && (heading_ranges == other.heading_ranges)
     112         [ +  + ]:         10 :       && (acceleration_restrictions == other.acceleration_restrictions)
     113   [ +  +  +  + ]:         46 :       && (unstructured_constellation_response == other.unstructured_constellation_response);
     114                 :            :   }
     115                 :            : 
     116                 :            :   /**
     117                 :            :    * \brief standard comparison operator
     118                 :            :    *
     119                 :            :    * \param[in] other Other ProperResponse.
     120                 :            :    *
     121                 :            :    * \returns \c true if both ProperResponse are different
     122                 :            :    */
     123                 :         10 :   bool operator!=(const ProperResponse &other) const
     124                 :            :   {
     125                 :         10 :     return !operator==(other);
     126                 :            :   }
     127                 :            : 
     128                 :            :   /*!
     129                 :            :    * The time index is required to distinguish different points in time when tracking states or transforming responses
     130                 :            :    * back. Each world model referring to another point in time should get another time index. The time index of the
     131                 :            :    * world model must not be zero.
     132                 :            :    */
     133                 :            :   ::ad::rss::world::TimeIndex time_index{0u};
     134                 :            : 
     135                 :            :   /*!
     136                 :            :    * Flag to indicate if the state is safe. This is true if all of the individual_responses of the RssStateSnapshot have
     137                 :            :    * been safe.
     138                 :            :    */
     139                 :            :   bool is_safe{false};
     140                 :            : 
     141                 :            :   /*!
     142                 :            :    * List of dangerous objects.
     143                 :            :    */
     144                 :            :   ::ad::rss::world::ObjectIdVector dangerous_objects;
     145                 :            : 
     146                 :            :   /*!
     147                 :            :    * The current longitudinal rss state.
     148                 :            :    */
     149                 :            :   ::ad::rss::state::LongitudinalResponse longitudinal_response;
     150                 :            : 
     151                 :            :   /*!
     152                 :            :    * The current lateral rss state at right side in respect to ego-vehicle driving direction.
     153                 :            :    */
     154                 :            :   ::ad::rss::state::LateralResponse lateral_response_right;
     155                 :            : 
     156                 :            :   /*!
     157                 :            :    * The current lateral rss state at left side in respect to ego-vehicle driving direction.
     158                 :            :    */
     159                 :            :   ::ad::rss::state::LateralResponse lateral_response_left;
     160                 :            : 
     161                 :            :   /*!
     162                 :            :    * The vector of allowed heading ranges to be applied in the unstructured drive away case after considering all
     163                 :            :    * unstructured constellations.
     164                 :            :    */
     165                 :            :   ::ad::geometry::HeadingRangeVector heading_ranges;
     166                 :            : 
     167                 :            :   /*!
     168                 :            :    * The resulting acceleration restrictions after considering all individual RSS constellations.
     169                 :            :    */
     170                 :            :   ::ad::rss::state::AccelerationRestriction acceleration_restrictions;
     171                 :            : 
     172                 :            :   /*!
     173                 :            :    * The unstructured constellation response considered within this proper response.
     174                 :            :    */
     175                 :            :   ::ad::rss::state::UnstructuredConstellationResponse unstructured_constellation_response;
     176                 :            : };
     177                 :            : 
     178                 :            : } // namespace state
     179                 :            : } // namespace rss
     180                 :            : } // namespace ad
     181                 :            : 
     182                 :            : /*!
     183                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     184                 :            :  */
     185                 :            : #ifndef GEN_GUARD_AD_RSS_STATE_PROPERRESPONSE
     186                 :            : #define GEN_GUARD_AD_RSS_STATE_PROPERRESPONSE
     187                 :            : /*!
     188                 :            :  * @brief namespace ad
     189                 :            :  */
     190                 :            : namespace ad {
     191                 :            : /*!
     192                 :            :  * @brief namespace rss
     193                 :            :  */
     194                 :            : namespace rss {
     195                 :            : /*!
     196                 :            :  * @brief namespace state
     197                 :            :  */
     198                 :            : namespace state {
     199                 :            : 
     200                 :            : /**
     201                 :            :  * \brief standard ostream operator
     202                 :            :  *
     203                 :            :  * \param[in] os The output stream to write to
     204                 :            :  * \param[in] _value ProperResponse value
     205                 :            :  *
     206                 :            :  * \returns The stream object.
     207                 :            :  *
     208                 :            :  */
     209                 :          2 : inline std::ostream &operator<<(std::ostream &os, ProperResponse const &_value)
     210                 :            : {
     211                 :          2 :   os << "ProperResponse(";
     212                 :          2 :   os << "time_index:";
     213                 :          2 :   os << _value.time_index;
     214                 :          2 :   os << ",";
     215                 :          2 :   os << "is_safe:";
     216                 :          2 :   os << _value.is_safe;
     217                 :          2 :   os << ",";
     218                 :          2 :   os << "dangerous_objects:";
     219                 :          2 :   os << _value.dangerous_objects;
     220                 :          2 :   os << ",";
     221                 :          2 :   os << "longitudinal_response:";
     222                 :          2 :   os << _value.longitudinal_response;
     223                 :          2 :   os << ",";
     224                 :          2 :   os << "lateral_response_right:";
     225                 :          2 :   os << _value.lateral_response_right;
     226                 :          2 :   os << ",";
     227                 :          2 :   os << "lateral_response_left:";
     228                 :          2 :   os << _value.lateral_response_left;
     229                 :          2 :   os << ",";
     230                 :          2 :   os << "heading_ranges:";
     231                 :          2 :   os << _value.heading_ranges;
     232                 :          2 :   os << ",";
     233                 :          2 :   os << "acceleration_restrictions:";
     234                 :          2 :   os << _value.acceleration_restrictions;
     235                 :          2 :   os << ",";
     236                 :          2 :   os << "unstructured_constellation_response:";
     237                 :          2 :   os << _value.unstructured_constellation_response;
     238                 :          2 :   os << ")";
     239                 :          2 :   return os;
     240                 :            : }
     241                 :            : 
     242                 :            : } // namespace state
     243                 :            : } // namespace rss
     244                 :            : } // namespace ad
     245                 :            : 
     246                 :            : namespace std {
     247                 :            : /*!
     248                 :            :  * \brief overload of the std::to_string for ProperResponse
     249                 :            :  */
     250                 :          1 : inline std::string to_string(::ad::rss::state::ProperResponse const &value)
     251                 :            : {
     252         [ +  - ]:          1 :   stringstream sstream;
     253         [ +  - ]:          1 :   sstream << value;
     254         [ +  - ]:          2 :   return sstream.str();
     255                 :          1 : }
     256                 :            : } // namespace std
     257                 :            : 
     258                 :            : /*!
     259                 :            :  * \brief overload of fmt::formatter calling std::to_string
     260                 :            :  */
     261                 :            : template <> struct fmt::formatter<::ad::rss::state::ProperResponse> : formatter<string_view>
     262                 :            : {
     263                 :          0 :   template <typename FormatContext> auto format(::ad::rss::state::ProperResponse const &value, FormatContext &ctx)
     264                 :            :   {
     265                 :          0 :     return formatter<string_view>::format(std::to_string(value), ctx);
     266                 :            :   }
     267                 :            : };
     268                 :            : 
     269                 :            : #endif // GEN_GUARD_AD_RSS_STATE_PROPERRESPONSE

Generated by: LCOV version 1.14