LCOV - code coverage report
Current view: top level - generated/include/ad/rss/world - LaneSegment.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 28 28 100.0 %
Date: 2024-04-30 13:12:49 Functions: 5 5 100.0 %
Branches: 13 16 81.2 %

           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/MetricRange.hpp"
      25                 :            : #include "ad/rss/world/LaneDrivingDirection.hpp"
      26                 :            : #include "ad/rss/world/LaneSegmentId.hpp"
      27                 :            : #include "ad/rss/world/LaneSegmentType.hpp"
      28                 :            : /*!
      29                 :            :  * @brief namespace ad
      30                 :            :  */
      31                 :            : namespace ad {
      32                 :            : /*!
      33                 :            :  * @brief namespace rss
      34                 :            :  */
      35                 :            : namespace rss {
      36                 :            : /*!
      37                 :            :  * @brief namespace world
      38                 :            :  */
      39                 :            : namespace world {
      40                 :            : 
      41                 :            : /*!
      42                 :            :  * \brief DataType LaneSegment
      43                 :            :  *
      44                 :            :  * Defines a lane segment.
      45                 :            :  */
      46                 :            : struct LaneSegment
      47                 :            : {
      48                 :            :   /*!
      49                 :            :    * \brief Smart pointer on LaneSegment
      50                 :            :    */
      51                 :            :   typedef std::shared_ptr<LaneSegment> Ptr;
      52                 :            : 
      53                 :            :   /*!
      54                 :            :    * \brief Smart pointer on constant LaneSegment
      55                 :            :    */
      56                 :            :   typedef std::shared_ptr<LaneSegment const> ConstPtr;
      57                 :            : 
      58                 :            :   /*!
      59                 :            :    * \brief standard constructor
      60                 :            :    */
      61                 :       2666 :   LaneSegment() = default;
      62                 :            : 
      63                 :            :   /*!
      64                 :            :    * \brief standard destructor
      65                 :            :    */
      66                 :            :   ~LaneSegment() = default;
      67                 :            : 
      68                 :            :   /*!
      69                 :            :    * \brief standard copy constructor
      70                 :            :    */
      71                 :            :   LaneSegment(const LaneSegment &other) = default;
      72                 :            : 
      73                 :            :   /*!
      74                 :            :    * \brief standard move constructor
      75                 :            :    */
      76                 :            :   LaneSegment(LaneSegment &&other) = default;
      77                 :            : 
      78                 :            :   /**
      79                 :            :    * \brief standard assignment operator
      80                 :            :    *
      81                 :            :    * \param[in] other Other LaneSegment
      82                 :            :    *
      83                 :            :    * \returns Reference to this LaneSegment.
      84                 :            :    */
      85                 :            :   LaneSegment &operator=(const LaneSegment &other) = default;
      86                 :            : 
      87                 :            :   /**
      88                 :            :    * \brief standard move operator
      89                 :            :    *
      90                 :            :    * \param[in] other Other LaneSegment
      91                 :            :    *
      92                 :            :    * \returns Reference to this LaneSegment.
      93                 :            :    */
      94                 :            :   LaneSegment &operator=(LaneSegment &&other) = default;
      95                 :            : 
      96                 :            :   /**
      97                 :            :    * \brief standard comparison operator
      98                 :            :    *
      99                 :            :    * \param[in] other Other LaneSegment
     100                 :            :    *
     101                 :            :    * \returns \c true if both LaneSegment are equal
     102                 :            :    */
     103                 :         42 :   bool operator==(const LaneSegment &other) const
     104                 :            :   {
     105   [ +  +  +  + ]:         40 :     return (id == other.id) && (type == other.type) && (drivingDirection == other.drivingDirection)
     106   [ +  +  +  +  :         82 :       && (length == other.length) && (width == other.width);
                   +  + ]
     107                 :            :   }
     108                 :            : 
     109                 :            :   /**
     110                 :            :    * \brief standard comparison operator
     111                 :            :    *
     112                 :            :    * \param[in] other Other LaneSegment.
     113                 :            :    *
     114                 :            :    * \returns \c true if both LaneSegment are different
     115                 :            :    */
     116                 :          6 :   bool operator!=(const LaneSegment &other) const
     117                 :            :   {
     118                 :          6 :     return !operator==(other);
     119                 :            :   }
     120                 :            : 
     121                 :            :   /*!
     122                 :            :    * The id of the lane segment.
     123                 :            :    */
     124                 :            :   ::ad::rss::world::LaneSegmentId id;
     125                 :            : 
     126                 :            :   /*!
     127                 :            :    * The type of this lane segment in context of the RssArea it belongs to.
     128                 :            :    */
     129                 :            :   ::ad::rss::world::LaneSegmentType type{::ad::rss::world::LaneSegmentType::Normal};
     130                 :            : 
     131                 :            :   /*!
     132                 :            :    * The nominal direction of the traffic flow of this lane segment in context of the RssArea it belongs to.
     133                 :            :    */
     134                 :            :   ::ad::rss::world::LaneDrivingDirection drivingDirection{::ad::rss::world::LaneDrivingDirection::Bidirectional};
     135                 :            : 
     136                 :            :   /*!
     137                 :            :    * The metric range of the lane segments length.
     138                 :            :    */
     139                 :            :   ::ad::physics::MetricRange length;
     140                 :            : 
     141                 :            :   /*!
     142                 :            :    * The metric range of the lane segments width.
     143                 :            :    */
     144                 :            :   ::ad::physics::MetricRange width;
     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_LANESEGMENT
     155                 :            : #define GEN_GUARD_AD_RSS_WORLD_LANESEGMENT
     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 LaneSegment value
     174                 :            :  *
     175                 :            :  * \returns The stream object.
     176                 :            :  *
     177                 :            :  */
     178                 :       6626 : inline std::ostream &operator<<(std::ostream &os, LaneSegment const &_value)
     179                 :            : {
     180                 :       6626 :   os << "LaneSegment(";
     181                 :       6626 :   os << "id:";
     182                 :       6626 :   os << _value.id;
     183                 :       6626 :   os << ",";
     184                 :       6626 :   os << "type:";
     185                 :       6626 :   os << _value.type;
     186                 :       6626 :   os << ",";
     187                 :       6626 :   os << "drivingDirection:";
     188                 :       6626 :   os << _value.drivingDirection;
     189                 :       6626 :   os << ",";
     190                 :       6626 :   os << "length:";
     191                 :       6626 :   os << _value.length;
     192                 :       6626 :   os << ",";
     193                 :       6626 :   os << "width:";
     194                 :       6626 :   os << _value.width;
     195                 :       6626 :   os << ")";
     196                 :       6626 :   return os;
     197                 :            : }
     198                 :            : 
     199                 :            : } // namespace world
     200                 :            : } // namespace rss
     201                 :            : } // namespace ad
     202                 :            : 
     203                 :            : namespace std {
     204                 :            : /*!
     205                 :            :  * \brief overload of the std::to_string for LaneSegment
     206                 :            :  */
     207                 :          1 : inline std::string to_string(::ad::rss::world::LaneSegment const &value)
     208                 :            : {
     209         [ +  - ]:          2 :   stringstream sstream;
     210         [ +  - ]:          1 :   sstream << value;
     211         [ +  - ]:          2 :   return sstream.str();
     212                 :            : }
     213                 :            : } // namespace std
     214                 :            : #endif // GEN_GUARD_AD_RSS_WORLD_LANESEGMENT

Generated by: LCOV version 1.14