LCOV - code coverage report
Current view: top level - generated/include/ad/rss/situation - SituationSnapshot.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 26 26 100.0 %
Date: 2024-04-16 14:13:10 Functions: 10 10 100.0 %
Branches: 9 12 75.0 %

           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/situation/SituationVector.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 situation
      37                 :            :  */
      38                 :            : namespace situation {
      39                 :            : 
      40                 :            : /*!
      41                 :            :  * \brief DataType SituationSnapshot
      42                 :            :  *
      43                 :            :  * A snashot in time of the current situations RSS extracted from the WorldModel.
      44                 :            :  */
      45                 :         11 : struct SituationSnapshot
      46                 :            : {
      47                 :            :   /*!
      48                 :            :    * \brief Smart pointer on SituationSnapshot
      49                 :            :    */
      50                 :            :   typedef std::shared_ptr<SituationSnapshot> Ptr;
      51                 :            : 
      52                 :            :   /*!
      53                 :            :    * \brief Smart pointer on constant SituationSnapshot
      54                 :            :    */
      55                 :            :   typedef std::shared_ptr<SituationSnapshot const> ConstPtr;
      56                 :            : 
      57                 :            :   /*!
      58                 :            :    * \brief standard constructor
      59                 :            :    */
      60                 :       4404 :   SituationSnapshot() = default;
      61                 :            : 
      62                 :            :   /*!
      63                 :            :    * \brief standard destructor
      64                 :            :    */
      65                 :       4416 :   ~SituationSnapshot() = default;
      66                 :            : 
      67                 :            :   /*!
      68                 :            :    * \brief standard copy constructor
      69                 :            :    */
      70                 :         11 :   SituationSnapshot(const SituationSnapshot &other) = default;
      71                 :            : 
      72                 :            :   /*!
      73                 :            :    * \brief standard move constructor
      74                 :            :    */
      75                 :          1 :   SituationSnapshot(SituationSnapshot &&other) = default;
      76                 :            : 
      77                 :            :   /**
      78                 :            :    * \brief standard assignment operator
      79                 :            :    *
      80                 :            :    * \param[in] other Other SituationSnapshot
      81                 :            :    *
      82                 :            :    * \returns Reference to this SituationSnapshot.
      83                 :            :    */
      84                 :            :   SituationSnapshot &operator=(const SituationSnapshot &other) = default;
      85                 :            : 
      86                 :            :   /**
      87                 :            :    * \brief standard move operator
      88                 :            :    *
      89                 :            :    * \param[in] other Other SituationSnapshot
      90                 :            :    *
      91                 :            :    * \returns Reference to this SituationSnapshot.
      92                 :            :    */
      93                 :            :   SituationSnapshot &operator=(SituationSnapshot &&other) = default;
      94                 :            : 
      95                 :            :   /**
      96                 :            :    * \brief standard comparison operator
      97                 :            :    *
      98                 :            :    * \param[in] other Other SituationSnapshot
      99                 :            :    *
     100                 :            :    * \returns \c true if both SituationSnapshot are equal
     101                 :            :    */
     102                 :         12 :   bool operator==(const SituationSnapshot &other) const
     103                 :            :   {
     104         [ +  + ]:         10 :     return (timeIndex == other.timeIndex) && (defaultEgoVehicleRssDynamics == other.defaultEgoVehicleRssDynamics)
     105   [ +  +  +  + ]:         22 :       && (situations == other.situations);
     106                 :            :   }
     107                 :            : 
     108                 :            :   /**
     109                 :            :    * \brief standard comparison operator
     110                 :            :    *
     111                 :            :    * \param[in] other Other SituationSnapshot.
     112                 :            :    *
     113                 :            :    * \returns \c true if both SituationSnapshot are different
     114                 :            :    */
     115                 :          4 :   bool operator!=(const SituationSnapshot &other) const
     116                 :            :   {
     117                 :          4 :     return !operator==(other);
     118                 :            :   }
     119                 :            : 
     120                 :            :   /*!
     121                 :            :    * The time index is required to distinguish different points in time when tracking states or transforming responses
     122                 :            :    * back.
     123                 :            :    */
     124                 :            :   ::ad::rss::world::TimeIndex timeIndex{0u};
     125                 :            : 
     126                 :            :   /*!
     127                 :            :    * Defines the standard ego vehicle dynamics to be applied i.e. when there is no  dangerous
     128                 :            :    * scene.
     129                 :            :    * This parameters are provided in addtion on a per situation basis to be able to adapt
     130                 :            :    * these e.g. in respect to object type or the weather conditions
     131                 :            :    */
     132                 :            :   ::ad::rss::world::RssDynamics defaultEgoVehicleRssDynamics;
     133                 :            : 
     134                 :            :   /*!
     135                 :            :    * The vector of situations at a given time.
     136                 :            :    */
     137                 :            :   ::ad::rss::situation::SituationVector situations;
     138                 :            : };
     139                 :            : 
     140                 :            : } // namespace situation
     141                 :            : } // namespace rss
     142                 :            : } // namespace ad
     143                 :            : 
     144                 :            : /*!
     145                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     146                 :            :  */
     147                 :            : #ifndef GEN_GUARD_AD_RSS_SITUATION_SITUATIONSNAPSHOT
     148                 :            : #define GEN_GUARD_AD_RSS_SITUATION_SITUATIONSNAPSHOT
     149                 :            : /*!
     150                 :            :  * @brief namespace ad
     151                 :            :  */
     152                 :            : namespace ad {
     153                 :            : /*!
     154                 :            :  * @brief namespace rss
     155                 :            :  */
     156                 :            : namespace rss {
     157                 :            : /*!
     158                 :            :  * @brief namespace situation
     159                 :            :  */
     160                 :            : namespace situation {
     161                 :            : 
     162                 :            : /**
     163                 :            :  * \brief standard ostream operator
     164                 :            :  *
     165                 :            :  * \param[in] os The output stream to write to
     166                 :            :  * \param[in] _value SituationSnapshot value
     167                 :            :  *
     168                 :            :  * \returns The stream object.
     169                 :            :  *
     170                 :            :  */
     171                 :          6 : inline std::ostream &operator<<(std::ostream &os, SituationSnapshot const &_value)
     172                 :            : {
     173                 :          6 :   os << "SituationSnapshot(";
     174                 :          6 :   os << "timeIndex:";
     175                 :          6 :   os << _value.timeIndex;
     176                 :          6 :   os << ",";
     177                 :          6 :   os << "defaultEgoVehicleRssDynamics:";
     178                 :          6 :   os << _value.defaultEgoVehicleRssDynamics;
     179                 :          6 :   os << ",";
     180                 :          6 :   os << "situations:";
     181                 :          6 :   os << _value.situations;
     182                 :          6 :   os << ")";
     183                 :          6 :   return os;
     184                 :            : }
     185                 :            : 
     186                 :            : } // namespace situation
     187                 :            : } // namespace rss
     188                 :            : } // namespace ad
     189                 :            : 
     190                 :            : namespace std {
     191                 :            : /*!
     192                 :            :  * \brief overload of the std::to_string for SituationSnapshot
     193                 :            :  */
     194                 :          1 : inline std::string to_string(::ad::rss::situation::SituationSnapshot const &value)
     195                 :            : {
     196         [ +  - ]:          2 :   stringstream sstream;
     197         [ +  - ]:          1 :   sstream << value;
     198         [ +  - ]:          2 :   return sstream.str();
     199                 :            : }
     200                 :            : } // namespace std
     201                 :            : #endif // GEN_GUARD_AD_RSS_SITUATION_SITUATIONSNAPSHOT

Generated by: LCOV version 1.14