LCOV - code coverage report
Current view: top level - generated/include/ad/rss/situation - RelativePosition.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 25 25 100.0 %
Date: 2024-04-23 14:35:54 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: LGPL-2.1-only
       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/physics/Distance.hpp"
      25                 :            : #include "ad/rss/situation/LateralRelativePosition.hpp"
      26                 :            : #include "ad/rss/situation/LongitudinalRelativePosition.hpp"
      27                 :            : /*!
      28                 :            :  * @brief namespace ad
      29                 :            :  */
      30                 :            : namespace ad {
      31                 :            : /*!
      32                 :            :  * @brief namespace rss
      33                 :            :  */
      34                 :            : namespace rss {
      35                 :            : /*!
      36                 :            :  * @brief namespace situation
      37                 :            :  */
      38                 :            : namespace situation {
      39                 :            : 
      40                 :            : /*!
      41                 :            :  * \brief DataType RelativePosition
      42                 :            :  *
      43                 :            :  * Describes the relative position between two objects within their situation 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                 :       5307 :   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                 :         28 :   bool operator==(const RelativePosition &other) const
     103                 :            :   {
     104         [ +  + ]:         24 :     return (longitudinalPosition == other.longitudinalPosition) && (longitudinalDistance == other.longitudinalDistance)
     105   [ +  +  +  +  :         52 :       && (lateralPosition == other.lateralPosition) && (lateralDistance == other.lateralDistance);
                   +  + ]
     106                 :            :   }
     107                 :            : 
     108                 :            :   /**
     109                 :            :    * \brief standard comparison operator
     110                 :            :    *
     111                 :            :    * \param[in] other Other RelativePosition.
     112                 :            :    *
     113                 :            :    * \returns \c true if both RelativePosition are different
     114                 :            :    */
     115                 :          5 :   bool operator!=(const RelativePosition &other) const
     116                 :            :   {
     117                 :          5 :     return !operator==(other);
     118                 :            :   }
     119                 :            : 
     120                 :            :   /*!
     121                 :            :    * The longitudinal relative position between to objects within their situation coordinate system.
     122                 :            :    */
     123                 :            :   ::ad::rss::situation::LongitudinalRelativePosition longitudinalPosition{
     124                 :            :     ::ad::rss::situation::LongitudinalRelativePosition::Overlap};
     125                 :            : 
     126                 :            :   /*!
     127                 :            :    * The longitudinal distance between the two objects within their situation coordinate system.
     128                 :            :    */
     129                 :            :   ::ad::physics::Distance longitudinalDistance{0.0};
     130                 :            : 
     131                 :            :   /*!
     132                 :            :    * The lateral relative position between to objects within their situation coordinate system.
     133                 :            :    */
     134                 :            :   ::ad::rss::situation::LateralRelativePosition lateralPosition{::ad::rss::situation::LateralRelativePosition::Overlap};
     135                 :            : 
     136                 :            :   /*!
     137                 :            :    * The lateral distance between the two objects within their situation coordinate system.
     138                 :            :    */
     139                 :            :   ::ad::physics::Distance lateralDistance{0.0};
     140                 :            : };
     141                 :            : 
     142                 :            : } // namespace situation
     143                 :            : } // namespace rss
     144                 :            : } // namespace ad
     145                 :            : 
     146                 :            : /*!
     147                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     148                 :            :  */
     149                 :            : #ifndef GEN_GUARD_AD_RSS_SITUATION_RELATIVEPOSITION
     150                 :            : #define GEN_GUARD_AD_RSS_SITUATION_RELATIVEPOSITION
     151                 :            : /*!
     152                 :            :  * @brief namespace ad
     153                 :            :  */
     154                 :            : namespace ad {
     155                 :            : /*!
     156                 :            :  * @brief namespace rss
     157                 :            :  */
     158                 :            : namespace rss {
     159                 :            : /*!
     160                 :            :  * @brief namespace situation
     161                 :            :  */
     162                 :            : namespace situation {
     163                 :            : 
     164                 :            : /**
     165                 :            :  * \brief standard ostream operator
     166                 :            :  *
     167                 :            :  * \param[in] os The output stream to write to
     168                 :            :  * \param[in] _value RelativePosition value
     169                 :            :  *
     170                 :            :  * \returns The stream object.
     171                 :            :  *
     172                 :            :  */
     173                 :    1004090 : inline std::ostream &operator<<(std::ostream &os, RelativePosition const &_value)
     174                 :            : {
     175                 :    1004090 :   os << "RelativePosition(";
     176                 :    1004090 :   os << "longitudinalPosition:";
     177                 :    1004090 :   os << _value.longitudinalPosition;
     178                 :    1004090 :   os << ",";
     179                 :    1004090 :   os << "longitudinalDistance:";
     180                 :    1004090 :   os << _value.longitudinalDistance;
     181                 :    1004090 :   os << ",";
     182                 :    1004090 :   os << "lateralPosition:";
     183                 :    1004090 :   os << _value.lateralPosition;
     184                 :    1004090 :   os << ",";
     185                 :    1004090 :   os << "lateralDistance:";
     186                 :    1004090 :   os << _value.lateralDistance;
     187                 :    1004090 :   os << ")";
     188                 :    1004090 :   return os;
     189                 :            : }
     190                 :            : 
     191                 :            : } // namespace situation
     192                 :            : } // namespace rss
     193                 :            : } // namespace ad
     194                 :            : 
     195                 :            : namespace std {
     196                 :            : /*!
     197                 :            :  * \brief overload of the std::to_string for RelativePosition
     198                 :            :  */
     199                 :          1 : inline std::string to_string(::ad::rss::situation::RelativePosition const &value)
     200                 :            : {
     201         [ +  - ]:          2 :   stringstream sstream;
     202         [ +  - ]:          1 :   sstream << value;
     203         [ +  - ]:          2 :   return sstream.str();
     204                 :            : }
     205                 :            : } // namespace std
     206                 :            : #endif // GEN_GUARD_AD_RSS_SITUATION_RELATIVEPOSITION

Generated by: LCOV version 1.14