LCOV - code coverage report
Current view: top level - generated/include/ad/map/route - FullRoute.hpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 40 40 100.0 %
Date: 2022-10-04 09:48:07 Functions: 10 10 100.0 %
Branches: 17 20 85.0 %

           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/route/RoadSegmentList.hpp"
      25                 :            : #include "ad/map/route/RouteCreationMode.hpp"
      26                 :            : #include "ad/map/route/RouteLaneOffset.hpp"
      27                 :            : #include "ad/map/route/RoutePlanningCounter.hpp"
      28                 :            : #include "ad/map/route/SegmentCounter.hpp"
      29                 :            : /*!
      30                 :            :  * @brief namespace ad
      31                 :            :  */
      32                 :            : namespace ad {
      33                 :            : /*!
      34                 :            :  * @brief namespace map
      35                 :            :  */
      36                 :            : namespace map {
      37                 :            : /*!
      38                 :            :  * @brief namespace route
      39                 :            :  *
      40                 :            :  * Handling of routes
      41                 :            :  */
      42                 :            : namespace route {
      43                 :            : 
      44                 :            : /*!
      45                 :            :  * \brief DataType FullRoute
      46                 :            :  *
      47                 :            :  * Defines a route along a road containing a consecutive RouteRoadSegments, a counter
      48                 :            :  * of the segments and a route planning counter
      49                 :            :  * The counters are assigned once on route planning.
      50                 :            :  * The route planning counter indicates if a replanning of the route took place.
      51                 :            :  * The fullRouteSegmentCount indicates the number of route segments after route planning.
      52                 :            :  * If the stack transports only route previews or is shortening the route while traveling
      53                 :            :  * along the counters remain untouched.
      54                 :            :  *
      55                 :            :  *
      56                 :            :  *
      57                 :            :  *
      58                 :            :  */
      59                 :        249 : struct FullRoute
      60                 :            : {
      61                 :            :   /*!
      62                 :            :    * \brief Smart pointer on FullRoute
      63                 :            :    */
      64                 :            :   typedef std::shared_ptr<FullRoute> Ptr;
      65                 :            : 
      66                 :            :   /*!
      67                 :            :    * \brief Smart pointer on constant FullRoute
      68                 :            :    */
      69                 :            :   typedef std::shared_ptr<FullRoute const> ConstPtr;
      70                 :            : 
      71                 :            :   /*!
      72                 :            :    * \brief standard constructor
      73                 :            :    */
      74                 :       3160 :   FullRoute() = default;
      75                 :            : 
      76                 :            :   /*!
      77                 :            :    * \brief standard destructor
      78                 :            :    */
      79                 :       3985 :   ~FullRoute() = default;
      80                 :            : 
      81                 :            :   /*!
      82                 :            :    * \brief standard copy constructor
      83                 :            :    */
      84                 :        385 :   FullRoute(const FullRoute &other) = default;
      85                 :            : 
      86                 :            :   /*!
      87                 :            :    * \brief standard move constructor
      88                 :            :    */
      89                 :        440 :   FullRoute(FullRoute &&other) = default;
      90                 :            : 
      91                 :            :   /**
      92                 :            :    * \brief standard assignment operator
      93                 :            :    *
      94                 :            :    * \param[in] other Other FullRoute
      95                 :            :    *
      96                 :            :    * \returns Reference to this FullRoute.
      97                 :            :    */
      98                 :            :   FullRoute &operator=(const FullRoute &other) = default;
      99                 :            : 
     100                 :            :   /**
     101                 :            :    * \brief standard move operator
     102                 :            :    *
     103                 :            :    * \param[in] other Other FullRoute
     104                 :            :    *
     105                 :            :    * \returns Reference to this FullRoute.
     106                 :            :    */
     107                 :            :   FullRoute &operator=(FullRoute &&other) = default;
     108                 :            : 
     109                 :            :   /**
     110                 :            :    * \brief standard comparison operator
     111                 :            :    *
     112                 :            :    * \param[in] other Other FullRoute
     113                 :            :    *
     114                 :            :    * \returns \c true if both FullRoute are equal
     115                 :            :    */
     116                 :         40 :   bool operator==(const FullRoute &other) const
     117                 :            :   {
     118         [ +  + ]:         74 :     return (roadSegments == other.roadSegments) && (routePlanningCounter == other.routePlanningCounter)
     119         [ +  + ]:         32 :       && (fullRouteSegmentCount == other.fullRouteSegmentCount)
     120   [ +  +  +  + ]:         30 :       && (destinationLaneOffset == other.destinationLaneOffset) && (minLaneOffset == other.minLaneOffset)
     121   [ +  +  +  +  :         74 :       && (maxLaneOffset == other.maxLaneOffset) && (routeCreationMode == other.routeCreationMode);
                   +  + ]
     122                 :            :   }
     123                 :            : 
     124                 :            :   /**
     125                 :            :    * \brief standard comparison operator
     126                 :            :    *
     127                 :            :    * \param[in] other Other FullRoute.
     128                 :            :    *
     129                 :            :    * \returns \c true if both FullRoute are different
     130                 :            :    */
     131                 :          8 :   bool operator!=(const FullRoute &other) const
     132                 :            :   {
     133                 :          8 :     return !operator==(other);
     134                 :            :   }
     135                 :            : 
     136                 :            :   ::ad::map::route::RoadSegmentList roadSegments;
     137                 :            :   ::ad::map::route::RoutePlanningCounter routePlanningCounter{0u};
     138                 :            :   ::ad::map::route::SegmentCounter fullRouteSegmentCount{0u};
     139                 :            : 
     140                 :            :   /*!
     141                 :            :    * The lane offset of the planning destination.
     142                 :            :    */
     143                 :            :   ::ad::map::route::RouteLaneOffset destinationLaneOffset{0};
     144                 :            : 
     145                 :            :   /*!
     146                 :            :    * The minimal lane offset of the route.
     147                 :            :    */
     148                 :            :   ::ad::map::route::RouteLaneOffset minLaneOffset{0};
     149                 :            : 
     150                 :            :   /*!
     151                 :            :    * The maximal lane offset of the route.
     152                 :            :    */
     153                 :            :   ::ad::map::route::RouteLaneOffset maxLaneOffset{0};
     154                 :            : 
     155                 :            :   /*!
     156                 :            :    * Store the information on how the route was initially created to be able to consider this when applying route
     157                 :            :    * operations.
     158                 :            :    */
     159                 :            :   ::ad::map::route::RouteCreationMode routeCreationMode{::ad::map::route::RouteCreationMode::Undefined};
     160                 :            : };
     161                 :            : 
     162                 :            : } // namespace route
     163                 :            : } // namespace map
     164                 :            : } // namespace ad
     165                 :            : 
     166                 :            : /*!
     167                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     168                 :            :  */
     169                 :            : #ifndef GEN_GUARD_AD_MAP_ROUTE_FULLROUTE
     170                 :            : #define GEN_GUARD_AD_MAP_ROUTE_FULLROUTE
     171                 :            : /*!
     172                 :            :  * @brief namespace ad
     173                 :            :  */
     174                 :            : namespace ad {
     175                 :            : /*!
     176                 :            :  * @brief namespace map
     177                 :            :  */
     178                 :            : namespace map {
     179                 :            : /*!
     180                 :            :  * @brief namespace route
     181                 :            :  *
     182                 :            :  * Handling of routes
     183                 :            :  */
     184                 :            : namespace route {
     185                 :            : 
     186                 :            : /**
     187                 :            :  * \brief standard ostream operator
     188                 :            :  *
     189                 :            :  * \param[in] os The output stream to write to
     190                 :            :  * \param[in] _value FullRoute value
     191                 :            :  *
     192                 :            :  * \returns The stream object.
     193                 :            :  *
     194                 :            :  */
     195                 :         29 : inline std::ostream &operator<<(std::ostream &os, FullRoute const &_value)
     196                 :            : {
     197                 :         29 :   os << "FullRoute(";
     198                 :         29 :   os << "roadSegments:";
     199                 :         29 :   os << _value.roadSegments;
     200                 :         29 :   os << ",";
     201                 :         29 :   os << "routePlanningCounter:";
     202                 :         29 :   os << _value.routePlanningCounter;
     203                 :         29 :   os << ",";
     204                 :         29 :   os << "fullRouteSegmentCount:";
     205                 :         29 :   os << _value.fullRouteSegmentCount;
     206                 :         29 :   os << ",";
     207                 :         29 :   os << "destinationLaneOffset:";
     208                 :         29 :   os << _value.destinationLaneOffset;
     209                 :         29 :   os << ",";
     210                 :         29 :   os << "minLaneOffset:";
     211                 :         29 :   os << _value.minLaneOffset;
     212                 :         29 :   os << ",";
     213                 :         29 :   os << "maxLaneOffset:";
     214                 :         29 :   os << _value.maxLaneOffset;
     215                 :         29 :   os << ",";
     216                 :         29 :   os << "routeCreationMode:";
     217                 :         29 :   os << _value.routeCreationMode;
     218                 :         29 :   os << ")";
     219                 :         29 :   return os;
     220                 :            : }
     221                 :            : 
     222                 :            : } // namespace route
     223                 :            : } // namespace map
     224                 :            : } // namespace ad
     225                 :            : 
     226                 :            : namespace std {
     227                 :            : /*!
     228                 :            :  * \brief overload of the std::to_string for FullRoute
     229                 :            :  */
     230                 :          1 : inline std::string to_string(::ad::map::route::FullRoute const &value)
     231                 :            : {
     232         [ +  - ]:          2 :   stringstream sstream;
     233         [ +  - ]:          1 :   sstream << value;
     234         [ +  - ]:          2 :   return sstream.str();
     235                 :            : }
     236                 :            : } // namespace std
     237                 :            : #endif // GEN_GUARD_AD_MAP_ROUTE_FULLROUTE

Generated by: LCOV version 1.14