LCOV - code coverage report
Current view: top level - generated/include/ad/map/route - LaneSegment.hpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 36 36 100.0 %
Date: 2022-10-04 09:48:07 Functions: 10 10 100.0 %
Branches: 16 22 72.7 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2020 Intel Corporation
       5                 :            :  *
       6                 :            :  * SPDX-License-Identifier: MIT
       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/map/lane/LaneId.hpp"
      25                 :            : #include "ad/map/lane/LaneIdList.hpp"
      26                 :            : #include "ad/map/route/LaneInterval.hpp"
      27                 :            : #include "ad/map/route/RouteLaneOffset.hpp"
      28                 :            : /*!
      29                 :            :  * @brief namespace ad
      30                 :            :  */
      31                 :            : namespace ad {
      32                 :            : /*!
      33                 :            :  * @brief namespace map
      34                 :            :  */
      35                 :            : namespace map {
      36                 :            : /*!
      37                 :            :  * @brief namespace route
      38                 :            :  *
      39                 :            :  * Handling of routes
      40                 :            :  */
      41                 :            : namespace route {
      42                 :            : 
      43                 :            : /*!
      44                 :            :  * \brief DataType LaneSegment
      45                 :            :  *
      46                 :            :  * A lane segment is a part of a road segment and therefore created with the context
      47                 :            :  * of a route.
      48                 :            :  * It consists of a specific lane interval and the connection (predecessors, successors,
      49                 :            :  * right and left neighbor) of the lane interval to other lane intervals within the
      50                 :            :  * route.
      51                 :            :  * Be aware: The semantics of the connection is respecting the route direction.
      52                 :            :  */
      53                 :        334 : struct LaneSegment
      54                 :            : {
      55                 :            :   /*!
      56                 :            :    * \brief Smart pointer on LaneSegment
      57                 :            :    */
      58                 :            :   typedef std::shared_ptr<LaneSegment> Ptr;
      59                 :            : 
      60                 :            :   /*!
      61                 :            :    * \brief Smart pointer on constant LaneSegment
      62                 :            :    */
      63                 :            :   typedef std::shared_ptr<LaneSegment const> ConstPtr;
      64                 :            : 
      65                 :            :   /*!
      66                 :            :    * \brief standard constructor
      67                 :            :    */
      68         [ #  # ]:      14288 :   LaneSegment() = default;
      69                 :            : 
      70                 :            :   /*!
      71                 :            :    * \brief standard destructor
      72                 :            :    */
      73                 :      58457 :   ~LaneSegment() = default;
      74                 :            : 
      75                 :            :   /*!
      76                 :            :    * \brief standard copy constructor
      77                 :            :    */
      78         [ +  - ]:      40610 :   LaneSegment(const LaneSegment &other) = default;
      79                 :            : 
      80                 :            :   /*!
      81                 :            :    * \brief standard move constructor
      82                 :            :    */
      83                 :       3559 :   LaneSegment(LaneSegment &&other) = default;
      84                 :            : 
      85                 :            :   /**
      86                 :            :    * \brief standard assignment operator
      87                 :            :    *
      88                 :            :    * \param[in] other Other LaneSegment
      89                 :            :    *
      90                 :            :    * \returns Reference to this LaneSegment.
      91                 :            :    */
      92                 :            :   LaneSegment &operator=(const LaneSegment &other) = default;
      93                 :            : 
      94                 :            :   /**
      95                 :            :    * \brief standard move operator
      96                 :            :    *
      97                 :            :    * \param[in] other Other LaneSegment
      98                 :            :    *
      99                 :            :    * \returns Reference to this LaneSegment.
     100                 :            :    */
     101                 :            :   LaneSegment &operator=(LaneSegment &&other) = default;
     102                 :            : 
     103                 :            :   /**
     104                 :            :    * \brief standard comparison operator
     105                 :            :    *
     106                 :            :    * \param[in] other Other LaneSegment
     107                 :            :    *
     108                 :            :    * \returns \c true if both LaneSegment are equal
     109                 :            :    */
     110                 :         60 :   bool operator==(const LaneSegment &other) const
     111                 :            :   {
     112         [ +  + ]:        118 :     return (leftNeighbor == other.leftNeighbor) && (rightNeighbor == other.rightNeighbor)
     113   [ +  +  +  + ]:         56 :       && (predecessors == other.predecessors) && (successors == other.successors)
     114   [ +  +  +  +  :        118 :       && (laneInterval == other.laneInterval) && (routeLaneOffset == other.routeLaneOffset);
                   +  + ]
     115                 :            :   }
     116                 :            : 
     117                 :            :   /**
     118                 :            :    * \brief standard comparison operator
     119                 :            :    *
     120                 :            :    * \param[in] other Other LaneSegment.
     121                 :            :    *
     122                 :            :    * \returns \c true if both LaneSegment are different
     123                 :            :    */
     124                 :          7 :   bool operator!=(const LaneSegment &other) const
     125                 :            :   {
     126                 :          7 :     return !operator==(other);
     127                 :            :   }
     128                 :            : 
     129                 :            :   /*!
     130                 :            :    * The identifier of the left neighboring lane
     131                 :            :    */
     132                 :            :   ::ad::map::lane::LaneId leftNeighbor{0};
     133                 :            : 
     134                 :            :   /*!
     135                 :            :    * The identifier of the right neighboring lane
     136                 :            :    */
     137                 :            :   ::ad::map::lane::LaneId rightNeighbor{0};
     138                 :            : 
     139                 :            :   /*!
     140                 :            :    * The list of lane identifiers of preceding lanes
     141                 :            :    */
     142                 :            :   ::ad::map::lane::LaneIdList predecessors;
     143                 :            : 
     144                 :            :   /*!
     145                 :            :    * The list of lane identifiers of succeeding lanes
     146                 :            :    */
     147                 :            :   ::ad::map::lane::LaneIdList successors;
     148                 :            : 
     149                 :            :   /*!
     150                 :            :    * The interval of the lane
     151                 :            :    */
     152                 :            :   ::ad::map::route::LaneInterval laneInterval;
     153                 :            : 
     154                 :            :   /*!
     155                 :            :    * The offset of the lane in number of lane changes left (--) or right (++) from start of the route planning.
     156                 :            :    */
     157                 :            :   ::ad::map::route::RouteLaneOffset routeLaneOffset{0};
     158                 :            : };
     159                 :            : 
     160                 :            : } // namespace route
     161                 :            : } // namespace map
     162                 :            : } // namespace ad
     163                 :            : 
     164                 :            : /*!
     165                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     166                 :            :  */
     167                 :            : #ifndef GEN_GUARD_AD_MAP_ROUTE_LANESEGMENT
     168                 :            : #define GEN_GUARD_AD_MAP_ROUTE_LANESEGMENT
     169                 :            : /*!
     170                 :            :  * @brief namespace ad
     171                 :            :  */
     172                 :            : namespace ad {
     173                 :            : /*!
     174                 :            :  * @brief namespace map
     175                 :            :  */
     176                 :            : namespace map {
     177                 :            : /*!
     178                 :            :  * @brief namespace route
     179                 :            :  *
     180                 :            :  * Handling of routes
     181                 :            :  */
     182                 :            : namespace route {
     183                 :            : 
     184                 :            : /**
     185                 :            :  * \brief standard ostream operator
     186                 :            :  *
     187                 :            :  * \param[in] os The output stream to write to
     188                 :            :  * \param[in] _value LaneSegment value
     189                 :            :  *
     190                 :            :  * \returns The stream object.
     191                 :            :  *
     192                 :            :  */
     193                 :         43 : inline std::ostream &operator<<(std::ostream &os, LaneSegment const &_value)
     194                 :            : {
     195                 :         43 :   os << "LaneSegment(";
     196                 :         43 :   os << "leftNeighbor:";
     197                 :         43 :   os << _value.leftNeighbor;
     198                 :         43 :   os << ",";
     199                 :         43 :   os << "rightNeighbor:";
     200                 :         43 :   os << _value.rightNeighbor;
     201                 :         43 :   os << ",";
     202                 :         43 :   os << "predecessors:";
     203                 :         43 :   os << _value.predecessors;
     204                 :         43 :   os << ",";
     205                 :         43 :   os << "successors:";
     206                 :         43 :   os << _value.successors;
     207                 :         43 :   os << ",";
     208                 :         43 :   os << "laneInterval:";
     209                 :         43 :   os << _value.laneInterval;
     210                 :         43 :   os << ",";
     211                 :         43 :   os << "routeLaneOffset:";
     212                 :         43 :   os << _value.routeLaneOffset;
     213                 :         43 :   os << ")";
     214                 :         43 :   return os;
     215                 :            : }
     216                 :            : 
     217                 :            : } // namespace route
     218                 :            : } // namespace map
     219                 :            : } // namespace ad
     220                 :            : 
     221                 :            : namespace std {
     222                 :            : /*!
     223                 :            :  * \brief overload of the std::to_string for LaneSegment
     224                 :            :  */
     225                 :          1 : inline std::string to_string(::ad::map::route::LaneSegment const &value)
     226                 :            : {
     227         [ +  - ]:          2 :   stringstream sstream;
     228         [ +  - ]:          1 :   sstream << value;
     229         [ +  - ]:          2 :   return sstream.str();
     230                 :            : }
     231                 :            : } // namespace std
     232                 :            : #endif // GEN_GUARD_AD_MAP_ROUTE_LANESEGMENT

Generated by: LCOV version 1.14