ad_physics
Dimension3D.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>
24 #include "ad/physics/Distance.hpp"
28 namespace ad {
32 namespace physics {
33 
38 {
42  typedef std::shared_ptr<Dimension3D> Ptr;
43 
47  typedef std::shared_ptr<Dimension3D const> ConstPtr;
48 
52  Dimension3D() = default;
53 
57  ~Dimension3D() = default;
58 
62  Dimension3D(const Dimension3D &other) = default;
63 
67  Dimension3D(Dimension3D &&other) = default;
68 
76  Dimension3D &operator=(const Dimension3D &other) = default;
77 
85  Dimension3D &operator=(Dimension3D &&other) = default;
86 
94  bool operator==(const Dimension3D &other) const
95  {
96  return (length == other.length) && (width == other.width) && (height == other.height);
97  }
98 
106  bool operator!=(const Dimension3D &other) const
107  {
108  return !operator==(other);
109  }
110 
115 
120 
125 };
126 
127 } // namespace physics
128 } // namespace ad
129 
133 #ifndef GEN_GUARD_AD_PHYSICS_DIMENSION3D
134 #define GEN_GUARD_AD_PHYSICS_DIMENSION3D
135 
138 namespace ad {
142 namespace physics {
143 
153 inline std::ostream &operator<<(std::ostream &os, Dimension3D const &_value)
154 {
155  os << "Dimension3D(";
156  os << "length:";
157  os << _value.length;
158  os << ",";
159  os << "width:";
160  os << _value.width;
161  os << ",";
162  os << "height:";
163  os << _value.height;
164  os << ")";
165  return os;
166 }
167 
168 } // namespace physics
169 } // namespace ad
170 
171 namespace std {
175 inline std::string to_string(::ad::physics::Dimension3D const &value)
176 {
177  stringstream sstream;
178  sstream << value;
179  return sstream.str();
180 }
181 } // namespace std
182 #endif // GEN_GUARD_AD_PHYSICS_DIMENSION3D
ad
namespace ad
Definition: Acceleration.hpp:30
ad::physics::Distance
DataType Distance.
Definition: Distance.hpp:67
ad::physics::Dimension3D::Ptr
std::shared_ptr< Dimension3D > Ptr
Smart pointer on Dimension3D.
Definition: Dimension3D.hpp:42
ad::physics::Dimension3D::width
::ad::physics::Distance width
Definition: Dimension3D.hpp:119
ad::physics::Dimension3D::~Dimension3D
~Dimension3D()=default
standard destructor
ad::physics::Dimension3D::operator=
Dimension3D & operator=(const Dimension3D &other)=default
standard assignment operator
ad::physics::Dimension3D::height
::ad::physics::Distance height
Definition: Dimension3D.hpp:124
ad::physics::Dimension3D
DataType Dimension3D.
Definition: Dimension3D.hpp:37
Distance.hpp
ad::physics::Dimension3D::operator==
bool operator==(const Dimension3D &other) const
standard comparison operator
Definition: Dimension3D.hpp:94
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::Dimension3D::ConstPtr
std::shared_ptr< Dimension3D const > ConstPtr
Smart pointer on constant Dimension3D.
Definition: Dimension3D.hpp:47
ad::physics::Dimension3D::operator!=
bool operator!=(const Dimension3D &other) const
standard comparison operator
Definition: Dimension3D.hpp:106
ad::physics::Dimension3D::length
::ad::physics::Distance length
Definition: Dimension3D.hpp:114
ad::physics::Dimension3D::Dimension3D
Dimension3D()=default
standard constructor
ad::physics::operator<<
std::ostream & operator<<(std::ostream &os, Acceleration const &_value)
standard ostream operator
Definition: Acceleration.hpp:547