LCOV - code coverage report
Current view: top level - generated/include/ad/map/point - ParaPoint.hpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 18 18 100.0 %
Date: 2022-10-04 09:48:07 Functions: 5 5 100.0 %
Branches: 7 10 70.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/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 point
      36                 :            :  *
      37                 :            :  * Handling geographic positions in different coordinate systems
      38                 :            :  */
      39                 :            : namespace point {
      40                 :            : 
      41                 :            : /*!
      42                 :            :  * \brief DataType ParaPoint
      43                 :            :  *
      44                 :            :  * Defines a parametric point on a lane of the map.
      45                 :            :  * The parametric offset refers to the lanes geometrical representation.
      46                 :            :  * Be aware: It is independent from the logical nominal driving direction of a lane.
      47                 :            :  */
      48                 :            : struct ParaPoint
      49                 :            : {
      50                 :            :   /*!
      51                 :            :    * \brief Smart pointer on ParaPoint
      52                 :            :    */
      53                 :            :   typedef std::shared_ptr<ParaPoint> Ptr;
      54                 :            : 
      55                 :            :   /*!
      56                 :            :    * \brief Smart pointer on constant ParaPoint
      57                 :            :    */
      58                 :            :   typedef std::shared_ptr<ParaPoint const> ConstPtr;
      59                 :            : 
      60                 :            :   /*!
      61                 :            :    * \brief standard constructor
      62                 :            :    */
      63                 :    1094451 :   ParaPoint() = default;
      64                 :            : 
      65                 :            :   /*!
      66                 :            :    * \brief standard destructor
      67                 :            :    */
      68                 :            :   ~ParaPoint() = default;
      69                 :            : 
      70                 :            :   /*!
      71                 :            :    * \brief standard copy constructor
      72                 :            :    */
      73                 :            :   ParaPoint(const ParaPoint &other) = default;
      74                 :            : 
      75                 :            :   /*!
      76                 :            :    * \brief standard move constructor
      77                 :            :    */
      78                 :            :   ParaPoint(ParaPoint &&other) = default;
      79                 :            : 
      80                 :            :   /**
      81                 :            :    * \brief standard assignment operator
      82                 :            :    *
      83                 :            :    * \param[in] other Other ParaPoint
      84                 :            :    *
      85                 :            :    * \returns Reference to this ParaPoint.
      86                 :            :    */
      87                 :            :   ParaPoint &operator=(const ParaPoint &other) = default;
      88                 :            : 
      89                 :            :   /**
      90                 :            :    * \brief standard move operator
      91                 :            :    *
      92                 :            :    * \param[in] other Other ParaPoint
      93                 :            :    *
      94                 :            :    * \returns Reference to this ParaPoint.
      95                 :            :    */
      96                 :            :   ParaPoint &operator=(ParaPoint &&other) = default;
      97                 :            : 
      98                 :            :   /**
      99                 :            :    * \brief standard comparison operator
     100                 :            :    *
     101                 :            :    * \param[in] other Other ParaPoint
     102                 :            :    *
     103                 :            :    * \returns \c true if both ParaPoint are equal
     104                 :            :    */
     105                 :      41468 :   bool operator==(const ParaPoint &other) const
     106                 :            :   {
     107   [ +  +  +  + ]:      41468 :     return (laneId == other.laneId) && (parametricOffset == other.parametricOffset);
     108                 :            :   }
     109                 :            : 
     110                 :            :   /**
     111                 :            :    * \brief standard comparison operator
     112                 :            :    *
     113                 :            :    * \param[in] other Other ParaPoint.
     114                 :            :    *
     115                 :            :    * \returns \c true if both ParaPoint are different
     116                 :            :    */
     117                 :          3 :   bool operator!=(const ParaPoint &other) const
     118                 :            :   {
     119                 :          3 :     return !operator==(other);
     120                 :            :   }
     121                 :            : 
     122                 :            :   /*!
     123                 :            :    * The id of the lane this parametric point belongs to.
     124                 :            :    */
     125                 :            :   ::ad::map::lane::LaneId laneId{0};
     126                 :            : 
     127                 :            :   /*!
     128                 :            :    * The parametric offset in the range of [0;1] within the lane's geometry as defined
     129                 :            :    * in the map.
     130                 :            :    * 0.0 refers to the start of the lanes points.
     131                 :            :    * 1.0 refers to the end of the lanes points.
     132                 :            :    * 0.5 refers to in between at half length of the lane.
     133                 :            :    * Be aware: Depending on the route direction on the lane either the parametric offset
     134                 :            :    * 0.0 or 1.0 can define the start point of that route on that lane.
     135                 :            :    */
     136                 :            :   ::ad::physics::ParametricValue parametricOffset;
     137                 :            : };
     138                 :            : 
     139                 :            : } // namespace point
     140                 :            : } // namespace map
     141                 :            : } // namespace ad
     142                 :            : 
     143                 :            : /*!
     144                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     145                 :            :  */
     146                 :            : #ifndef GEN_GUARD_AD_MAP_POINT_PARAPOINT
     147                 :            : #define GEN_GUARD_AD_MAP_POINT_PARAPOINT
     148                 :            : /*!
     149                 :            :  * @brief namespace ad
     150                 :            :  */
     151                 :            : namespace ad {
     152                 :            : /*!
     153                 :            :  * @brief namespace map
     154                 :            :  */
     155                 :            : namespace map {
     156                 :            : /*!
     157                 :            :  * @brief namespace point
     158                 :            :  *
     159                 :            :  * Handling geographic positions in different coordinate systems
     160                 :            :  */
     161                 :            : namespace point {
     162                 :            : 
     163                 :            : /**
     164                 :            :  * \brief standard ostream operator
     165                 :            :  *
     166                 :            :  * \param[in] os The output stream to write to
     167                 :            :  * \param[in] _value ParaPoint value
     168                 :            :  *
     169                 :            :  * \returns The stream object.
     170                 :            :  *
     171                 :            :  */
     172                 :         66 : inline std::ostream &operator<<(std::ostream &os, ParaPoint const &_value)
     173                 :            : {
     174                 :         66 :   os << "ParaPoint(";
     175                 :         66 :   os << "laneId:";
     176                 :         66 :   os << _value.laneId;
     177                 :         66 :   os << ",";
     178                 :         66 :   os << "parametricOffset:";
     179                 :         66 :   os << _value.parametricOffset;
     180                 :         66 :   os << ")";
     181                 :         66 :   return os;
     182                 :            : }
     183                 :            : 
     184                 :            : } // namespace point
     185                 :            : } // namespace map
     186                 :            : } // namespace ad
     187                 :            : 
     188                 :            : namespace std {
     189                 :            : /*!
     190                 :            :  * \brief overload of the std::to_string for ParaPoint
     191                 :            :  */
     192                 :          1 : inline std::string to_string(::ad::map::point::ParaPoint const &value)
     193                 :            : {
     194         [ +  - ]:          2 :   stringstream sstream;
     195         [ +  - ]:          1 :   sstream << value;
     196         [ +  - ]:          2 :   return sstream.str();
     197                 :            : }
     198                 :            : } // namespace std
     199                 :            : #endif // GEN_GUARD_AD_MAP_POINT_PARAPOINT

Generated by: LCOV version 1.14