LCOV - code coverage report
Current view: top level - generated/include/ad/map/restriction - VehicleDescriptor.hpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 31 31 100.0 %
Date: 2022-10-04 09:48:07 Functions: 5 5 100.0 %
Branches: 15 18 83.3 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2020 Intel Corporation
       5                 :            :  *
       6                 :            :  * SPDX-License-Identifier: MIT
       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/map/restriction/PassengerCount.hpp"
      25                 :            : #include "ad/map/restriction/RoadUserType.hpp"
      26                 :            : #include "ad/physics/Distance.hpp"
      27                 :            : #include "ad/physics/Weight.hpp"
      28                 :            : /*!
      29                 :            :  * @brief namespace ad
      30                 :            :  */
      31                 :            : namespace ad {
      32                 :            : /*!
      33                 :            :  * @brief namespace map
      34                 :            :  */
      35                 :            : namespace map {
      36                 :            : /*!
      37                 :            :  * @brief namespace restriction
      38                 :            :  *
      39                 :            :  * Handling of traffic restrictions
      40                 :            :  */
      41                 :            : namespace restriction {
      42                 :            : 
      43                 :            : /*!
      44                 :            :  * \brief DataType VehicleDescriptor
      45                 :            :  */
      46                 :            : struct VehicleDescriptor
      47                 :            : {
      48                 :            :   /*!
      49                 :            :    * \brief Smart pointer on VehicleDescriptor
      50                 :            :    */
      51                 :            :   typedef std::shared_ptr<VehicleDescriptor> Ptr;
      52                 :            : 
      53                 :            :   /*!
      54                 :            :    * \brief Smart pointer on constant VehicleDescriptor
      55                 :            :    */
      56                 :            :   typedef std::shared_ptr<VehicleDescriptor const> ConstPtr;
      57                 :            : 
      58                 :            :   /*!
      59                 :            :    * \brief standard constructor
      60                 :            :    */
      61                 :         49 :   VehicleDescriptor() = default;
      62                 :            : 
      63                 :            :   /*!
      64                 :            :    * \brief standard destructor
      65                 :            :    */
      66                 :            :   ~VehicleDescriptor() = default;
      67                 :            : 
      68                 :            :   /*!
      69                 :            :    * \brief standard copy constructor
      70                 :            :    */
      71                 :            :   VehicleDescriptor(const VehicleDescriptor &other) = default;
      72                 :            : 
      73                 :            :   /*!
      74                 :            :    * \brief standard move constructor
      75                 :            :    */
      76                 :            :   VehicleDescriptor(VehicleDescriptor &&other) = default;
      77                 :            : 
      78                 :            :   /**
      79                 :            :    * \brief standard assignment operator
      80                 :            :    *
      81                 :            :    * \param[in] other Other VehicleDescriptor
      82                 :            :    *
      83                 :            :    * \returns Reference to this VehicleDescriptor.
      84                 :            :    */
      85                 :            :   VehicleDescriptor &operator=(const VehicleDescriptor &other) = default;
      86                 :            : 
      87                 :            :   /**
      88                 :            :    * \brief standard move operator
      89                 :            :    *
      90                 :            :    * \param[in] other Other VehicleDescriptor
      91                 :            :    *
      92                 :            :    * \returns Reference to this VehicleDescriptor.
      93                 :            :    */
      94                 :            :   VehicleDescriptor &operator=(VehicleDescriptor &&other) = default;
      95                 :            : 
      96                 :            :   /**
      97                 :            :    * \brief standard comparison operator
      98                 :            :    *
      99                 :            :    * \param[in] other Other VehicleDescriptor
     100                 :            :    *
     101                 :            :    * \returns \c true if both VehicleDescriptor are equal
     102                 :            :    */
     103                 :         18 :   bool operator==(const VehicleDescriptor &other) const
     104                 :            :   {
     105   [ +  +  +  + ]:         16 :     return (passengers == other.passengers) && (type == other.type) && (width == other.width)
     106   [ +  +  +  +  :         34 :       && (height == other.height) && (length == other.length) && (weight == other.weight);
             +  +  +  + ]
     107                 :            :   }
     108                 :            : 
     109                 :            :   /**
     110                 :            :    * \brief standard comparison operator
     111                 :            :    *
     112                 :            :    * \param[in] other Other VehicleDescriptor.
     113                 :            :    *
     114                 :            :    * \returns \c true if both VehicleDescriptor are different
     115                 :            :    */
     116                 :          7 :   bool operator!=(const VehicleDescriptor &other) const
     117                 :            :   {
     118                 :          7 :     return !operator==(other);
     119                 :            :   }
     120                 :            : 
     121                 :            :   ::ad::map::restriction::PassengerCount passengers{0};
     122                 :            :   ::ad::map::restriction::RoadUserType type{::ad::map::restriction::RoadUserType::INVALID};
     123                 :            :   ::ad::physics::Distance width;
     124                 :            :   ::ad::physics::Distance height;
     125                 :            :   ::ad::physics::Distance length;
     126                 :            :   ::ad::physics::Weight weight;
     127                 :            : };
     128                 :            : 
     129                 :            : } // namespace restriction
     130                 :            : } // namespace map
     131                 :            : } // namespace ad
     132                 :            : 
     133                 :            : /*!
     134                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     135                 :            :  */
     136                 :            : #ifndef GEN_GUARD_AD_MAP_RESTRICTION_VEHICLEDESCRIPTOR
     137                 :            : #define GEN_GUARD_AD_MAP_RESTRICTION_VEHICLEDESCRIPTOR
     138                 :            : /*!
     139                 :            :  * @brief namespace ad
     140                 :            :  */
     141                 :            : namespace ad {
     142                 :            : /*!
     143                 :            :  * @brief namespace map
     144                 :            :  */
     145                 :            : namespace map {
     146                 :            : /*!
     147                 :            :  * @brief namespace restriction
     148                 :            :  *
     149                 :            :  * Handling of traffic restrictions
     150                 :            :  */
     151                 :            : namespace restriction {
     152                 :            : 
     153                 :            : /**
     154                 :            :  * \brief standard ostream operator
     155                 :            :  *
     156                 :            :  * \param[in] os The output stream to write to
     157                 :            :  * \param[in] _value VehicleDescriptor value
     158                 :            :  *
     159                 :            :  * \returns The stream object.
     160                 :            :  *
     161                 :            :  */
     162                 :         16 : inline std::ostream &operator<<(std::ostream &os, VehicleDescriptor const &_value)
     163                 :            : {
     164                 :         16 :   os << "VehicleDescriptor(";
     165                 :         16 :   os << "passengers:";
     166                 :         16 :   os << _value.passengers;
     167                 :         16 :   os << ",";
     168                 :         16 :   os << "type:";
     169                 :         16 :   os << _value.type;
     170                 :         16 :   os << ",";
     171                 :         16 :   os << "width:";
     172                 :         16 :   os << _value.width;
     173                 :         16 :   os << ",";
     174                 :         16 :   os << "height:";
     175                 :         16 :   os << _value.height;
     176                 :         16 :   os << ",";
     177                 :         16 :   os << "length:";
     178                 :         16 :   os << _value.length;
     179                 :         16 :   os << ",";
     180                 :         16 :   os << "weight:";
     181                 :         16 :   os << _value.weight;
     182                 :         16 :   os << ")";
     183                 :         16 :   return os;
     184                 :            : }
     185                 :            : 
     186                 :            : } // namespace restriction
     187                 :            : } // namespace map
     188                 :            : } // namespace ad
     189                 :            : 
     190                 :            : namespace std {
     191                 :            : /*!
     192                 :            :  * \brief overload of the std::to_string for VehicleDescriptor
     193                 :            :  */
     194                 :          1 : inline std::string to_string(::ad::map::restriction::VehicleDescriptor const &value)
     195                 :            : {
     196         [ +  - ]:          2 :   stringstream sstream;
     197         [ +  - ]:          1 :   sstream << value;
     198         [ +  - ]:          2 :   return sstream.str();
     199                 :            : }
     200                 :            : } // namespace std
     201                 :            : #endif // GEN_GUARD_AD_MAP_RESTRICTION_VEHICLEDESCRIPTOR

Generated by: LCOV version 1.14