LCOV - code coverage report
Current view: top level - generated/include/ad/rss/world - ObjectState.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 33 35 94.3 %
Date: 2025-07-22 06:53:46 Functions: 5 6 83.3 %
Branches: 15 18 83.3 %

           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/Angle.hpp"
      25                 :            : #include "ad/physics/AngularVelocity.hpp"
      26                 :            : #include "ad/physics/Dimension2D.hpp"
      27                 :            : #include "ad/physics/Distance2D.hpp"
      28                 :            : #include "ad/physics/SpeedRange.hpp"
      29                 :            : /*!
      30                 :            :  * @brief namespace ad
      31                 :            :  */
      32                 :            : namespace ad {
      33                 :            : /*!
      34                 :            :  * @brief namespace rss
      35                 :            :  */
      36                 :            : namespace rss {
      37                 :            : /*!
      38                 :            :  * @brief namespace world
      39                 :            :  */
      40                 :            : namespace world {
      41                 :            : 
      42                 :            : /*!
      43                 :            :  * \brief DataType ObjectState
      44                 :            :  *
      45                 :            :  * State of an object in the reference coordinate system (e.g. ENU).
      46                 :            :  * As the evaluation results of multiple constellation have to be merged, this reference
      47                 :            :  * system has to be the same for all entries at a specific time.
      48                 :            :  * The proper response, i.e. the heading_ranges of the unstructured constellation response,
      49                 :            :  * refers to this reference coodinate system.
      50                 :            :  */
      51                 :            : struct ObjectState
      52                 :            : {
      53                 :            :   /*!
      54                 :            :    * \brief Smart pointer on ObjectState
      55                 :            :    */
      56                 :            :   typedef std::shared_ptr<ObjectState> Ptr;
      57                 :            : 
      58                 :            :   /*!
      59                 :            :    * \brief Smart pointer on constant ObjectState
      60                 :            :    */
      61                 :            :   typedef std::shared_ptr<ObjectState const> ConstPtr;
      62                 :            : 
      63                 :            :   /*!
      64                 :            :    * \brief standard constructor
      65                 :            :    */
      66                 :      30643 :   ObjectState() = default;
      67                 :            : 
      68                 :            :   /*!
      69                 :            :    * \brief standard destructor
      70                 :            :    */
      71                 :            :   ~ObjectState() = default;
      72                 :            : 
      73                 :            :   /*!
      74                 :            :    * \brief standard copy constructor
      75                 :            :    */
      76                 :            :   ObjectState(const ObjectState &other) = default;
      77                 :            : 
      78                 :            :   /*!
      79                 :            :    * \brief standard move constructor
      80                 :            :    */
      81                 :            :   ObjectState(ObjectState &&other) = default;
      82                 :            : 
      83                 :            :   /**
      84                 :            :    * \brief standard assignment operator
      85                 :            :    *
      86                 :            :    * \param[in] other Other ObjectState
      87                 :            :    *
      88                 :            :    * \returns Reference to this ObjectState.
      89                 :            :    */
      90                 :            :   ObjectState &operator=(const ObjectState &other) = default;
      91                 :            : 
      92                 :            :   /**
      93                 :            :    * \brief standard move operator
      94                 :            :    *
      95                 :            :    * \param[in] other Other ObjectState
      96                 :            :    *
      97                 :            :    * \returns Reference to this ObjectState.
      98                 :            :    */
      99                 :            :   ObjectState &operator=(ObjectState &&other) = default;
     100                 :            : 
     101                 :            :   /**
     102                 :            :    * \brief standard comparison operator
     103                 :            :    *
     104                 :            :    * \param[in] other Other ObjectState
     105                 :            :    *
     106                 :            :    * \returns \c true if both ObjectState are equal
     107                 :            :    */
     108                 :        110 :   bool operator==(const ObjectState &other) const
     109                 :            :   {
     110   [ +  +  +  + ]:        214 :     return (yaw == other.yaw) && (dimension == other.dimension) && (yaw_rate == other.yaw_rate)
     111   [ +  +  +  + ]:        100 :       && (center_point == other.center_point) && (speed_range == other.speed_range)
     112   [ +  +  +  + ]:        214 :       && (steering_angle == other.steering_angle);
     113                 :            :   }
     114                 :            : 
     115                 :            :   /**
     116                 :            :    * \brief standard comparison operator
     117                 :            :    *
     118                 :            :    * \param[in] other Other ObjectState.
     119                 :            :    *
     120                 :            :    * \returns \c true if both ObjectState are different
     121                 :            :    */
     122                 :          7 :   bool operator!=(const ObjectState &other) const
     123                 :            :   {
     124                 :          7 :     return !operator==(other);
     125                 :            :   }
     126                 :            : 
     127                 :            :   /*!
     128                 :            :    * The heading angle of the object in the reference coordinate system (e.g. ENU).
     129                 :            :    */
     130                 :            :   ::ad::physics::Angle yaw;
     131                 :            : 
     132                 :            :   /*!
     133                 :            :    * The dimension of the object in the reference coordinate system (e.g. ENU).
     134                 :            :    */
     135                 :            :   ::ad::physics::Dimension2D dimension;
     136                 :            : 
     137                 :            :   /*!
     138                 :            :    * The angular velocity of the object in the reference coordinate system (e.g. ENU).
     139                 :            :    */
     140                 :            :   ::ad::physics::AngularVelocity yaw_rate;
     141                 :            : 
     142                 :            :   /*!
     143                 :            :    * The center point of the object in the reference coordinate system (e.g. ENU).
     144                 :            :    */
     145                 :            :   ::ad::physics::Distance2D center_point;
     146                 :            : 
     147                 :            :   /*!
     148                 :            :    * The speed of the object in the reference coordinate system (e.g. ENU) with its range.
     149                 :            :    */
     150                 :            :   ::ad::physics::SpeedRange speed_range;
     151                 :            : 
     152                 :            :   /*!
     153                 :            :    * The steering angle of the object in the object frame.
     154                 :            :    */
     155                 :            :   ::ad::physics::Angle steering_angle;
     156                 :            : };
     157                 :            : 
     158                 :            : } // namespace world
     159                 :            : } // namespace rss
     160                 :            : } // namespace ad
     161                 :            : 
     162                 :            : /*!
     163                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     164                 :            :  */
     165                 :            : #ifndef GEN_GUARD_AD_RSS_WORLD_OBJECTSTATE
     166                 :            : #define GEN_GUARD_AD_RSS_WORLD_OBJECTSTATE
     167                 :            : /*!
     168                 :            :  * @brief namespace ad
     169                 :            :  */
     170                 :            : namespace ad {
     171                 :            : /*!
     172                 :            :  * @brief namespace rss
     173                 :            :  */
     174                 :            : namespace rss {
     175                 :            : /*!
     176                 :            :  * @brief namespace world
     177                 :            :  */
     178                 :            : namespace world {
     179                 :            : 
     180                 :            : /**
     181                 :            :  * \brief standard ostream operator
     182                 :            :  *
     183                 :            :  * \param[in] os The output stream to write to
     184                 :            :  * \param[in] _value ObjectState value
     185                 :            :  *
     186                 :            :  * \returns The stream object.
     187                 :            :  *
     188                 :            :  */
     189                 :         22 : inline std::ostream &operator<<(std::ostream &os, ObjectState const &_value)
     190                 :            : {
     191                 :         22 :   os << "ObjectState(";
     192                 :         22 :   os << "yaw:";
     193                 :         22 :   os << _value.yaw;
     194                 :         22 :   os << ",";
     195                 :         22 :   os << "dimension:";
     196                 :         22 :   os << _value.dimension;
     197                 :         22 :   os << ",";
     198                 :         22 :   os << "yaw_rate:";
     199                 :         22 :   os << _value.yaw_rate;
     200                 :         22 :   os << ",";
     201                 :         22 :   os << "center_point:";
     202                 :         22 :   os << _value.center_point;
     203                 :         22 :   os << ",";
     204                 :         22 :   os << "speed_range:";
     205                 :         22 :   os << _value.speed_range;
     206                 :         22 :   os << ",";
     207                 :         22 :   os << "steering_angle:";
     208                 :         22 :   os << _value.steering_angle;
     209                 :         22 :   os << ")";
     210                 :         22 :   return os;
     211                 :            : }
     212                 :            : 
     213                 :            : } // namespace world
     214                 :            : } // namespace rss
     215                 :            : } // namespace ad
     216                 :            : 
     217                 :            : namespace std {
     218                 :            : /*!
     219                 :            :  * \brief overload of the std::to_string for ObjectState
     220                 :            :  */
     221                 :          1 : inline std::string to_string(::ad::rss::world::ObjectState const &value)
     222                 :            : {
     223         [ +  - ]:          1 :   stringstream sstream;
     224         [ +  - ]:          1 :   sstream << value;
     225         [ +  - ]:          2 :   return sstream.str();
     226                 :          1 : }
     227                 :            : } // namespace std
     228                 :            : 
     229                 :            : /*!
     230                 :            :  * \brief overload of fmt::formatter calling std::to_string
     231                 :            :  */
     232                 :            : template <> struct fmt::formatter<::ad::rss::world::ObjectState> : formatter<string_view>
     233                 :            : {
     234                 :          0 :   template <typename FormatContext> auto format(::ad::rss::world::ObjectState const &value, FormatContext &ctx)
     235                 :            :   {
     236                 :          0 :     return formatter<string_view>::format(std::to_string(value), ctx);
     237                 :            :   }
     238                 :            : };
     239                 :            : 
     240                 :            : #endif // GEN_GUARD_AD_RSS_WORLD_OBJECTSTATE

Generated by: LCOV version 1.14