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