LCOV - code coverage report
Current view: top level - generated/include/ad/physics - Dimension2D.hpp (source / functions) Hit Total Coverage
Test: ad_physics Lines: 18 18 100.0 %
Date: 2022-10-04 09:47:07 Functions: 5 5 100.0 %
Branches: 7 10 70.0 %

           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/physics/Distance.hpp"
      25                 :            : /*!
      26                 :            :  * @brief namespace ad
      27                 :            :  */
      28                 :            : namespace ad {
      29                 :            : /*!
      30                 :            :  * @brief namespace physics
      31                 :            :  */
      32                 :            : namespace physics {
      33                 :            : 
      34                 :            : /*!
      35                 :            :  * \brief DataType Dimension2D
      36                 :            :  */
      37                 :            : struct Dimension2D
      38                 :            : {
      39                 :            :   /*!
      40                 :            :    * \brief Smart pointer on Dimension2D
      41                 :            :    */
      42                 :            :   typedef std::shared_ptr<Dimension2D> Ptr;
      43                 :            : 
      44                 :            :   /*!
      45                 :            :    * \brief Smart pointer on constant Dimension2D
      46                 :            :    */
      47                 :            :   typedef std::shared_ptr<Dimension2D const> ConstPtr;
      48                 :            : 
      49                 :            :   /*!
      50                 :            :    * \brief standard constructor
      51                 :            :    */
      52                 :         27 :   Dimension2D() = default;
      53                 :            : 
      54                 :            :   /*!
      55                 :            :    * \brief standard destructor
      56                 :            :    */
      57                 :            :   ~Dimension2D() = default;
      58                 :            : 
      59                 :            :   /*!
      60                 :            :    * \brief standard copy constructor
      61                 :            :    */
      62                 :            :   Dimension2D(const Dimension2D &other) = default;
      63                 :            : 
      64                 :            :   /*!
      65                 :            :    * \brief standard move constructor
      66                 :            :    */
      67                 :            :   Dimension2D(Dimension2D &&other) = default;
      68                 :            : 
      69                 :            :   /**
      70                 :            :    * \brief standard assignment operator
      71                 :            :    *
      72                 :            :    * \param[in] other Other Dimension2D
      73                 :            :    *
      74                 :            :    * \returns Reference to this Dimension2D.
      75                 :            :    */
      76                 :            :   Dimension2D &operator=(const Dimension2D &other) = default;
      77                 :            : 
      78                 :            :   /**
      79                 :            :    * \brief standard move operator
      80                 :            :    *
      81                 :            :    * \param[in] other Other Dimension2D
      82                 :            :    *
      83                 :            :    * \returns Reference to this Dimension2D.
      84                 :            :    */
      85                 :            :   Dimension2D &operator=(Dimension2D &&other) = default;
      86                 :            : 
      87                 :            :   /**
      88                 :            :    * \brief standard comparison operator
      89                 :            :    *
      90                 :            :    * \param[in] other Other Dimension2D
      91                 :            :    *
      92                 :            :    * \returns \c true if both Dimension2D are equal
      93                 :            :    */
      94                 :         10 :   bool operator==(const Dimension2D &other) const
      95                 :            :   {
      96   [ +  +  +  + ]:         10 :     return (length == other.length) && (width == other.width);
      97                 :            :   }
      98                 :            : 
      99                 :            :   /**
     100                 :            :    * \brief standard comparison operator
     101                 :            :    *
     102                 :            :    * \param[in] other Other Dimension2D.
     103                 :            :    *
     104                 :            :    * \returns \c true if both Dimension2D are different
     105                 :            :    */
     106                 :          3 :   bool operator!=(const Dimension2D &other) const
     107                 :            :   {
     108                 :          3 :     return !operator==(other);
     109                 :            :   }
     110                 :            : 
     111                 :            :   /*!
     112                 :            :    * The length is measured along the x-axis in meters
     113                 :            :    */
     114                 :            :   ::ad::physics::Distance length;
     115                 :            : 
     116                 :            :   /*!
     117                 :            :    * The width is measured along the y-axis  in meters
     118                 :            :    */
     119                 :            :   ::ad::physics::Distance width;
     120                 :            : };
     121                 :            : 
     122                 :            : } // namespace physics
     123                 :            : } // namespace ad
     124                 :            : 
     125                 :            : /*!
     126                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     127                 :            :  */
     128                 :            : #ifndef GEN_GUARD_AD_PHYSICS_DIMENSION2D
     129                 :            : #define GEN_GUARD_AD_PHYSICS_DIMENSION2D
     130                 :            : /*!
     131                 :            :  * @brief namespace ad
     132                 :            :  */
     133                 :            : namespace ad {
     134                 :            : /*!
     135                 :            :  * @brief namespace physics
     136                 :            :  */
     137                 :            : namespace physics {
     138                 :            : 
     139                 :            : /**
     140                 :            :  * \brief standard ostream operator
     141                 :            :  *
     142                 :            :  * \param[in] os The output stream to write to
     143                 :            :  * \param[in] _value Dimension2D value
     144                 :            :  *
     145                 :            :  * \returns The stream object.
     146                 :            :  *
     147                 :            :  */
     148                 :         11 : inline std::ostream &operator<<(std::ostream &os, Dimension2D const &_value)
     149                 :            : {
     150                 :         11 :   os << "Dimension2D(";
     151                 :         11 :   os << "length:";
     152                 :         11 :   os << _value.length;
     153                 :         11 :   os << ",";
     154                 :         11 :   os << "width:";
     155                 :         11 :   os << _value.width;
     156                 :         11 :   os << ")";
     157                 :         11 :   return os;
     158                 :            : }
     159                 :            : 
     160                 :            : } // namespace physics
     161                 :            : } // namespace ad
     162                 :            : 
     163                 :            : namespace std {
     164                 :            : /*!
     165                 :            :  * \brief overload of the std::to_string for Dimension2D
     166                 :            :  */
     167                 :          1 : inline std::string to_string(::ad::physics::Dimension2D const &value)
     168                 :            : {
     169         [ +  - ]:          2 :   stringstream sstream;
     170         [ +  - ]:          1 :   sstream << value;
     171         [ +  - ]:          2 :   return sstream.str();
     172                 :            : }
     173                 :            : } // namespace std
     174                 :            : #endif // GEN_GUARD_AD_PHYSICS_DIMENSION2D

Generated by: LCOV version 1.14