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