LCOV - code coverage report
Current view: top level - generated/include/ad/rss/state - LongitudinalRssState.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 25 25 100.0 %
Date: 2024-05-07 10:58:10 Functions: 5 5 100.0 %
Branches: 11 14 78.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 <memory>
      22                 :            : #include <sstream>
      23                 :            : #include "ad/rss/state/LongitudinalResponse.hpp"
      24                 :            : #include "ad/rss/state/RssStateInformation.hpp"
      25                 :            : #include "ad/rss/world/LongitudinalRssAccelerationValues.hpp"
      26                 :            : /*!
      27                 :            :  * @brief namespace ad
      28                 :            :  */
      29                 :            : namespace ad {
      30                 :            : /*!
      31                 :            :  * @brief namespace rss
      32                 :            :  */
      33                 :            : namespace rss {
      34                 :            : /*!
      35                 :            :  * @brief namespace state
      36                 :            :  */
      37                 :            : namespace state {
      38                 :            : 
      39                 :            : /*!
      40                 :            :  * \brief DataType LongitudinalRssState
      41                 :            :  *
      42                 :            :  * Struct to store the longitudinal RSS state.
      43                 :            :  */
      44                 :            : struct LongitudinalRssState
      45                 :            : {
      46                 :            :   /*!
      47                 :            :    * \brief Smart pointer on LongitudinalRssState
      48                 :            :    */
      49                 :            :   typedef std::shared_ptr<LongitudinalRssState> Ptr;
      50                 :            : 
      51                 :            :   /*!
      52                 :            :    * \brief Smart pointer on constant LongitudinalRssState
      53                 :            :    */
      54                 :            :   typedef std::shared_ptr<LongitudinalRssState const> ConstPtr;
      55                 :            : 
      56                 :            :   /*!
      57                 :            :    * \brief standard constructor
      58                 :            :    */
      59                 :      67442 :   LongitudinalRssState() = default;
      60                 :            : 
      61                 :            :   /*!
      62                 :            :    * \brief standard destructor
      63                 :            :    */
      64                 :            :   ~LongitudinalRssState() = default;
      65                 :            : 
      66                 :            :   /*!
      67                 :            :    * \brief standard copy constructor
      68                 :            :    */
      69                 :            :   LongitudinalRssState(const LongitudinalRssState &other) = default;
      70                 :            : 
      71                 :            :   /*!
      72                 :            :    * \brief standard move constructor
      73                 :            :    */
      74                 :            :   LongitudinalRssState(LongitudinalRssState &&other) = default;
      75                 :            : 
      76                 :            :   /**
      77                 :            :    * \brief standard assignment operator
      78                 :            :    *
      79                 :            :    * \param[in] other Other LongitudinalRssState
      80                 :            :    *
      81                 :            :    * \returns Reference to this LongitudinalRssState.
      82                 :            :    */
      83                 :            :   LongitudinalRssState &operator=(const LongitudinalRssState &other) = default;
      84                 :            : 
      85                 :            :   /**
      86                 :            :    * \brief standard move operator
      87                 :            :    *
      88                 :            :    * \param[in] other Other LongitudinalRssState
      89                 :            :    *
      90                 :            :    * \returns Reference to this LongitudinalRssState.
      91                 :            :    */
      92                 :            :   LongitudinalRssState &operator=(LongitudinalRssState &&other) = default;
      93                 :            : 
      94                 :            :   /**
      95                 :            :    * \brief standard comparison operator
      96                 :            :    *
      97                 :            :    * \param[in] other Other LongitudinalRssState
      98                 :            :    *
      99                 :            :    * \returns \c true if both LongitudinalRssState are equal
     100                 :            :    */
     101                 :        112 :   bool operator==(const LongitudinalRssState &other) const
     102                 :            :   {
     103   [ +  +  +  + ]:        108 :     return (isSafe == other.isSafe) && (response == other.response) && (alphaLon == other.alphaLon)
     104   [ +  +  +  + ]:        220 :       && (rssStateInformation == other.rssStateInformation);
     105                 :            :   }
     106                 :            : 
     107                 :            :   /**
     108                 :            :    * \brief standard comparison operator
     109                 :            :    *
     110                 :            :    * \param[in] other Other LongitudinalRssState.
     111                 :            :    *
     112                 :            :    * \returns \c true if both LongitudinalRssState are different
     113                 :            :    */
     114                 :          5 :   bool operator!=(const LongitudinalRssState &other) const
     115                 :            :   {
     116                 :          5 :     return !operator==(other);
     117                 :            :   }
     118                 :            : 
     119                 :            :   /*!
     120                 :            :    * Flag to indicate if the state is longitudinal safe.
     121                 :            :    */
     122                 :            :   bool isSafe{false};
     123                 :            : 
     124                 :            :   /*!
     125                 :            :    * required response in longitudinal direction
     126                 :            :    */
     127                 :            :   ::ad::rss::state::LongitudinalResponse response{::ad::rss::state::LongitudinalResponse::BrakeMin};
     128                 :            : 
     129                 :            :   /*!
     130                 :            :    * RSS dynamics values along longitudinal coordinate system axis.
     131                 :            :    */
     132                 :            :   ::ad::rss::world::LongitudinalRssAccelerationValues alphaLon;
     133                 :            : 
     134                 :            :   /*!
     135                 :            :    * Information on the evaluation of the Rss state.
     136                 :            :    */
     137                 :            :   ::ad::rss::state::RssStateInformation rssStateInformation;
     138                 :            : };
     139                 :            : 
     140                 :            : } // namespace state
     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_STATE_LONGITUDINALRSSSTATE
     148                 :            : #define GEN_GUARD_AD_RSS_STATE_LONGITUDINALRSSSTATE
     149                 :            : /*!
     150                 :            :  * @brief namespace ad
     151                 :            :  */
     152                 :            : namespace ad {
     153                 :            : /*!
     154                 :            :  * @brief namespace rss
     155                 :            :  */
     156                 :            : namespace rss {
     157                 :            : /*!
     158                 :            :  * @brief namespace state
     159                 :            :  */
     160                 :            : namespace state {
     161                 :            : 
     162                 :            : /**
     163                 :            :  * \brief standard ostream operator
     164                 :            :  *
     165                 :            :  * \param[in] os The output stream to write to
     166                 :            :  * \param[in] _value LongitudinalRssState value
     167                 :            :  *
     168                 :            :  * \returns The stream object.
     169                 :            :  *
     170                 :            :  */
     171                 :    1016850 : inline std::ostream &operator<<(std::ostream &os, LongitudinalRssState const &_value)
     172                 :            : {
     173                 :    1016850 :   os << "LongitudinalRssState(";
     174                 :    1016850 :   os << "isSafe:";
     175                 :    1016850 :   os << _value.isSafe;
     176                 :    1016850 :   os << ",";
     177                 :    1016850 :   os << "response:";
     178                 :    1016850 :   os << _value.response;
     179                 :    1016850 :   os << ",";
     180                 :    1016850 :   os << "alphaLon:";
     181                 :    1016850 :   os << _value.alphaLon;
     182                 :    1016850 :   os << ",";
     183                 :    1016850 :   os << "rssStateInformation:";
     184                 :    1016850 :   os << _value.rssStateInformation;
     185                 :    1016850 :   os << ")";
     186                 :    1016850 :   return os;
     187                 :            : }
     188                 :            : 
     189                 :            : } // namespace state
     190                 :            : } // namespace rss
     191                 :            : } // namespace ad
     192                 :            : 
     193                 :            : namespace std {
     194                 :            : /*!
     195                 :            :  * \brief overload of the std::to_string for LongitudinalRssState
     196                 :            :  */
     197                 :          1 : inline std::string to_string(::ad::rss::state::LongitudinalRssState const &value)
     198                 :            : {
     199         [ +  - ]:          2 :   stringstream sstream;
     200         [ +  - ]:          1 :   sstream << value;
     201         [ +  - ]:          2 :   return sstream.str();
     202                 :            : }
     203                 :            : } // namespace std
     204                 :            : #endif // GEN_GUARD_AD_RSS_STATE_LONGITUDINALRSSSTATE

Generated by: LCOV version 1.14