LCOV - code coverage report
Current view: top level - generated/include/ad/rss/world - Object.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 32 32 100.0 %
Date: 2024-05-02 09:41:50 Functions: 10 10 100.0 %
Branches: 13 16 81.2 %

           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/rss/world/ObjectId.hpp"
      25                 :            : #include "ad/rss/world/ObjectState.hpp"
      26                 :            : #include "ad/rss/world/ObjectType.hpp"
      27                 :            : #include "ad/rss/world/OccupiedRegionVector.hpp"
      28                 :            : #include "ad/rss/world/Velocity.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 Object
      44                 :            :  *
      45                 :            :  * An object is described by several aspects: the unique id of an object, the type of the object, the lane regions the
      46                 :            :  * object occupies, the objects velocity within its lane and its state.
      47                 :            :  */
      48                 :       7700 : struct Object
      49                 :            : {
      50                 :            :   /*!
      51                 :            :    * \brief Smart pointer on Object
      52                 :            :    */
      53                 :            :   typedef std::shared_ptr<Object> Ptr;
      54                 :            : 
      55                 :            :   /*!
      56                 :            :    * \brief Smart pointer on constant Object
      57                 :            :    */
      58                 :            :   typedef std::shared_ptr<Object const> ConstPtr;
      59                 :            : 
      60                 :            :   /*!
      61                 :            :    * \brief standard constructor
      62                 :            :    */
      63                 :      13665 :   Object() = default;
      64                 :            : 
      65                 :            :   /*!
      66                 :            :    * \brief standard destructor
      67                 :            :    */
      68                 :      36428 :   ~Object() = default;
      69                 :            : 
      70                 :            :   /*!
      71                 :            :    * \brief standard copy constructor
      72                 :            :    */
      73                 :      18644 :   Object(const Object &other) = default;
      74                 :            : 
      75                 :            :   /*!
      76                 :            :    * \brief standard move constructor
      77                 :            :    */
      78                 :       4147 :   Object(Object &&other) = default;
      79                 :            : 
      80                 :            :   /**
      81                 :            :    * \brief standard assignment operator
      82                 :            :    *
      83                 :            :    * \param[in] other Other Object
      84                 :            :    *
      85                 :            :    * \returns Reference to this Object.
      86                 :            :    */
      87                 :            :   Object &operator=(const Object &other) = default;
      88                 :            : 
      89                 :            :   /**
      90                 :            :    * \brief standard move operator
      91                 :            :    *
      92                 :            :    * \param[in] other Other Object
      93                 :            :    *
      94                 :            :    * \returns Reference to this Object.
      95                 :            :    */
      96                 :            :   Object &operator=(Object &&other) = default;
      97                 :            : 
      98                 :            :   /**
      99                 :            :    * \brief standard comparison operator
     100                 :            :    *
     101                 :            :    * \param[in] other Other Object
     102                 :            :    *
     103                 :            :    * \returns \c true if both Object are equal
     104                 :            :    */
     105                 :         60 :   bool operator==(const Object &other) const
     106                 :            :   {
     107         [ +  + ]:         54 :     return (objectId == other.objectId) && (objectType == other.objectType)
     108   [ +  +  +  +  :        114 :       && (occupiedRegions == other.occupiedRegions) && (velocity == other.velocity) && (state == other.state);
             +  +  +  + ]
     109                 :            :   }
     110                 :            : 
     111                 :            :   /**
     112                 :            :    * \brief standard comparison operator
     113                 :            :    *
     114                 :            :    * \param[in] other Other Object.
     115                 :            :    *
     116                 :            :    * \returns \c true if both Object are different
     117                 :            :    */
     118                 :          6 :   bool operator!=(const Object &other) const
     119                 :            :   {
     120                 :          6 :     return !operator==(other);
     121                 :            :   }
     122                 :            : 
     123                 :            :   /*!
     124                 :            :    * Defines the unique id of an object. This id has to be constant over time for the same object.
     125                 :            :    */
     126                 :            :   ::ad::rss::world::ObjectId objectId;
     127                 :            : 
     128                 :            :   /*!
     129                 :            :    * Defines the type of the object.
     130                 :            :    */
     131                 :            :   ::ad::rss::world::ObjectType objectType{::ad::rss::world::ObjectType::Invalid};
     132                 :            : 
     133                 :            :   /*!
     134                 :            :    * Defines the lane regions the object occupies.
     135                 :            :    */
     136                 :            :   ::ad::rss::world::OccupiedRegionVector occupiedRegions;
     137                 :            : 
     138                 :            :   /*!
     139                 :            :    * Defines the objects velocity in respect to its current major lane.
     140                 :            :    */
     141                 :            :   ::ad::rss::world::Velocity velocity;
     142                 :            : 
     143                 :            :   /*!
     144                 :            :    * Defines the state of the object in respect to a reference coordinate system (e.g. ENU)
     145                 :            :    */
     146                 :            :   ::ad::rss::world::ObjectState state;
     147                 :            : };
     148                 :            : 
     149                 :            : } // namespace world
     150                 :            : } // namespace rss
     151                 :            : } // namespace ad
     152                 :            : 
     153                 :            : /*!
     154                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     155                 :            :  */
     156                 :            : #ifndef GEN_GUARD_AD_RSS_WORLD_OBJECT
     157                 :            : #define GEN_GUARD_AD_RSS_WORLD_OBJECT
     158                 :            : /*!
     159                 :            :  * @brief namespace ad
     160                 :            :  */
     161                 :            : namespace ad {
     162                 :            : /*!
     163                 :            :  * @brief namespace rss
     164                 :            :  */
     165                 :            : namespace rss {
     166                 :            : /*!
     167                 :            :  * @brief namespace world
     168                 :            :  */
     169                 :            : namespace world {
     170                 :            : 
     171                 :            : /**
     172                 :            :  * \brief standard ostream operator
     173                 :            :  *
     174                 :            :  * \param[in] os The output stream to write to
     175                 :            :  * \param[in] _value Object value
     176                 :            :  *
     177                 :            :  * \returns The stream object.
     178                 :            :  *
     179                 :            :  */
     180                 :    2003230 : inline std::ostream &operator<<(std::ostream &os, Object const &_value)
     181                 :            : {
     182                 :    2003230 :   os << "Object(";
     183                 :    2003230 :   os << "objectId:";
     184                 :    2003230 :   os << _value.objectId;
     185                 :    2003230 :   os << ",";
     186                 :    2003230 :   os << "objectType:";
     187                 :    2003230 :   os << _value.objectType;
     188                 :    2003230 :   os << ",";
     189                 :    2003230 :   os << "occupiedRegions:";
     190                 :    2003230 :   os << _value.occupiedRegions;
     191                 :    2003230 :   os << ",";
     192                 :    2003230 :   os << "velocity:";
     193                 :    2003230 :   os << _value.velocity;
     194                 :    2003230 :   os << ",";
     195                 :    2003230 :   os << "state:";
     196                 :    2003230 :   os << _value.state;
     197                 :    2003230 :   os << ")";
     198                 :    2003230 :   return os;
     199                 :            : }
     200                 :            : 
     201                 :            : } // namespace world
     202                 :            : } // namespace rss
     203                 :            : } // namespace ad
     204                 :            : 
     205                 :            : namespace std {
     206                 :            : /*!
     207                 :            :  * \brief overload of the std::to_string for Object
     208                 :            :  */
     209                 :          1 : inline std::string to_string(::ad::rss::world::Object const &value)
     210                 :            : {
     211         [ +  - ]:          2 :   stringstream sstream;
     212         [ +  - ]:          1 :   sstream << value;
     213         [ +  - ]:          2 :   return sstream.str();
     214                 :            : }
     215                 :            : } // namespace std
     216                 :            : #endif // GEN_GUARD_AD_RSS_WORLD_OBJECT

Generated by: LCOV version 1.14