LCOV - code coverage report
Current view: top level - generated/include/ad/map/route - RoadSegment.hpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 26 26 100.0 %
Date: 2022-10-04 09:48:07 Functions: 10 10 100.0 %
Branches: 9 14 64.3 %

           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/point/BoundingSphere.hpp"
      25                 :            : #include "ad/map/route/LaneSegmentList.hpp"
      26                 :            : #include "ad/map/route/SegmentCounter.hpp"
      27                 :            : /*!
      28                 :            :  * @brief namespace ad
      29                 :            :  */
      30                 :            : namespace ad {
      31                 :            : /*!
      32                 :            :  * @brief namespace map
      33                 :            :  */
      34                 :            : namespace map {
      35                 :            : /*!
      36                 :            :  * @brief namespace route
      37                 :            :  *
      38                 :            :  * Handling of routes
      39                 :            :  */
      40                 :            : namespace route {
      41                 :            : 
      42                 :            : /*!
      43                 :            :  * \brief DataType RoadSegment
      44                 :            :  *
      45                 :            :  * Defines a segment of a road containing parallel lanes that are allowed to be used.
      46                 :            :  * The segment consists of an ordered list of RouteLaneInterval entries and a counter
      47                 :            :  * of the road segment.
      48                 :            :  * The RouteLaneIntervals are ordered from right most lane at index 0 up to left most
      49                 :            :  * lane in the sense of the route traveling direction.
      50                 :            :  * The counter is assigned once on route planning indicating the segment count from
      51                 :            :  * destination.
      52                 :            :  * The first segment of the initially planned route should have a segmentCountFromDestination
      53                 :            :  * == 'number of route segments' and
      54                 :            :  * the last segment a segmentCountFromDestination == 1.
      55                 :            :  * If the stack transports only route previews or is shortening the route while traveling
      56                 :            :  * along one gains information on how the route changed.
      57                 :            :  * In addition the road segments bounding sphere is provided.
      58                 :            :  *
      59                 :            :  *
      60                 :            :  */
      61                 :        277 : struct RoadSegment
      62                 :            : {
      63                 :            :   /*!
      64                 :            :    * \brief Smart pointer on RoadSegment
      65                 :            :    */
      66                 :            :   typedef std::shared_ptr<RoadSegment> Ptr;
      67                 :            : 
      68                 :            :   /*!
      69                 :            :    * \brief Smart pointer on constant RoadSegment
      70                 :            :    */
      71                 :            :   typedef std::shared_ptr<RoadSegment const> ConstPtr;
      72                 :            : 
      73                 :            :   /*!
      74                 :            :    * \brief standard constructor
      75                 :            :    */
      76         [ #  # ]:      10851 :   RoadSegment() = default;
      77                 :            : 
      78                 :            :   /*!
      79                 :            :    * \brief standard destructor
      80                 :            :    */
      81                 :      35138 :   ~RoadSegment() = default;
      82                 :            : 
      83                 :            :   /*!
      84                 :            :    * \brief standard copy constructor
      85                 :            :    */
      86                 :      13727 :   RoadSegment(const RoadSegment &other) = default;
      87                 :            : 
      88                 :            :   /*!
      89                 :            :    * \brief standard move constructor
      90                 :            :    */
      91                 :      10560 :   RoadSegment(RoadSegment &&other) = default;
      92                 :            : 
      93                 :            :   /**
      94                 :            :    * \brief standard assignment operator
      95                 :            :    *
      96                 :            :    * \param[in] other Other RoadSegment
      97                 :            :    *
      98                 :            :    * \returns Reference to this RoadSegment.
      99                 :            :    */
     100                 :            :   RoadSegment &operator=(const RoadSegment &other) = default;
     101                 :            : 
     102                 :            :   /**
     103                 :            :    * \brief standard move operator
     104                 :            :    *
     105                 :            :    * \param[in] other Other RoadSegment
     106                 :            :    *
     107                 :            :    * \returns Reference to this RoadSegment.
     108                 :            :    */
     109                 :            :   RoadSegment &operator=(RoadSegment &&other) = default;
     110                 :            : 
     111                 :            :   /**
     112                 :            :    * \brief standard comparison operator
     113                 :            :    *
     114                 :            :    * \param[in] other Other RoadSegment
     115                 :            :    *
     116                 :            :    * \returns \c true if both RoadSegment are equal
     117                 :            :    */
     118                 :         44 :   bool operator==(const RoadSegment &other) const
     119                 :            :   {
     120                 :         44 :     return (drivableLaneSegments == other.drivableLaneSegments)
     121   [ +  +  +  +  :         44 :       && (segmentCountFromDestination == other.segmentCountFromDestination) && (boundingSphere == other.boundingSphere);
                   +  + ]
     122                 :            :   }
     123                 :            : 
     124                 :            :   /**
     125                 :            :    * \brief standard comparison operator
     126                 :            :    *
     127                 :            :    * \param[in] other Other RoadSegment.
     128                 :            :    *
     129                 :            :    * \returns \c true if both RoadSegment are different
     130                 :            :    */
     131                 :          4 :   bool operator!=(const RoadSegment &other) const
     132                 :            :   {
     133                 :          4 :     return !operator==(other);
     134                 :            :   }
     135                 :            : 
     136                 :            :   ::ad::map::route::LaneSegmentList drivableLaneSegments;
     137                 :            :   ::ad::map::route::SegmentCounter segmentCountFromDestination{0};
     138                 :            : 
     139                 :            :   /*!
     140                 :            :    * Bounding sphere of the road segment
     141                 :            :    */
     142                 :            :   ::ad::map::point::BoundingSphere boundingSphere;
     143                 :            : };
     144                 :            : 
     145                 :            : } // namespace route
     146                 :            : } // namespace map
     147                 :            : } // namespace ad
     148                 :            : 
     149                 :            : /*!
     150                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     151                 :            :  */
     152                 :            : #ifndef GEN_GUARD_AD_MAP_ROUTE_ROADSEGMENT
     153                 :            : #define GEN_GUARD_AD_MAP_ROUTE_ROADSEGMENT
     154                 :            : /*!
     155                 :            :  * @brief namespace ad
     156                 :            :  */
     157                 :            : namespace ad {
     158                 :            : /*!
     159                 :            :  * @brief namespace map
     160                 :            :  */
     161                 :            : namespace map {
     162                 :            : /*!
     163                 :            :  * @brief namespace route
     164                 :            :  *
     165                 :            :  * Handling of routes
     166                 :            :  */
     167                 :            : namespace route {
     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                 :         35 : inline std::ostream &operator<<(std::ostream &os, RoadSegment const &_value)
     179                 :            : {
     180                 :         35 :   os << "RoadSegment(";
     181                 :         35 :   os << "drivableLaneSegments:";
     182                 :         35 :   os << _value.drivableLaneSegments;
     183                 :         35 :   os << ",";
     184                 :         35 :   os << "segmentCountFromDestination:";
     185                 :         35 :   os << _value.segmentCountFromDestination;
     186                 :         35 :   os << ",";
     187                 :         35 :   os << "boundingSphere:";
     188                 :         35 :   os << _value.boundingSphere;
     189                 :         35 :   os << ")";
     190                 :         35 :   return os;
     191                 :            : }
     192                 :            : 
     193                 :            : } // namespace route
     194                 :            : } // namespace map
     195                 :            : } // namespace ad
     196                 :            : 
     197                 :            : namespace std {
     198                 :            : /*!
     199                 :            :  * \brief overload of the std::to_string for RoadSegment
     200                 :            :  */
     201                 :          1 : inline std::string to_string(::ad::map::route::RoadSegment const &value)
     202                 :            : {
     203         [ +  - ]:          2 :   stringstream sstream;
     204         [ +  - ]:          1 :   sstream << value;
     205         [ +  - ]:          2 :   return sstream.str();
     206                 :            : }
     207                 :            : } // namespace std
     208                 :            : #endif // GEN_GUARD_AD_MAP_ROUTE_ROADSEGMENT

Generated by: LCOV version 1.14