LCOV - code coverage report
Current view: top level - generated/include/ad/rss/state - RssStateSnapshot.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 33 35 94.3 %
Date: 2025-07-22 06:53:46 Functions: 10 11 90.9 %
Branches: 12 18 66.7 %

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

Generated by: LCOV version 1.14