LCOV - code coverage report
Current view: top level - generated/include/ad/rss/situation - VehicleState.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 40 40 100.0 %
Date: 2024-04-23 14:35:54 Functions: 5 5 100.0 %
Branches: 19 22 86.4 %

           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/Distance.hpp"
      25                 :            : #include "ad/rss/situation/VelocityRange.hpp"
      26                 :            : #include "ad/rss/world/ObjectState.hpp"
      27                 :            : #include "ad/rss/world/ObjectType.hpp"
      28                 :            : #include "ad/rss/world/RssDynamics.hpp"
      29                 :            : /*!
      30                 :            :  * @brief namespace ad
      31                 :            :  */
      32                 :            : namespace ad {
      33                 :            : /*!
      34                 :            :  * @brief namespace rss
      35                 :            :  */
      36                 :            : namespace rss {
      37                 :            : /*!
      38                 :            :  * @brief namespace situation
      39                 :            :  */
      40                 :            : namespace situation {
      41                 :            : 
      42                 :            : /*!
      43                 :            :  * \brief DataType VehicleState
      44                 :            :  *
      45                 :            :  * The state of an object in a RSS situation.
      46                 :            :  * The state consists of the following components in respect to the situation coordinate
      47                 :            :  * system: the velocity, the distance to the intersection (if applicable), the dynamics,
      48                 :            :  * the response time, a Right-of-Way priority flag as well as a flag stating if the
      49                 :            :  * vehicle is driving in its correct lane.
      50                 :            :  */
      51                 :            : struct VehicleState
      52                 :            : {
      53                 :            :   /*!
      54                 :            :    * \brief Smart pointer on VehicleState
      55                 :            :    */
      56                 :            :   typedef std::shared_ptr<VehicleState> Ptr;
      57                 :            : 
      58                 :            :   /*!
      59                 :            :    * \brief Smart pointer on constant VehicleState
      60                 :            :    */
      61                 :            :   typedef std::shared_ptr<VehicleState const> ConstPtr;
      62                 :            : 
      63                 :            :   /*!
      64                 :            :    * \brief standard constructor
      65                 :            :    */
      66                 :      10780 :   VehicleState() = default;
      67                 :            : 
      68                 :            :   /*!
      69                 :            :    * \brief standard destructor
      70                 :            :    */
      71                 :            :   ~VehicleState() = default;
      72                 :            : 
      73                 :            :   /*!
      74                 :            :    * \brief standard copy constructor
      75                 :            :    */
      76                 :            :   VehicleState(const VehicleState &other) = default;
      77                 :            : 
      78                 :            :   /*!
      79                 :            :    * \brief standard move constructor
      80                 :            :    */
      81                 :            :   VehicleState(VehicleState &&other) = default;
      82                 :            : 
      83                 :            :   /**
      84                 :            :    * \brief standard assignment operator
      85                 :            :    *
      86                 :            :    * \param[in] other Other VehicleState
      87                 :            :    *
      88                 :            :    * \returns Reference to this VehicleState.
      89                 :            :    */
      90                 :            :   VehicleState &operator=(const VehicleState &other) = default;
      91                 :            : 
      92                 :            :   /**
      93                 :            :    * \brief standard move operator
      94                 :            :    *
      95                 :            :    * \param[in] other Other VehicleState
      96                 :            :    *
      97                 :            :    * \returns Reference to this VehicleState.
      98                 :            :    */
      99                 :            :   VehicleState &operator=(VehicleState &&other) = default;
     100                 :            : 
     101                 :            :   /**
     102                 :            :    * \brief standard comparison operator
     103                 :            :    *
     104                 :            :    * \param[in] other Other VehicleState
     105                 :            :    *
     106                 :            :    * \returns \c true if both VehicleState are equal
     107                 :            :    */
     108                 :         56 :   bool operator==(const VehicleState &other) const
     109                 :            :   {
     110   [ +  +  +  + ]:        106 :     return (velocity == other.velocity) && (dynamics == other.dynamics) && (hasPriority == other.hasPriority)
     111         [ +  + ]:         46 :       && (isInCorrectLane == other.isInCorrectLane)
     112         [ +  + ]:         44 :       && (distanceToEnterIntersection == other.distanceToEnterIntersection)
     113   [ +  +  +  + ]:         42 :       && (distanceToLeaveIntersection == other.distanceToLeaveIntersection) && (objectType == other.objectType)
     114   [ +  +  +  + ]:        106 :       && (objectState == other.objectState);
     115                 :            :   }
     116                 :            : 
     117                 :            :   /**
     118                 :            :    * \brief standard comparison operator
     119                 :            :    *
     120                 :            :    * \param[in] other Other VehicleState.
     121                 :            :    *
     122                 :            :    * \returns \c true if both VehicleState are different
     123                 :            :    */
     124                 :          9 :   bool operator!=(const VehicleState &other) const
     125                 :            :   {
     126                 :          9 :     return !operator==(other);
     127                 :            :   }
     128                 :            : 
     129                 :            :   /*!
     130                 :            :    * The situation specific velocity range. Especially due to merge of different scenes into one situation the
     131                 :            :    * velocities might become a real range.
     132                 :            :    */
     133                 :            :   ::ad::rss::situation::VelocityRange velocity;
     134                 :            : 
     135                 :            :   /*!
     136                 :            :    * The situation specific dynamics.
     137                 :            :    */
     138                 :            :   ::ad::rss::world::RssDynamics dynamics;
     139                 :            : 
     140                 :            :   /*!
     141                 :            :    * Flag indicating if the situation specific Right-of-Way relation.
     142                 :            :    */
     143                 :            :   bool hasPriority{false};
     144                 :            : 
     145                 :            :   /*!
     146                 :            :    * Flag indicating if the vehicle driving in the correct lane
     147                 :            :    */
     148                 :            :   bool isInCorrectLane{false};
     149                 :            : 
     150                 :            :   /*!
     151                 :            :    * The minimum distance to be covered by the vehicle to enter the intersection.
     152                 :            :    */
     153                 :            :   ::ad::physics::Distance distanceToEnterIntersection{std::numeric_limits<::ad::physics::Distance>::max()};
     154                 :            : 
     155                 :            :   /*!
     156                 :            :    * The maximum distance to cover by the vehicle to leave the intersection completely.
     157                 :            :    */
     158                 :            :   ::ad::physics::Distance distanceToLeaveIntersection{std::numeric_limits<::ad::physics::Distance>::max()};
     159                 :            : 
     160                 :            :   /*!
     161                 :            :    * The type of object.
     162                 :            :    */
     163                 :            :   ::ad::rss::world::ObjectType objectType;
     164                 :            : 
     165                 :            :   /*!
     166                 :            :    * The state of the object required to perform unstructured scene calculations.
     167                 :            :    */
     168                 :            :   ::ad::rss::world::ObjectState objectState;
     169                 :            : };
     170                 :            : 
     171                 :            : } // namespace situation
     172                 :            : } // namespace rss
     173                 :            : } // namespace ad
     174                 :            : 
     175                 :            : /*!
     176                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     177                 :            :  */
     178                 :            : #ifndef GEN_GUARD_AD_RSS_SITUATION_VEHICLESTATE
     179                 :            : #define GEN_GUARD_AD_RSS_SITUATION_VEHICLESTATE
     180                 :            : /*!
     181                 :            :  * @brief namespace ad
     182                 :            :  */
     183                 :            : namespace ad {
     184                 :            : /*!
     185                 :            :  * @brief namespace rss
     186                 :            :  */
     187                 :            : namespace rss {
     188                 :            : /*!
     189                 :            :  * @brief namespace situation
     190                 :            :  */
     191                 :            : namespace situation {
     192                 :            : 
     193                 :            : /**
     194                 :            :  * \brief standard ostream operator
     195                 :            :  *
     196                 :            :  * \param[in] os The output stream to write to
     197                 :            :  * \param[in] _value VehicleState value
     198                 :            :  *
     199                 :            :  * \returns The stream object.
     200                 :            :  *
     201                 :            :  */
     202                 :    2020180 : inline std::ostream &operator<<(std::ostream &os, VehicleState const &_value)
     203                 :            : {
     204                 :    2020180 :   os << "VehicleState(";
     205                 :    2020180 :   os << "velocity:";
     206                 :    2020180 :   os << _value.velocity;
     207                 :    2020180 :   os << ",";
     208                 :    2020180 :   os << "dynamics:";
     209                 :    2020180 :   os << _value.dynamics;
     210                 :    2020180 :   os << ",";
     211                 :    2020180 :   os << "hasPriority:";
     212                 :    2020180 :   os << _value.hasPriority;
     213                 :    2020180 :   os << ",";
     214                 :    2020180 :   os << "isInCorrectLane:";
     215                 :    2020180 :   os << _value.isInCorrectLane;
     216                 :    2020180 :   os << ",";
     217                 :    2020180 :   os << "distanceToEnterIntersection:";
     218                 :    2020180 :   os << _value.distanceToEnterIntersection;
     219                 :    2020180 :   os << ",";
     220                 :    2020180 :   os << "distanceToLeaveIntersection:";
     221                 :    2020180 :   os << _value.distanceToLeaveIntersection;
     222                 :    2020180 :   os << ",";
     223                 :    2020180 :   os << "objectType:";
     224                 :    2020180 :   os << _value.objectType;
     225                 :    2020180 :   os << ",";
     226                 :    2020180 :   os << "objectState:";
     227                 :    2020180 :   os << _value.objectState;
     228                 :    2020180 :   os << ")";
     229                 :    2020180 :   return os;
     230                 :            : }
     231                 :            : 
     232                 :            : } // namespace situation
     233                 :            : } // namespace rss
     234                 :            : } // namespace ad
     235                 :            : 
     236                 :            : namespace std {
     237                 :            : /*!
     238                 :            :  * \brief overload of the std::to_string for VehicleState
     239                 :            :  */
     240                 :          1 : inline std::string to_string(::ad::rss::situation::VehicleState const &value)
     241                 :            : {
     242         [ +  - ]:          2 :   stringstream sstream;
     243         [ +  - ]:          1 :   sstream << value;
     244         [ +  - ]:          2 :   return sstream.str();
     245                 :            : }
     246                 :            : } // namespace std
     247                 :            : #endif // GEN_GUARD_AD_RSS_SITUATION_VEHICLESTATE

Generated by: LCOV version 1.14