ad_physics
Acceleration3D.hpp
Go to the documentation of this file.
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 
18 #pragma once
19 
20 #include <iostream>
21 #include <limits>
22 #include <memory>
23 #include <sstream>
28 namespace ad {
32 namespace physics {
33 
40 {
44  typedef std::shared_ptr<Acceleration3D> Ptr;
45 
49  typedef std::shared_ptr<Acceleration3D const> ConstPtr;
50 
54  Acceleration3D() = default;
55 
59  ~Acceleration3D() = default;
60 
64  Acceleration3D(const Acceleration3D &other) = default;
65 
69  Acceleration3D(Acceleration3D &&other) = default;
70 
78  Acceleration3D &operator=(const Acceleration3D &other) = default;
79 
87  Acceleration3D &operator=(Acceleration3D &&other) = default;
88 
96  bool operator==(const Acceleration3D &other) const
97  {
98  return (x == other.x) && (y == other.y) && (z == other.z);
99  }
100 
108  bool operator!=(const Acceleration3D &other) const
109  {
110  return !operator==(other);
111  }
112 
117 
122 
127 };
128 
129 } // namespace physics
130 } // namespace ad
131 
135 #ifndef GEN_GUARD_AD_PHYSICS_ACCELERATION3D
136 #define GEN_GUARD_AD_PHYSICS_ACCELERATION3D
137 
140 namespace ad {
144 namespace physics {
145 
155 inline std::ostream &operator<<(std::ostream &os, Acceleration3D const &_value)
156 {
157  os << "Acceleration3D(";
158  os << "x:";
159  os << _value.x;
160  os << ",";
161  os << "y:";
162  os << _value.y;
163  os << ",";
164  os << "z:";
165  os << _value.z;
166  os << ")";
167  return os;
168 }
169 
170 } // namespace physics
171 } // namespace ad
172 
173 namespace std {
177 inline std::string to_string(::ad::physics::Acceleration3D const &value)
178 {
179  stringstream sstream;
180  sstream << value;
181  return sstream.str();
182 }
183 } // namespace std
184 #endif // GEN_GUARD_AD_PHYSICS_ACCELERATION3D
ad
namespace ad
Definition: Acceleration.hpp:30
ad::physics::Acceleration3D::operator==
bool operator==(const Acceleration3D &other) const
standard comparison operator
Definition: Acceleration3D.hpp:96
ad::physics::Acceleration3D::x
::ad::physics::Acceleration x
Definition: Acceleration3D.hpp:116
ad::physics::Acceleration3D::y
::ad::physics::Acceleration y
Definition: Acceleration3D.hpp:121
ad::physics::Acceleration3D::z
::ad::physics::Acceleration z
Definition: Acceleration3D.hpp:126
ad::physics::Acceleration3D::operator!=
bool operator!=(const Acceleration3D &other) const
standard comparison operator
Definition: Acceleration3D.hpp:108
ad::physics::Acceleration3D::Ptr
std::shared_ptr< Acceleration3D > Ptr
Smart pointer on Acceleration3D.
Definition: Acceleration3D.hpp:44
Acceleration.hpp
ad::physics::Acceleration
DataType Acceleration.
Definition: Acceleration.hpp:59
ad::physics::Acceleration3D::~Acceleration3D
~Acceleration3D()=default
standard destructor
std::to_string
std::string to_string(::ad::physics::Acceleration const &value)
overload of the std::to_string for Acceleration
Definition: Acceleration.hpp:559
ad::physics::Acceleration3D
DataType Acceleration3D.
Definition: Acceleration3D.hpp:39
ad::physics::Acceleration3D::ConstPtr
std::shared_ptr< Acceleration3D const > ConstPtr
Smart pointer on constant Acceleration3D.
Definition: Acceleration3D.hpp:49
ad::physics::Acceleration3D::operator=
Acceleration3D & operator=(const Acceleration3D &other)=default
standard assignment operator
ad::physics::operator<<
std::ostream & operator<<(std::ostream &os, Acceleration const &_value)
standard ostream operator
Definition: Acceleration.hpp:547
ad::physics::Acceleration3D::Acceleration3D
Acceleration3D()=default
standard constructor