LCOV - code coverage report
Current view: top level - generated/include/ad/rss/core - RelativePosition.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 27 29 93.1 %
Date: 2025-07-22 06:53:46 Functions: 5 6 83.3 %
Branches: 11 14 78.6 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2022 Intel Corporation
       5                 :            :  *
       6                 :            :  * SPDX-License-Identifier: LGPL-2.1-only
       7                 :            :  *
       8                 :            :  * ----------------- END LICENSE BLOCK -----------------------------------
       9                 :            :  */
      10                 :            : 
      11                 :            : /**
      12                 :            :  * Generated file
      13                 :            :  * @file
      14                 :            :  *
      15                 :            :  * Generator Version : 11.0.0-2046
      16                 :            :  */
      17                 :            : 
      18                 :            : #pragma once
      19                 :            : 
      20                 :            : #include <iostream>
      21                 :            : #include <limits>
      22                 :            : #include <memory>
      23                 :            : #include <sstream>
      24                 :            : #include "ad/physics/Distance.hpp"
      25                 :            : #include "ad/rss/core/LateralRelativePosition.hpp"
      26                 :            : #include "ad/rss/core/LongitudinalRelativePosition.hpp"
      27                 :            : /*!
      28                 :            :  * @brief namespace ad
      29                 :            :  */
      30                 :            : namespace ad {
      31                 :            : /*!
      32                 :            :  * @brief namespace rss
      33                 :            :  */
      34                 :            : namespace rss {
      35                 :            : /*!
      36                 :            :  * @brief namespace core
      37                 :            :  */
      38                 :            : namespace core {
      39                 :            : 
      40                 :            : /*!
      41                 :            :  * \brief DataType RelativePosition
      42                 :            :  *
      43                 :            :  * Describes the relative position between two objects within their constellation specific lane coordinate system.
      44                 :            :  */
      45                 :            : struct RelativePosition
      46                 :            : {
      47                 :            :   /*!
      48                 :            :    * \brief Smart pointer on RelativePosition
      49                 :            :    */
      50                 :            :   typedef std::shared_ptr<RelativePosition> Ptr;
      51                 :            : 
      52                 :            :   /*!
      53                 :            :    * \brief Smart pointer on constant RelativePosition
      54                 :            :    */
      55                 :            :   typedef std::shared_ptr<RelativePosition const> ConstPtr;
      56                 :            : 
      57                 :            :   /*!
      58                 :            :    * \brief standard constructor
      59                 :            :    */
      60                 :       5256 :   RelativePosition() = default;
      61                 :            : 
      62                 :            :   /*!
      63                 :            :    * \brief standard destructor
      64                 :            :    */
      65                 :            :   ~RelativePosition() = default;
      66                 :            : 
      67                 :            :   /*!
      68                 :            :    * \brief standard copy constructor
      69                 :            :    */
      70                 :            :   RelativePosition(const RelativePosition &other) = default;
      71                 :            : 
      72                 :            :   /*!
      73                 :            :    * \brief standard move constructor
      74                 :            :    */
      75                 :            :   RelativePosition(RelativePosition &&other) = default;
      76                 :            : 
      77                 :            :   /**
      78                 :            :    * \brief standard assignment operator
      79                 :            :    *
      80                 :            :    * \param[in] other Other RelativePosition
      81                 :            :    *
      82                 :            :    * \returns Reference to this RelativePosition.
      83                 :            :    */
      84                 :            :   RelativePosition &operator=(const RelativePosition &other) = default;
      85                 :            : 
      86                 :            :   /**
      87                 :            :    * \brief standard move operator
      88                 :            :    *
      89                 :            :    * \param[in] other Other RelativePosition
      90                 :            :    *
      91                 :            :    * \returns Reference to this RelativePosition.
      92                 :            :    */
      93                 :            :   RelativePosition &operator=(RelativePosition &&other) = default;
      94                 :            : 
      95                 :            :   /**
      96                 :            :    * \brief standard comparison operator
      97                 :            :    *
      98                 :            :    * \param[in] other Other RelativePosition
      99                 :            :    *
     100                 :            :    * \returns \c true if both RelativePosition are equal
     101                 :            :    */
     102                 :         30 :   bool operator==(const RelativePosition &other) const
     103                 :            :   {
     104                 :         30 :     return (longitudinal_position == other.longitudinal_position)
     105   [ +  +  +  + ]:         26 :       && (longitudinal_distance == other.longitudinal_distance) && (lateral_position == other.lateral_position)
     106   [ +  +  +  + ]:         56 :       && (lateral_distance == other.lateral_distance);
     107                 :            :   }
     108                 :            : 
     109                 :            :   /**
     110                 :            :    * \brief standard comparison operator
     111                 :            :    *
     112                 :            :    * \param[in] other Other RelativePosition.
     113                 :            :    *
     114                 :            :    * \returns \c true if both RelativePosition are different
     115                 :            :    */
     116                 :          5 :   bool operator!=(const RelativePosition &other) const
     117                 :            :   {
     118                 :          5 :     return !operator==(other);
     119                 :            :   }
     120                 :            : 
     121                 :            :   /*!
     122                 :            :    * The longitudinal relative position between to objects within their constellation specific lane coordinate system.
     123                 :            :    */
     124                 :            :   ::ad::rss::core::LongitudinalRelativePosition longitudinal_position{
     125                 :            :     ::ad::rss::core::LongitudinalRelativePosition::Overlap};
     126                 :            : 
     127                 :            :   /*!
     128                 :            :    * The longitudinal distance between the two objects within their constellation specific lane coordinate system.
     129                 :            :    */
     130                 :            :   ::ad::physics::Distance longitudinal_distance{0.0};
     131                 :            : 
     132                 :            :   /*!
     133                 :            :    * The lateral relative position between to objects within their constellation specific lane coordinate system.
     134                 :            :    */
     135                 :            :   ::ad::rss::core::LateralRelativePosition lateral_position{::ad::rss::core::LateralRelativePosition::Overlap};
     136                 :            : 
     137                 :            :   /*!
     138                 :            :    * The lateral distance between the two objects within their constellation specific lane coordinate system.
     139                 :            :    */
     140                 :            :   ::ad::physics::Distance lateral_distance{0.0};
     141                 :            : };
     142                 :            : 
     143                 :            : } // namespace core
     144                 :            : } // namespace rss
     145                 :            : } // namespace ad
     146                 :            : 
     147                 :            : /*!
     148                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     149                 :            :  */
     150                 :            : #ifndef GEN_GUARD_AD_RSS_CORE_RELATIVEPOSITION
     151                 :            : #define GEN_GUARD_AD_RSS_CORE_RELATIVEPOSITION
     152                 :            : /*!
     153                 :            :  * @brief namespace ad
     154                 :            :  */
     155                 :            : namespace ad {
     156                 :            : /*!
     157                 :            :  * @brief namespace rss
     158                 :            :  */
     159                 :            : namespace rss {
     160                 :            : /*!
     161                 :            :  * @brief namespace core
     162                 :            :  */
     163                 :            : namespace core {
     164                 :            : 
     165                 :            : /**
     166                 :            :  * \brief standard ostream operator
     167                 :            :  *
     168                 :            :  * \param[in] os The output stream to write to
     169                 :            :  * \param[in] _value RelativePosition value
     170                 :            :  *
     171                 :            :  * \returns The stream object.
     172                 :            :  *
     173                 :            :  */
     174                 :          6 : inline std::ostream &operator<<(std::ostream &os, RelativePosition const &_value)
     175                 :            : {
     176                 :          6 :   os << "RelativePosition(";
     177                 :          6 :   os << "longitudinal_position:";
     178                 :          6 :   os << _value.longitudinal_position;
     179                 :          6 :   os << ",";
     180                 :          6 :   os << "longitudinal_distance:";
     181                 :          6 :   os << _value.longitudinal_distance;
     182                 :          6 :   os << ",";
     183                 :          6 :   os << "lateral_position:";
     184                 :          6 :   os << _value.lateral_position;
     185                 :          6 :   os << ",";
     186                 :          6 :   os << "lateral_distance:";
     187                 :          6 :   os << _value.lateral_distance;
     188                 :          6 :   os << ")";
     189                 :          6 :   return os;
     190                 :            : }
     191                 :            : 
     192                 :            : } // namespace core
     193                 :            : } // namespace rss
     194                 :            : } // namespace ad
     195                 :            : 
     196                 :            : namespace std {
     197                 :            : /*!
     198                 :            :  * \brief overload of the std::to_string for RelativePosition
     199                 :            :  */
     200                 :          1 : inline std::string to_string(::ad::rss::core::RelativePosition const &value)
     201                 :            : {
     202         [ +  - ]:          1 :   stringstream sstream;
     203         [ +  - ]:          1 :   sstream << value;
     204         [ +  - ]:          2 :   return sstream.str();
     205                 :          1 : }
     206                 :            : } // namespace std
     207                 :            : 
     208                 :            : /*!
     209                 :            :  * \brief overload of fmt::formatter calling std::to_string
     210                 :            :  */
     211                 :            : template <> struct fmt::formatter<::ad::rss::core::RelativePosition> : formatter<string_view>
     212                 :            : {
     213                 :          0 :   template <typename FormatContext> auto format(::ad::rss::core::RelativePosition const &value, FormatContext &ctx)
     214                 :            :   {
     215                 :          0 :     return formatter<string_view>::format(std::to_string(value), ctx);
     216                 :            :   }
     217                 :            : };
     218                 :            : 
     219                 :            : #endif // GEN_GUARD_AD_RSS_CORE_RELATIVEPOSITION

Generated by: LCOV version 1.14