LCOV - code coverage report
Current view: top level - generated/include/ad/rss/world - Scene.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 40 40 100.0 %
Date: 2024-05-02 09:41:50 Functions: 10 10 100.0 %
Branches: 20 26 76.9 %

           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/situation/SituationType.hpp"
      24                 :            : #include "ad/rss/world/Object.hpp"
      25                 :            : #include "ad/rss/world/RoadArea.hpp"
      26                 :            : #include "ad/rss/world/RssDynamics.hpp"
      27                 :            : /*!
      28                 :            :  * @brief namespace ad
      29                 :            :  */
      30                 :            : namespace ad {
      31                 :            : /*!
      32                 :            :  * @brief namespace rss
      33                 :            :  */
      34                 :            : namespace rss {
      35                 :            : /*!
      36                 :            :  * @brief namespace world
      37                 :            :  */
      38                 :            : namespace world {
      39                 :            : 
      40                 :            : /*!
      41                 :            :  * \brief DataType Scene
      42                 :            :  *
      43                 :            :  * A Scene defines the relation between the ego vehicle and another object. It consists of the type of situation between
      44                 :            :  * these two, the objects rss dynamics and the corresponding road areas of interest. All lane segments on the route
      45                 :            :  * between ego vehicle and the object have to be part of this. RSS has to be able to calculate minimum and maximum
      46                 :            :  * distances between ego vehicle and object as well as accelerated movements within this area.
      47                 :            :  */
      48                 :         16 : struct Scene
      49                 :            : {
      50                 :            :   /*!
      51                 :            :    * \brief Smart pointer on Scene
      52                 :            :    */
      53                 :            :   typedef std::shared_ptr<Scene> Ptr;
      54                 :            : 
      55                 :            :   /*!
      56                 :            :    * \brief Smart pointer on constant Scene
      57                 :            :    */
      58                 :            :   typedef std::shared_ptr<Scene const> ConstPtr;
      59                 :            : 
      60                 :            :   /*!
      61                 :            :    * \brief standard constructor
      62                 :            :    */
      63                 :        904 :   Scene() = default;
      64                 :            : 
      65                 :            :   /*!
      66                 :            :    * \brief standard destructor
      67                 :            :    */
      68                 :       5142 :   ~Scene() = default;
      69                 :            : 
      70                 :            :   /*!
      71                 :            :    * \brief standard copy constructor
      72                 :            :    */
      73   [ +  -  +  -  :       4123 :   Scene(const Scene &other) = default;
                   +  - ]
      74                 :            : 
      75                 :            :   /*!
      76                 :            :    * \brief standard move constructor
      77                 :            :    */
      78                 :        115 :   Scene(Scene &&other) = default;
      79                 :            : 
      80                 :            :   /**
      81                 :            :    * \brief standard assignment operator
      82                 :            :    *
      83                 :            :    * \param[in] other Other Scene
      84                 :            :    *
      85                 :            :    * \returns Reference to this Scene.
      86                 :            :    */
      87                 :            :   Scene &operator=(const Scene &other) = default;
      88                 :            : 
      89                 :            :   /**
      90                 :            :    * \brief standard move operator
      91                 :            :    *
      92                 :            :    * \param[in] other Other Scene
      93                 :            :    *
      94                 :            :    * \returns Reference to this Scene.
      95                 :            :    */
      96                 :            :   Scene &operator=(Scene &&other) = default;
      97                 :            : 
      98                 :            :   /**
      99                 :            :    * \brief standard comparison operator
     100                 :            :    *
     101                 :            :    * \param[in] other Other Scene
     102                 :            :    *
     103                 :            :    * \returns \c true if both Scene are equal
     104                 :            :    */
     105                 :         28 :   bool operator==(const Scene &other) const
     106                 :            :   {
     107         [ +  + ]:         24 :     return (situationType == other.situationType) && (egoVehicle == other.egoVehicle)
     108   [ +  +  +  + ]:         22 :       && (egoVehicleRssDynamics == other.egoVehicleRssDynamics) && (object == other.object)
     109   [ +  +  +  + ]:         18 :       && (objectRssDynamics == other.objectRssDynamics) && (intersectingRoad == other.intersectingRoad)
     110   [ +  +  +  + ]:         52 :       && (egoVehicleRoad == other.egoVehicleRoad);
     111                 :            :   }
     112                 :            : 
     113                 :            :   /**
     114                 :            :    * \brief standard comparison operator
     115                 :            :    *
     116                 :            :    * \param[in] other Other Scene.
     117                 :            :    *
     118                 :            :    * \returns \c true if both Scene are different
     119                 :            :    */
     120                 :          8 :   bool operator!=(const Scene &other) const
     121                 :            :   {
     122                 :          8 :     return !operator==(other);
     123                 :            :   }
     124                 :            : 
     125                 :            :   /*!
     126                 :            :    * The type of the current situation. Depending on this type the other fields of the RssArea might be left empty.
     127                 :            :    */
     128                 :            :   ::ad::rss::situation::SituationType situationType{::ad::rss::situation::SituationType::SameDirection};
     129                 :            : 
     130                 :            :   /*!
     131                 :            :    * The ego vehicle in the context of this scene.
     132                 :            :    */
     133                 :            :   ::ad::rss::world::Object egoVehicle;
     134                 :            : 
     135                 :            :   /*!
     136                 :            :    * Defines the ego vehicle dynamics to be applied.
     137                 :            :    * This parameters are provided on a per situation basis to be able to adapt these
     138                 :            :    * e.g. in respect to object type.
     139                 :            :    */
     140                 :            :   ::ad::rss::world::RssDynamics egoVehicleRssDynamics;
     141                 :            : 
     142                 :            :   /*!
     143                 :            :    * The object this scene refers to.
     144                 :            :    */
     145                 :            :   ::ad::rss::world::Object object;
     146                 :            : 
     147                 :            :   /*!
     148                 :            :    * Defines the objects dynamics to be applied. This parameters are provided on a per object basis to be able to adapt
     149                 :            :    * these e.g. in respect to object type or the weather conditions.
     150                 :            :    */
     151                 :            :   ::ad::rss::world::RssDynamics objectRssDynamics;
     152                 :            : 
     153                 :            :   /*!
     154                 :            :    * The RssRoadArea an intersecting vehicle is driving in. The driving direction of the intersecting vehicle define the
     155                 :            :    * ordering of the road segments. The road area should contain all neigboring lanes the other vehcile is able to drive
     156                 :            :    * in.  In non-intersection situations this road area is empty.
     157                 :            :    */
     158                 :            :   ::ad::rss::world::RoadArea intersectingRoad;
     159                 :            : 
     160                 :            :   /*!
     161                 :            :    * The RssRoadArea the ego vehicle is driving in. The driving direction of the ego vehicle define the ordering of the
     162                 :            :    * road segments. In non-intersection situations the object is also driving in this road area.
     163                 :            :    */
     164                 :            :   ::ad::rss::world::RoadArea egoVehicleRoad;
     165                 :            : };
     166                 :            : 
     167                 :            : } // namespace world
     168                 :            : } // namespace rss
     169                 :            : } // namespace ad
     170                 :            : 
     171                 :            : /*!
     172                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     173                 :            :  */
     174                 :            : #ifndef GEN_GUARD_AD_RSS_WORLD_SCENE
     175                 :            : #define GEN_GUARD_AD_RSS_WORLD_SCENE
     176                 :            : /*!
     177                 :            :  * @brief namespace ad
     178                 :            :  */
     179                 :            : namespace ad {
     180                 :            : /*!
     181                 :            :  * @brief namespace rss
     182                 :            :  */
     183                 :            : namespace rss {
     184                 :            : /*!
     185                 :            :  * @brief namespace world
     186                 :            :  */
     187                 :            : namespace world {
     188                 :            : 
     189                 :            : /**
     190                 :            :  * \brief standard ostream operator
     191                 :            :  *
     192                 :            :  * \param[in] os The output stream to write to
     193                 :            :  * \param[in] _value Scene value
     194                 :            :  *
     195                 :            :  * \returns The stream object.
     196                 :            :  *
     197                 :            :  */
     198                 :    1001600 : inline std::ostream &operator<<(std::ostream &os, Scene const &_value)
     199                 :            : {
     200                 :    1001600 :   os << "Scene(";
     201                 :    1001600 :   os << "situationType:";
     202                 :    1001600 :   os << _value.situationType;
     203                 :    1001600 :   os << ",";
     204                 :    1001600 :   os << "egoVehicle:";
     205                 :    1001600 :   os << _value.egoVehicle;
     206                 :    1001600 :   os << ",";
     207                 :    1001600 :   os << "egoVehicleRssDynamics:";
     208                 :    1001600 :   os << _value.egoVehicleRssDynamics;
     209                 :    1001600 :   os << ",";
     210                 :    1001600 :   os << "object:";
     211                 :    1001600 :   os << _value.object;
     212                 :    1001600 :   os << ",";
     213                 :    1001600 :   os << "objectRssDynamics:";
     214                 :    1001600 :   os << _value.objectRssDynamics;
     215                 :    1001600 :   os << ",";
     216                 :    1001600 :   os << "intersectingRoad:";
     217                 :    1001600 :   os << _value.intersectingRoad;
     218                 :    1001600 :   os << ",";
     219                 :    1001600 :   os << "egoVehicleRoad:";
     220                 :    1001600 :   os << _value.egoVehicleRoad;
     221                 :    1001600 :   os << ")";
     222                 :    1001600 :   return os;
     223                 :            : }
     224                 :            : 
     225                 :            : } // namespace world
     226                 :            : } // namespace rss
     227                 :            : } // namespace ad
     228                 :            : 
     229                 :            : namespace std {
     230                 :            : /*!
     231                 :            :  * \brief overload of the std::to_string for Scene
     232                 :            :  */
     233                 :          1 : inline std::string to_string(::ad::rss::world::Scene const &value)
     234                 :            : {
     235         [ +  - ]:          2 :   stringstream sstream;
     236         [ +  - ]:          1 :   sstream << value;
     237         [ +  - ]:          2 :   return sstream.str();
     238                 :            : }
     239                 :            : } // namespace std
     240                 :            : #endif // GEN_GUARD_AD_RSS_WORLD_SCENE

Generated by: LCOV version 1.14