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

           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/physics/ParametricValue.hpp"
      26                 :            : /*!
      27                 :            :  * @brief namespace ad
      28                 :            :  */
      29                 :            : namespace ad {
      30                 :            : /*!
      31                 :            :  * @brief namespace map
      32                 :            :  */
      33                 :            : namespace map {
      34                 :            : /*!
      35                 :            :  * @brief namespace route
      36                 :            :  *
      37                 :            :  * Handling of routes
      38                 :            :  */
      39                 :            : namespace route {
      40                 :            : 
      41                 :            : /*!
      42                 :            :  * \brief DataType LaneInterval
      43                 :            :  *
      44                 :            :  * Defines an interval on a lane containing a parametric start and end value.
      45                 :            :  * The ordering describes the logical start and logical end of the interval when traveling
      46                 :            :  * on a lane along the route.
      47                 :            :  * If the parametric values are given with start > end the route traveling direction
      48                 :            :  * is negative compared to the geometrical direction of the lane.
      49                 :            :  * Be awae: it doesn't provide insight into the nominal driving direction of a lane.
      50                 :            :  */
      51                 :            : struct LaneInterval
      52                 :            : {
      53                 :            :   /*!
      54                 :            :    * \brief Smart pointer on LaneInterval
      55                 :            :    */
      56                 :            :   typedef std::shared_ptr<LaneInterval> Ptr;
      57                 :            : 
      58                 :            :   /*!
      59                 :            :    * \brief Smart pointer on constant LaneInterval
      60                 :            :    */
      61                 :            :   typedef std::shared_ptr<LaneInterval const> ConstPtr;
      62                 :            : 
      63                 :            :   /*!
      64                 :            :    * \brief standard constructor
      65                 :            :    */
      66                 :      26532 :   LaneInterval() = default;
      67                 :            : 
      68                 :            :   /*!
      69                 :            :    * \brief standard destructor
      70                 :            :    */
      71                 :            :   ~LaneInterval() = default;
      72                 :            : 
      73                 :            :   /*!
      74                 :            :    * \brief standard copy constructor
      75                 :            :    */
      76                 :            :   LaneInterval(const LaneInterval &other) = default;
      77                 :            : 
      78                 :            :   /*!
      79                 :            :    * \brief standard move constructor
      80                 :            :    */
      81                 :            :   LaneInterval(LaneInterval &&other) = default;
      82                 :            : 
      83                 :            :   /**
      84                 :            :    * \brief standard assignment operator
      85                 :            :    *
      86                 :            :    * \param[in] other Other LaneInterval
      87                 :            :    *
      88                 :            :    * \returns Reference to this LaneInterval.
      89                 :            :    */
      90                 :            :   LaneInterval &operator=(const LaneInterval &other) = default;
      91                 :            : 
      92                 :            :   /**
      93                 :            :    * \brief standard move operator
      94                 :            :    *
      95                 :            :    * \param[in] other Other LaneInterval
      96                 :            :    *
      97                 :            :    * \returns Reference to this LaneInterval.
      98                 :            :    */
      99                 :            :   LaneInterval &operator=(LaneInterval &&other) = default;
     100                 :            : 
     101                 :            :   /**
     102                 :            :    * \brief standard comparison operator
     103                 :            :    *
     104                 :            :    * \param[in] other Other LaneInterval
     105                 :            :    *
     106                 :            :    * \returns \c true if both LaneInterval are equal
     107                 :            :    */
     108                 :         80 :   bool operator==(const LaneInterval &other) const
     109                 :            :   {
     110   [ +  +  +  +  :         80 :     return (laneId == other.laneId) && (start == other.start) && (end == other.end) && (wrongWay == other.wrongWay);
             +  +  +  + ]
     111                 :            :   }
     112                 :            : 
     113                 :            :   /**
     114                 :            :    * \brief standard comparison operator
     115                 :            :    *
     116                 :            :    * \param[in] other Other LaneInterval.
     117                 :            :    *
     118                 :            :    * \returns \c true if both LaneInterval are different
     119                 :            :    */
     120                 :          5 :   bool operator!=(const LaneInterval &other) const
     121                 :            :   {
     122                 :          5 :     return !operator==(other);
     123                 :            :   }
     124                 :            : 
     125                 :            :   ::ad::map::lane::LaneId laneId{0};
     126                 :            :   ::ad::physics::ParametricValue start;
     127                 :            :   ::ad::physics::ParametricValue end;
     128                 :            : 
     129                 :            :   /*!
     130                 :            :    * True, if driving is against the correct driving direction
     131                 :            :    */
     132                 :            :   bool wrongWay{false};
     133                 :            : };
     134                 :            : 
     135                 :            : } // namespace route
     136                 :            : } // namespace map
     137                 :            : } // namespace ad
     138                 :            : 
     139                 :            : /*!
     140                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     141                 :            :  */
     142                 :            : #ifndef GEN_GUARD_AD_MAP_ROUTE_LANEINTERVAL
     143                 :            : #define GEN_GUARD_AD_MAP_ROUTE_LANEINTERVAL
     144                 :            : /*!
     145                 :            :  * @brief namespace ad
     146                 :            :  */
     147                 :            : namespace ad {
     148                 :            : /*!
     149                 :            :  * @brief namespace map
     150                 :            :  */
     151                 :            : namespace map {
     152                 :            : /*!
     153                 :            :  * @brief namespace route
     154                 :            :  *
     155                 :            :  * Handling of routes
     156                 :            :  */
     157                 :            : namespace route {
     158                 :            : 
     159                 :            : /**
     160                 :            :  * \brief standard ostream operator
     161                 :            :  *
     162                 :            :  * \param[in] os The output stream to write to
     163                 :            :  * \param[in] _value LaneInterval value
     164                 :            :  *
     165                 :            :  * \returns The stream object.
     166                 :            :  *
     167                 :            :  */
     168                 :         53 : inline std::ostream &operator<<(std::ostream &os, LaneInterval const &_value)
     169                 :            : {
     170                 :         53 :   os << "LaneInterval(";
     171                 :         53 :   os << "laneId:";
     172                 :         53 :   os << _value.laneId;
     173                 :         53 :   os << ",";
     174                 :         53 :   os << "start:";
     175                 :         53 :   os << _value.start;
     176                 :         53 :   os << ",";
     177                 :         53 :   os << "end:";
     178                 :         53 :   os << _value.end;
     179                 :         53 :   os << ",";
     180                 :         53 :   os << "wrongWay:";
     181                 :         53 :   os << _value.wrongWay;
     182                 :         53 :   os << ")";
     183                 :         53 :   return os;
     184                 :            : }
     185                 :            : 
     186                 :            : } // namespace route
     187                 :            : } // namespace map
     188                 :            : } // namespace ad
     189                 :            : 
     190                 :            : namespace std {
     191                 :            : /*!
     192                 :            :  * \brief overload of the std::to_string for LaneInterval
     193                 :            :  */
     194                 :          1 : inline std::string to_string(::ad::map::route::LaneInterval const &value)
     195                 :            : {
     196         [ +  - ]:          2 :   stringstream sstream;
     197         [ +  - ]:          1 :   sstream << value;
     198         [ +  - ]:          2 :   return sstream.str();
     199                 :            : }
     200                 :            : } // namespace std
     201                 :            : #endif // GEN_GUARD_AD_MAP_ROUTE_LANEINTERVAL

Generated by: LCOV version 1.14