LCOV - code coverage report
Current view: top level - generated/include/ad/rss/world - RoadSegment.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 32 34 94.1 %
Date: 2025-07-22 06:53:46 Functions: 10 11 90.9 %
Branches: 11 14 78.6 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2022 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-2046
      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/world/LaneSegmentVector.hpp"
      26                 :            : #include "ad/rss/world/RoadSegmentType.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 RoadSegment
      42                 :            :  *
      43                 :            :  * A RoadSegment is defined by lateral neighboring lane segments, a type and some intersection
      44                 :            :  * correction metrics.
      45                 :            :  * The lane segments within a road segment have to be ordered from left to right in
      46                 :            :  * respect to the driving direction defined by the road area.
      47                 :            :  */
      48                 :            : struct RoadSegment
      49                 :            : {
      50                 :            :   /*!
      51                 :            :    * \brief Smart pointer on RoadSegment
      52                 :            :    */
      53                 :            :   typedef std::shared_ptr<RoadSegment> Ptr;
      54                 :            : 
      55                 :            :   /*!
      56                 :            :    * \brief Smart pointer on constant RoadSegment
      57                 :            :    */
      58                 :            :   typedef std::shared_ptr<RoadSegment const> ConstPtr;
      59                 :            : 
      60                 :            :   /*!
      61                 :            :    * \brief standard constructor
      62                 :            :    */
      63                 :       2657 :   RoadSegment() = default;
      64                 :            : 
      65                 :            :   /*!
      66                 :            :    * \brief standard destructor
      67                 :            :    */
      68                 :      49833 :   ~RoadSegment() = default;
      69                 :            : 
      70                 :            :   /*!
      71                 :            :    * \brief standard copy constructor
      72                 :            :    */
      73                 :      44522 :   RoadSegment(const RoadSegment &other) = default;
      74                 :            : 
      75                 :            :   /*!
      76                 :            :    * \brief standard move constructor
      77                 :            :    */
      78                 :       2704 :   RoadSegment(RoadSegment &&other) = default;
      79                 :            : 
      80                 :            :   /**
      81                 :            :    * \brief standard assignment operator
      82                 :            :    *
      83                 :            :    * \param[in] other Other RoadSegment
      84                 :            :    *
      85                 :            :    * \returns Reference to this RoadSegment.
      86                 :            :    */
      87                 :         19 :   RoadSegment &operator=(const RoadSegment &other) = default;
      88                 :            : 
      89                 :            :   /**
      90                 :            :    * \brief standard move operator
      91                 :            :    *
      92                 :            :    * \param[in] other Other RoadSegment
      93                 :            :    *
      94                 :            :    * \returns Reference to this RoadSegment.
      95                 :            :    */
      96                 :        109 :   RoadSegment &operator=(RoadSegment &&other) = default;
      97                 :            : 
      98                 :            :   /**
      99                 :            :    * \brief standard comparison operator
     100                 :            :    *
     101                 :            :    * \param[in] other Other RoadSegment
     102                 :            :    *
     103                 :            :    * \returns \c true if both RoadSegment are equal
     104                 :            :    */
     105                 :         44 :   bool operator==(const RoadSegment &other) const
     106                 :            :   {
     107         [ +  + ]:         38 :     return (type == other.type) && (lane_segments == other.lane_segments)
     108         [ +  + ]:         36 :       && (minimum_length_after_intersecting_area == other.minimum_length_after_intersecting_area)
     109   [ +  +  +  + ]:         82 :       && (minimum_length_before_intersecting_area == other.minimum_length_before_intersecting_area);
     110                 :            :   }
     111                 :            : 
     112                 :            :   /**
     113                 :            :    * \brief standard comparison operator
     114                 :            :    *
     115                 :            :    * \param[in] other Other RoadSegment.
     116                 :            :    *
     117                 :            :    * \returns \c true if both RoadSegment are different
     118                 :            :    */
     119                 :          5 :   bool operator!=(const RoadSegment &other) const
     120                 :            :   {
     121                 :          5 :     return !operator==(other);
     122                 :            :   }
     123                 :            : 
     124                 :            :   /*!
     125                 :            :    * The type of this road segment in context of the RssArea it belongs to.
     126                 :            :    */
     127                 :            :   ::ad::rss::world::RoadSegmentType type{::ad::rss::world::RoadSegmentType::Normal};
     128                 :            :   ::ad::rss::world::LaneSegmentVector lane_segments;
     129                 :            : 
     130                 :            :   /*!
     131                 :            :    * The mimum length after the actual intersecting area of an intersection type road
     132                 :            :    * segment.
     133                 :            :    * If > 0 the actual area intersecting with the other vehicles route within an intersection
     134                 :            :    * segment ends that distance before this road segment ends.
     135                 :            :    */
     136                 :            :   ::ad::physics::Distance minimum_length_after_intersecting_area{0.0};
     137                 :            : 
     138                 :            :   /*!
     139                 :            :    * The mimum length before the actual intersecting area of an intersection type road
     140                 :            :    * segment.
     141                 :            :    * If > 0 the actual area intersecting with the other vehicles route within an intersection
     142                 :            :    * segment starts that distance after this road segment starts.
     143                 :            :    */
     144                 :            :   ::ad::physics::Distance minimum_length_before_intersecting_area{0.0};
     145                 :            : };
     146                 :            : 
     147                 :            : } // namespace world
     148                 :            : } // namespace rss
     149                 :            : } // namespace ad
     150                 :            : 
     151                 :            : /*!
     152                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     153                 :            :  */
     154                 :            : #ifndef GEN_GUARD_AD_RSS_WORLD_ROADSEGMENT
     155                 :            : #define GEN_GUARD_AD_RSS_WORLD_ROADSEGMENT
     156                 :            : /*!
     157                 :            :  * @brief namespace ad
     158                 :            :  */
     159                 :            : namespace ad {
     160                 :            : /*!
     161                 :            :  * @brief namespace rss
     162                 :            :  */
     163                 :            : namespace rss {
     164                 :            : /*!
     165                 :            :  * @brief namespace world
     166                 :            :  */
     167                 :            : namespace world {
     168                 :            : 
     169                 :            : /**
     170                 :            :  * \brief standard ostream operator
     171                 :            :  *
     172                 :            :  * \param[in] os The output stream to write to
     173                 :            :  * \param[in] _value RoadSegment value
     174                 :            :  *
     175                 :            :  * \returns The stream object.
     176                 :            :  *
     177                 :            :  */
     178                 :         10 : inline std::ostream &operator<<(std::ostream &os, RoadSegment const &_value)
     179                 :            : {
     180                 :         10 :   os << "RoadSegment(";
     181                 :         10 :   os << "type:";
     182                 :         10 :   os << _value.type;
     183                 :         10 :   os << ",";
     184                 :         10 :   os << "lane_segments:";
     185                 :         10 :   os << _value.lane_segments;
     186                 :         10 :   os << ",";
     187                 :         10 :   os << "minimum_length_after_intersecting_area:";
     188                 :         10 :   os << _value.minimum_length_after_intersecting_area;
     189                 :         10 :   os << ",";
     190                 :         10 :   os << "minimum_length_before_intersecting_area:";
     191                 :         10 :   os << _value.minimum_length_before_intersecting_area;
     192                 :         10 :   os << ")";
     193                 :         10 :   return os;
     194                 :            : }
     195                 :            : 
     196                 :            : } // namespace world
     197                 :            : } // namespace rss
     198                 :            : } // namespace ad
     199                 :            : 
     200                 :            : namespace std {
     201                 :            : /*!
     202                 :            :  * \brief overload of the std::to_string for RoadSegment
     203                 :            :  */
     204                 :          1 : inline std::string to_string(::ad::rss::world::RoadSegment const &value)
     205                 :            : {
     206         [ +  - ]:          1 :   stringstream sstream;
     207         [ +  - ]:          1 :   sstream << value;
     208         [ +  - ]:          2 :   return sstream.str();
     209                 :          1 : }
     210                 :            : } // namespace std
     211                 :            : 
     212                 :            : /*!
     213                 :            :  * \brief overload of fmt::formatter calling std::to_string
     214                 :            :  */
     215                 :            : template <> struct fmt::formatter<::ad::rss::world::RoadSegment> : formatter<string_view>
     216                 :            : {
     217                 :          0 :   template <typename FormatContext> auto format(::ad::rss::world::RoadSegment const &value, FormatContext &ctx)
     218                 :            :   {
     219                 :          0 :     return formatter<string_view>::format(std::to_string(value), ctx);
     220                 :            :   }
     221                 :            : };
     222                 :            : 
     223                 :            : #endif // GEN_GUARD_AD_RSS_WORLD_ROADSEGMENT

Generated by: LCOV version 1.14