LCOV - code coverage report
Current view: top level - generated/include/ad/rss/situation - VelocityRange.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 18 18 100.0 %
Date: 2024-04-23 14:35:54 Functions: 5 5 100.0 %
Branches: 7 10 70.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 <memory>
      22                 :            : #include <sstream>
      23                 :            : #include "ad/physics/SpeedRange.hpp"
      24                 :            : /*!
      25                 :            :  * @brief namespace ad
      26                 :            :  */
      27                 :            : namespace ad {
      28                 :            : /*!
      29                 :            :  * @brief namespace rss
      30                 :            :  */
      31                 :            : namespace rss {
      32                 :            : /*!
      33                 :            :  * @brief namespace situation
      34                 :            :  */
      35                 :            : namespace situation {
      36                 :            : 
      37                 :            : /*!
      38                 :            :  * \brief DataType VelocityRange
      39                 :            :  *
      40                 :            :  * Defines the velocity range of an object within its current lane. The velocity range consists of a longitudinal and a
      41                 :            :  * lateral component.
      42                 :            :  */
      43                 :            : struct VelocityRange
      44                 :            : {
      45                 :            :   /*!
      46                 :            :    * \brief Smart pointer on VelocityRange
      47                 :            :    */
      48                 :            :   typedef std::shared_ptr<VelocityRange> Ptr;
      49                 :            : 
      50                 :            :   /*!
      51                 :            :    * \brief Smart pointer on constant VelocityRange
      52                 :            :    */
      53                 :            :   typedef std::shared_ptr<VelocityRange const> ConstPtr;
      54                 :            : 
      55                 :            :   /*!
      56                 :            :    * \brief standard constructor
      57                 :            :    */
      58                 :      10913 :   VelocityRange() = default;
      59                 :            : 
      60                 :            :   /*!
      61                 :            :    * \brief standard destructor
      62                 :            :    */
      63                 :            :   ~VelocityRange() = default;
      64                 :            : 
      65                 :            :   /*!
      66                 :            :    * \brief standard copy constructor
      67                 :            :    */
      68                 :            :   VelocityRange(const VelocityRange &other) = default;
      69                 :            : 
      70                 :            :   /*!
      71                 :            :    * \brief standard move constructor
      72                 :            :    */
      73                 :            :   VelocityRange(VelocityRange &&other) = default;
      74                 :            : 
      75                 :            :   /**
      76                 :            :    * \brief standard assignment operator
      77                 :            :    *
      78                 :            :    * \param[in] other Other VelocityRange
      79                 :            :    *
      80                 :            :    * \returns Reference to this VelocityRange.
      81                 :            :    */
      82                 :            :   VelocityRange &operator=(const VelocityRange &other) = default;
      83                 :            : 
      84                 :            :   /**
      85                 :            :    * \brief standard move operator
      86                 :            :    *
      87                 :            :    * \param[in] other Other VelocityRange
      88                 :            :    *
      89                 :            :    * \returns Reference to this VelocityRange.
      90                 :            :    */
      91                 :            :   VelocityRange &operator=(VelocityRange &&other) = default;
      92                 :            : 
      93                 :            :   /**
      94                 :            :    * \brief standard comparison operator
      95                 :            :    *
      96                 :            :    * \param[in] other Other VelocityRange
      97                 :            :    *
      98                 :            :    * \returns \c true if both VelocityRange are equal
      99                 :            :    */
     100                 :         66 :   bool operator==(const VelocityRange &other) const
     101                 :            :   {
     102   [ +  +  +  + ]:         66 :     return (speedLon == other.speedLon) && (speedLat == other.speedLat);
     103                 :            :   }
     104                 :            : 
     105                 :            :   /**
     106                 :            :    * \brief standard comparison operator
     107                 :            :    *
     108                 :            :    * \param[in] other Other VelocityRange.
     109                 :            :    *
     110                 :            :    * \returns \c true if both VelocityRange are different
     111                 :            :    */
     112                 :          3 :   bool operator!=(const VelocityRange &other) const
     113                 :            :   {
     114                 :          3 :     return !operator==(other);
     115                 :            :   }
     116                 :            : 
     117                 :            :   /*!
     118                 :            :    * The longitudinal speed component of the velocity vector.
     119                 :            :    * The longitudinal component of the velocity is always measured tangential to the
     120                 :            :    * center line of the current lane.
     121                 :            :    */
     122                 :            :   ::ad::physics::SpeedRange speedLon;
     123                 :            : 
     124                 :            :   /*!
     125                 :            :    * The lateral speed component of the velocity vector.
     126                 :            :    * The lateral component of the velocity is always measured orthogonal to the center
     127                 :            :    * line of the current lane.
     128                 :            :    */
     129                 :            :   ::ad::physics::SpeedRange speedLat;
     130                 :            : };
     131                 :            : 
     132                 :            : } // namespace situation
     133                 :            : } // namespace rss
     134                 :            : } // namespace ad
     135                 :            : 
     136                 :            : /*!
     137                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     138                 :            :  */
     139                 :            : #ifndef GEN_GUARD_AD_RSS_SITUATION_VELOCITYRANGE
     140                 :            : #define GEN_GUARD_AD_RSS_SITUATION_VELOCITYRANGE
     141                 :            : /*!
     142                 :            :  * @brief namespace ad
     143                 :            :  */
     144                 :            : namespace ad {
     145                 :            : /*!
     146                 :            :  * @brief namespace rss
     147                 :            :  */
     148                 :            : namespace rss {
     149                 :            : /*!
     150                 :            :  * @brief namespace situation
     151                 :            :  */
     152                 :            : namespace situation {
     153                 :            : 
     154                 :            : /**
     155                 :            :  * \brief standard ostream operator
     156                 :            :  *
     157                 :            :  * \param[in] os The output stream to write to
     158                 :            :  * \param[in] _value VelocityRange value
     159                 :            :  *
     160                 :            :  * \returns The stream object.
     161                 :            :  *
     162                 :            :  */
     163                 :    2020190 : inline std::ostream &operator<<(std::ostream &os, VelocityRange const &_value)
     164                 :            : {
     165                 :    2020190 :   os << "VelocityRange(";
     166                 :    2020190 :   os << "speedLon:";
     167                 :    2020190 :   os << _value.speedLon;
     168                 :    2020190 :   os << ",";
     169                 :    2020190 :   os << "speedLat:";
     170                 :    2020190 :   os << _value.speedLat;
     171                 :    2020190 :   os << ")";
     172                 :    2020190 :   return os;
     173                 :            : }
     174                 :            : 
     175                 :            : } // namespace situation
     176                 :            : } // namespace rss
     177                 :            : } // namespace ad
     178                 :            : 
     179                 :            : namespace std {
     180                 :            : /*!
     181                 :            :  * \brief overload of the std::to_string for VelocityRange
     182                 :            :  */
     183                 :          1 : inline std::string to_string(::ad::rss::situation::VelocityRange const &value)
     184                 :            : {
     185         [ +  - ]:          2 :   stringstream sstream;
     186         [ +  - ]:          1 :   sstream << value;
     187         [ +  - ]:          2 :   return sstream.str();
     188                 :            : }
     189                 :            : } // namespace std
     190                 :            : #endif // GEN_GUARD_AD_RSS_SITUATION_VELOCITYRANGE

Generated by: LCOV version 1.14