LCOV - code coverage report
Current view: top level - generated/include/ad/rss/state - ProperResponse.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 47 47 100.0 %
Date: 2024-05-08 22:46:37 Functions: 10 10 100.0 %
Branches: 22 26 84.6 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2020 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-1997
      16                 :            :  */
      17                 :            : 
      18                 :            : #pragma once
      19                 :            : 
      20                 :            : #include <iostream>
      21                 :            : #include <limits>
      22                 :            : #include <memory>
      23                 :            : #include <sstream>
      24                 :            : #include "ad/rss/state/AccelerationRestriction.hpp"
      25                 :            : #include "ad/rss/state/HeadingRangeVector.hpp"
      26                 :            : #include "ad/rss/state/LateralResponse.hpp"
      27                 :            : #include "ad/rss/state/LongitudinalResponse.hpp"
      28                 :            : #include "ad/rss/state/UnstructuredSceneResponse.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 proper response, RSS calculated from the RssStateSnapshots received over time, consists of a timeIndex and the
      48                 :            :  * resulting Rss responses.
      49                 :            :  */
      50                 :         17 : struct ProperResponse
      51                 :            : {
      52                 :            :   /*!
      53                 :            :    * \brief Smart pointer on ProperResponse
      54                 :            :    */
      55                 :            :   typedef std::shared_ptr<ProperResponse> Ptr;
      56                 :            : 
      57                 :            :   /*!
      58                 :            :    * \brief Smart pointer on constant ProperResponse
      59                 :            :    */
      60                 :            :   typedef std::shared_ptr<ProperResponse const> ConstPtr;
      61                 :            : 
      62                 :            :   /*!
      63                 :            :    * \brief standard constructor
      64                 :            :    */
      65                 :        808 :   ProperResponse() = default;
      66                 :            : 
      67                 :            :   /*!
      68                 :            :    * \brief standard destructor
      69                 :            :    */
      70                 :        832 :   ~ProperResponse() = default;
      71                 :            : 
      72                 :            :   /*!
      73                 :            :    * \brief standard copy constructor
      74                 :            :    */
      75         [ +  - ]:         23 :   ProperResponse(const ProperResponse &other) = default;
      76                 :            : 
      77                 :            :   /*!
      78                 :            :    * \brief standard move constructor
      79                 :            :    */
      80                 :          1 :   ProperResponse(ProperResponse &&other) = default;
      81                 :            : 
      82                 :            :   /**
      83                 :            :    * \brief standard assignment operator
      84                 :            :    *
      85                 :            :    * \param[in] other Other ProperResponse
      86                 :            :    *
      87                 :            :    * \returns Reference to this ProperResponse.
      88                 :            :    */
      89                 :            :   ProperResponse &operator=(const ProperResponse &other) = default;
      90                 :            : 
      91                 :            :   /**
      92                 :            :    * \brief standard move operator
      93                 :            :    *
      94                 :            :    * \param[in] other Other ProperResponse
      95                 :            :    *
      96                 :            :    * \returns Reference to this ProperResponse.
      97                 :            :    */
      98                 :            :   ProperResponse &operator=(ProperResponse &&other) = default;
      99                 :            : 
     100                 :            :   /**
     101                 :            :    * \brief standard comparison operator
     102                 :            :    *
     103                 :            :    * \param[in] other Other ProperResponse
     104                 :            :    *
     105                 :            :    * \returns \c true if both ProperResponse are equal
     106                 :            :    */
     107                 :         24 :   bool operator==(const ProperResponse &other) const
     108                 :            :   {
     109   [ +  +  +  + ]:         22 :     return (timeIndex == other.timeIndex) && (isSafe == other.isSafe) && (dangerousObjects == other.dangerousObjects)
     110   [ +  +  +  + ]:         18 :       && (longitudinalResponse == other.longitudinalResponse) && (lateralResponseRight == other.lateralResponseRight)
     111   [ +  +  +  + ]:         14 :       && (lateralResponseLeft == other.lateralResponseLeft) && (headingRanges == other.headingRanges)
     112         [ +  + ]:         10 :       && (accelerationRestrictions == other.accelerationRestrictions)
     113   [ +  +  +  + ]:         46 :       && (unstructuredSceneResponse == other.unstructuredSceneResponse);
     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 timeIndex{0u};
     134                 :            : 
     135                 :            :   /*!
     136                 :            :    * Flag to indicate if the state is longitudinal safe.
     137                 :            :    */
     138                 :            :   bool isSafe{false};
     139                 :            : 
     140                 :            :   /*!
     141                 :            :    * List of dangerous objects.
     142                 :            :    */
     143                 :            :   ::ad::rss::world::ObjectIdVector dangerousObjects;
     144                 :            : 
     145                 :            :   /*!
     146                 :            :    * The current longitudinal rss state.
     147                 :            :    */
     148                 :            :   ::ad::rss::state::LongitudinalResponse longitudinalResponse;
     149                 :            : 
     150                 :            :   /*!
     151                 :            :    * The current lateral rss state at right side in respect to ego-vehicle driving direction.
     152                 :            :    */
     153                 :            :   ::ad::rss::state::LateralResponse lateralResponseRight;
     154                 :            : 
     155                 :            :   /*!
     156                 :            :    * The current lateral rss state at left side in respect to ego-vehicle driving direction.
     157                 :            :    */
     158                 :            :   ::ad::rss::state::LateralResponse lateralResponseLeft;
     159                 :            : 
     160                 :            :   /*!
     161                 :            :    * The vector of allowed heading ranges to be applied in the unstructured drive away case after considering all
     162                 :            :    * unstructured scenes.
     163                 :            :    */
     164                 :            :   ::ad::rss::state::HeadingRangeVector headingRanges;
     165                 :            : 
     166                 :            :   /*!
     167                 :            :    * The resulting acceleration restrictions after considering all individual RSS constellations.
     168                 :            :    */
     169                 :            :   ::ad::rss::state::AccelerationRestriction accelerationRestrictions;
     170                 :            : 
     171                 :            :   /*!
     172                 :            :    * The unstructured scene response considered within this proper response.
     173                 :            :    */
     174                 :            :   ::ad::rss::state::UnstructuredSceneResponse unstructuredSceneResponse;
     175                 :            : };
     176                 :            : 
     177                 :            : } // namespace state
     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_STATE_PROPERRESPONSE
     185                 :            : #define GEN_GUARD_AD_RSS_STATE_PROPERRESPONSE
     186                 :            : /*!
     187                 :            :  * @brief namespace ad
     188                 :            :  */
     189                 :            : namespace ad {
     190                 :            : /*!
     191                 :            :  * @brief namespace rss
     192                 :            :  */
     193                 :            : namespace rss {
     194                 :            : /*!
     195                 :            :  * @brief namespace state
     196                 :            :  */
     197                 :            : namespace state {
     198                 :            : 
     199                 :            : /**
     200                 :            :  * \brief standard ostream operator
     201                 :            :  *
     202                 :            :  * \param[in] os The output stream to write to
     203                 :            :  * \param[in] _value ProperResponse value
     204                 :            :  *
     205                 :            :  * \returns The stream object.
     206                 :            :  *
     207                 :            :  */
     208                 :         12 : inline std::ostream &operator<<(std::ostream &os, ProperResponse const &_value)
     209                 :            : {
     210                 :         12 :   os << "ProperResponse(";
     211                 :         12 :   os << "timeIndex:";
     212                 :         12 :   os << _value.timeIndex;
     213                 :         12 :   os << ",";
     214                 :         12 :   os << "isSafe:";
     215                 :         12 :   os << _value.isSafe;
     216                 :         12 :   os << ",";
     217                 :         12 :   os << "dangerousObjects:";
     218                 :         12 :   os << _value.dangerousObjects;
     219                 :         12 :   os << ",";
     220                 :         12 :   os << "longitudinalResponse:";
     221                 :         12 :   os << _value.longitudinalResponse;
     222                 :         12 :   os << ",";
     223                 :         12 :   os << "lateralResponseRight:";
     224                 :         12 :   os << _value.lateralResponseRight;
     225                 :         12 :   os << ",";
     226                 :         12 :   os << "lateralResponseLeft:";
     227                 :         12 :   os << _value.lateralResponseLeft;
     228                 :         12 :   os << ",";
     229                 :         12 :   os << "headingRanges:";
     230                 :         12 :   os << _value.headingRanges;
     231                 :         12 :   os << ",";
     232                 :         12 :   os << "accelerationRestrictions:";
     233                 :         12 :   os << _value.accelerationRestrictions;
     234                 :         12 :   os << ",";
     235                 :         12 :   os << "unstructuredSceneResponse:";
     236                 :         12 :   os << _value.unstructuredSceneResponse;
     237                 :         12 :   os << ")";
     238                 :         12 :   return os;
     239                 :            : }
     240                 :            : 
     241                 :            : } // namespace state
     242                 :            : } // namespace rss
     243                 :            : } // namespace ad
     244                 :            : 
     245                 :            : namespace std {
     246                 :            : /*!
     247                 :            :  * \brief overload of the std::to_string for ProperResponse
     248                 :            :  */
     249                 :          1 : inline std::string to_string(::ad::rss::state::ProperResponse const &value)
     250                 :            : {
     251         [ +  - ]:          2 :   stringstream sstream;
     252         [ +  - ]:          1 :   sstream << value;
     253         [ +  - ]:          2 :   return sstream.str();
     254                 :            : }
     255                 :            : } // namespace std
     256                 :            : #endif // GEN_GUARD_AD_RSS_STATE_PROPERRESPONSE

Generated by: LCOV version 1.14