LCOV - code coverage report
Current view: top level - include/ad/map/point - ParaPointOperation.hpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 11 11 100.0 %
Date: 2022-10-04 09:48:07 Functions: 2 2 100.0 %
Branches: 4 6 66.7 %

           Branch data     Line data    Source code
       1                 :            : // ----------------- BEGIN LICENSE BLOCK ---------------------------------
       2                 :            : //
       3                 :            : // Copyright (C) 2018-2021 Intel Corporation
       4                 :            : //
       5                 :            : // SPDX-License-Identifier: MIT
       6                 :            : //
       7                 :            : // ----------------- END LICENSE BLOCK -----------------------------------
       8                 :            : /**
       9                 :            :  * @file
      10                 :            :  */
      11                 :            : 
      12                 :            : #pragma once
      13                 :            : 
      14                 :            : #include "ad/map/point/ParaPoint.hpp"
      15                 :            : 
      16                 :            : /** @brief namespace ad */
      17                 :            : namespace ad {
      18                 :            : /** @brief namespace map */
      19                 :            : namespace map {
      20                 :            : /** @brief namespace point */
      21                 :            : namespace point {
      22                 :            : 
      23                 :            : /**
      24                 :            :  * @brief create a ParaPoint
      25                 :            :  *
      26                 :            :  * @param[in] laneId  the lane id
      27                 :            :  * @param[in] parametricOffset the parametric offset
      28                 :            :  */
      29                 :       5451 : inline ParaPoint createParaPoint(lane::LaneId const &laneId, physics::ParametricValue const &parametricOffset)
      30                 :            : {
      31         [ #  # ]:       5451 :   ParaPoint result;
      32                 :       5451 :   result.laneId = laneId;
      33                 :       5451 :   result.parametricOffset = parametricOffset;
      34                 :       5451 :   return result;
      35                 :            : }
      36                 :            : 
      37                 :            : } // namespace point
      38                 :            : } // namespace map
      39                 :            : } // namespace ad
      40                 :            : 
      41                 :            : /**
      42                 :            :  * @brief Standard comparison operator.
      43                 :            :  * @returns True if left object can be seen as less than right object.
      44                 :            :  */
      45                 :     604731 : inline bool operator<(const ::ad::map::point::ParaPoint &left, const ::ad::map::point::ParaPoint &right)
      46                 :            : {
      47         [ +  + ]:     604731 :   if (left.laneId < right.laneId)
      48                 :            :   {
      49                 :     258153 :     return true;
      50                 :            :   }
      51         [ +  + ]:     346578 :   else if (left.laneId == right.laneId)
      52                 :            :   {
      53                 :     174495 :     return left.parametricOffset < right.parametricOffset;
      54                 :            :   }
      55                 :            :   else
      56                 :            :   {
      57                 :     172083 :     return false;
      58                 :            :   }
      59                 :            : }
      60                 :            : 
      61                 :            : /**
      62                 :            :  * @brief Standard comparison operator
      63                 :            :  * @returns True if left object can be seen as greater than right object.
      64                 :            :  */
      65                 :            : inline bool operator>(const ::ad::map::point::ParaPoint &left, const ::ad::map::point::ParaPoint &right)
      66                 :            : {
      67                 :            :   if (left.laneId > right.laneId)
      68                 :            :   {
      69                 :            :     return true;
      70                 :            :   }
      71                 :            :   else if (left.laneId == right.laneId)
      72                 :            :   {
      73                 :            :     return left.parametricOffset > right.parametricOffset;
      74                 :            :   }
      75                 :            :   else
      76                 :            :   {
      77                 :            :     return false;
      78                 :            :   }
      79                 :            : }
      80                 :            : 
      81                 :            : /**
      82                 :            :  * @brief Standard comparison operator.
      83                 :            :  * @returns True if left object can be seen as less than or equal to right object.
      84                 :            :  */
      85                 :            : inline bool operator<=(const ::ad::map::point::ParaPoint &left, const ::ad::map::point::ParaPoint &right)
      86                 :            : {
      87                 :            :   return operator<(left, right) || (left == right);
      88                 :            : }
      89                 :            : 
      90                 :            : /**
      91                 :            :  * @brief Standard comparison operator.
      92                 :            :  * @returns True if left object can be seen as greater than or equal to right object.
      93                 :            :  */
      94                 :            : inline bool operator>=(const ::ad::map::point::ParaPoint &left, const ::ad::map::point::ParaPoint &right)
      95                 :            : {
      96                 :            :   return operator>(left, right) || (left == right);
      97                 :            : }

Generated by: LCOV version 1.14