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

Generated by: LCOV version 1.14