LCOV - code coverage report
Current view: top level - generated/include/ad/rss/state - RssState.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 40 40 100.0 %
Date: 2024-05-08 21:22:00 Functions: 10 10 100.0 %
Branches: 17 20 85.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/SituationId.hpp"
      25                 :            : #include "ad/rss/situation/SituationType.hpp"
      26                 :            : #include "ad/rss/state/LateralRssState.hpp"
      27                 :            : #include "ad/rss/state/LongitudinalRssState.hpp"
      28                 :            : #include "ad/rss/state/UnstructuredSceneRssState.hpp"
      29                 :            : #include "ad/rss/world/ObjectId.hpp"
      30                 :            : /*!
      31                 :            :  * @brief namespace ad
      32                 :            :  */
      33                 :            : namespace ad {
      34                 :            : /*!
      35                 :            :  * @brief namespace rss
      36                 :            :  */
      37                 :            : namespace rss {
      38                 :            : /*!
      39                 :            :  * @brief namespace state
      40                 :            :  */
      41                 :            : namespace state {
      42                 :            : 
      43                 :            : /*!
      44                 :            :  * \brief DataType RssState
      45                 :            :  *
      46                 :            :  * Struct defining the RSS state of a single object.
      47                 :            :  */
      48                 :        158 : struct RssState
      49                 :            : {
      50                 :            :   /*!
      51                 :            :    * \brief Smart pointer on RssState
      52                 :            :    */
      53                 :            :   typedef std::shared_ptr<RssState> Ptr;
      54                 :            : 
      55                 :            :   /*!
      56                 :            :    * \brief Smart pointer on constant RssState
      57                 :            :    */
      58                 :            :   typedef std::shared_ptr<RssState const> ConstPtr;
      59                 :            : 
      60                 :            :   /*!
      61                 :            :    * \brief standard constructor
      62                 :            :    */
      63                 :      67363 :   RssState() = default;
      64                 :            : 
      65                 :            :   /*!
      66                 :            :    * \brief standard destructor
      67                 :            :    */
      68                 :     194003 :   ~RssState() = default;
      69                 :            : 
      70                 :            :   /*!
      71                 :            :    * \brief standard copy constructor
      72                 :            :    */
      73                 :      58152 :   RssState(const RssState &other) = default;
      74                 :            : 
      75                 :            :   /*!
      76                 :            :    * \brief standard move constructor
      77                 :            :    */
      78                 :      68490 :   RssState(RssState &&other) = default;
      79                 :            : 
      80                 :            :   /**
      81                 :            :    * \brief standard assignment operator
      82                 :            :    *
      83                 :            :    * \param[in] other Other RssState
      84                 :            :    *
      85                 :            :    * \returns Reference to this RssState.
      86                 :            :    */
      87                 :            :   RssState &operator=(const RssState &other) = default;
      88                 :            : 
      89                 :            :   /**
      90                 :            :    * \brief standard move operator
      91                 :            :    *
      92                 :            :    * \param[in] other Other RssState
      93                 :            :    *
      94                 :            :    * \returns Reference to this RssState.
      95                 :            :    */
      96                 :            :   RssState &operator=(RssState &&other) = default;
      97                 :            : 
      98                 :            :   /**
      99                 :            :    * \brief standard comparison operator
     100                 :            :    *
     101                 :            :    * \param[in] other Other RssState
     102                 :            :    *
     103                 :            :    * \returns \c true if both RssState are equal
     104                 :            :    */
     105                 :         30 :   bool operator==(const RssState &other) const
     106                 :            :   {
     107         [ +  + ]:         26 :     return (objectId == other.objectId) && (situationId == other.situationId)
     108   [ +  +  +  + ]:         24 :       && (longitudinalState == other.longitudinalState) && (lateralStateRight == other.lateralStateRight)
     109   [ +  +  +  + ]:         20 :       && (lateralStateLeft == other.lateralStateLeft) && (unstructuredSceneState == other.unstructuredSceneState)
     110   [ +  +  +  + ]:         56 :       && (situationType == other.situationType);
     111                 :            :   }
     112                 :            : 
     113                 :            :   /**
     114                 :            :    * \brief standard comparison operator
     115                 :            :    *
     116                 :            :    * \param[in] other Other RssState.
     117                 :            :    *
     118                 :            :    * \returns \c true if both RssState are different
     119                 :            :    */
     120                 :          8 :   bool operator!=(const RssState &other) const
     121                 :            :   {
     122                 :          8 :     return !operator==(other);
     123                 :            :   }
     124                 :            : 
     125                 :            :   /*!
     126                 :            :    * Defines the unique id of an object. This id has to be constant over time for the same object.
     127                 :            :    */
     128                 :            :   ::ad::rss::world::ObjectId objectId;
     129                 :            : 
     130                 :            :   /*!
     131                 :            :    * Id of the situation this state refers to.
     132                 :            :    * The id has to remain unique over time representing the situation (ego-vehicle /
     133                 :            :    * object pair) under investigation.
     134                 :            :    * It is used to track the state of the ego-vehicle / object constellation i.e. at
     135                 :            :    * point of danger threshold time.
     136                 :            :    */
     137                 :            :   ::ad::rss::situation::SituationId situationId{0u};
     138                 :            : 
     139                 :            :   /*!
     140                 :            :    * The current longitudinal rss state.
     141                 :            :    */
     142                 :            :   ::ad::rss::state::LongitudinalRssState longitudinalState;
     143                 :            : 
     144                 :            :   /*!
     145                 :            :    * The current lateral rss state at right side in respect to ego-vehicle driving direction.
     146                 :            :    */
     147                 :            :   ::ad::rss::state::LateralRssState lateralStateRight;
     148                 :            : 
     149                 :            :   /*!
     150                 :            :    * The current lateral rss state at left side in respect to ego-vehicle driving direction.
     151                 :            :    */
     152                 :            :   ::ad::rss::state::LateralRssState lateralStateLeft;
     153                 :            : 
     154                 :            :   /*!
     155                 :            :    * The state of the unstructured scene.
     156                 :            :    */
     157                 :            :   ::ad::rss::state::UnstructuredSceneRssState unstructuredSceneState;
     158                 :            : 
     159                 :            :   /*!
     160                 :            :    * This type of situation this RssState was calculated on.
     161                 :            :    */
     162                 :            :   ::ad::rss::situation::SituationType situationType;
     163                 :            : };
     164                 :            : 
     165                 :            : } // namespace state
     166                 :            : } // namespace rss
     167                 :            : } // namespace ad
     168                 :            : 
     169                 :            : /*!
     170                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     171                 :            :  */
     172                 :            : #ifndef GEN_GUARD_AD_RSS_STATE_RSSSTATE
     173                 :            : #define GEN_GUARD_AD_RSS_STATE_RSSSTATE
     174                 :            : /*!
     175                 :            :  * @brief namespace ad
     176                 :            :  */
     177                 :            : namespace ad {
     178                 :            : /*!
     179                 :            :  * @brief namespace rss
     180                 :            :  */
     181                 :            : namespace rss {
     182                 :            : /*!
     183                 :            :  * @brief namespace state
     184                 :            :  */
     185                 :            : namespace state {
     186                 :            : 
     187                 :            : /**
     188                 :            :  * \brief standard ostream operator
     189                 :            :  *
     190                 :            :  * \param[in] os The output stream to write to
     191                 :            :  * \param[in] _value RssState value
     192                 :            :  *
     193                 :            :  * \returns The stream object.
     194                 :            :  *
     195                 :            :  */
     196                 :    1015840 : inline std::ostream &operator<<(std::ostream &os, RssState const &_value)
     197                 :            : {
     198                 :    1015840 :   os << "RssState(";
     199                 :    1015840 :   os << "objectId:";
     200                 :    1015840 :   os << _value.objectId;
     201                 :    1015840 :   os << ",";
     202                 :    1015840 :   os << "situationId:";
     203                 :    1015840 :   os << _value.situationId;
     204                 :    1015840 :   os << ",";
     205                 :    1015840 :   os << "longitudinalState:";
     206                 :    1015840 :   os << _value.longitudinalState;
     207                 :    1015840 :   os << ",";
     208                 :    1015840 :   os << "lateralStateRight:";
     209                 :    1015840 :   os << _value.lateralStateRight;
     210                 :    1015840 :   os << ",";
     211                 :    1015840 :   os << "lateralStateLeft:";
     212                 :    1015840 :   os << _value.lateralStateLeft;
     213                 :    1015840 :   os << ",";
     214                 :    1015840 :   os << "unstructuredSceneState:";
     215                 :    1015840 :   os << _value.unstructuredSceneState;
     216                 :    1015840 :   os << ",";
     217                 :    1015840 :   os << "situationType:";
     218                 :    1015840 :   os << _value.situationType;
     219                 :    1015840 :   os << ")";
     220                 :    1015840 :   return os;
     221                 :            : }
     222                 :            : 
     223                 :            : } // namespace state
     224                 :            : } // namespace rss
     225                 :            : } // namespace ad
     226                 :            : 
     227                 :            : namespace std {
     228                 :            : /*!
     229                 :            :  * \brief overload of the std::to_string for RssState
     230                 :            :  */
     231                 :          1 : inline std::string to_string(::ad::rss::state::RssState const &value)
     232                 :            : {
     233         [ +  - ]:          2 :   stringstream sstream;
     234         [ +  - ]:          1 :   sstream << value;
     235         [ +  - ]:          2 :   return sstream.str();
     236                 :            : }
     237                 :            : } // namespace std
     238                 :            : #endif // GEN_GUARD_AD_RSS_STATE_RSSSTATE

Generated by: LCOV version 1.14