ad_physics
AccelerationRange.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<AccelerationRange> Ptr;
45 
49  typedef std::shared_ptr<AccelerationRange const> ConstPtr;
50 
54  AccelerationRange() = default;
55 
59  ~AccelerationRange() = default;
60 
64  AccelerationRange(const AccelerationRange &other) = default;
65 
69  AccelerationRange(AccelerationRange &&other) = default;
70 
78  AccelerationRange &operator=(const AccelerationRange &other) = default;
79 
87  AccelerationRange &operator=(AccelerationRange &&other) = default;
88 
96  bool operator==(const AccelerationRange &other) const
97  {
98  return (minimum == other.minimum) && (maximum == other.maximum);
99  }
100 
108  bool operator!=(const AccelerationRange &other) const
109  {
110  return !operator==(other);
111  }
112 
116  ::ad::physics::Acceleration minimum{std::numeric_limits<Acceleration>::lowest()};
117 
121  ::ad::physics::Acceleration maximum{std::numeric_limits<Acceleration>::max()};
122 };
123 
124 } // namespace physics
125 } // namespace ad
126 
130 #ifndef GEN_GUARD_AD_PHYSICS_ACCELERATIONRANGE
131 #define GEN_GUARD_AD_PHYSICS_ACCELERATIONRANGE
132 
135 namespace ad {
139 namespace physics {
140 
150 inline std::ostream &operator<<(std::ostream &os, AccelerationRange const &_value)
151 {
152  os << "AccelerationRange(";
153  os << "minimum:";
154  os << _value.minimum;
155  os << ",";
156  os << "maximum:";
157  os << _value.maximum;
158  os << ")";
159  return os;
160 }
161 
162 } // namespace physics
163 } // namespace ad
164 
165 namespace std {
169 inline std::string to_string(::ad::physics::AccelerationRange const &value)
170 {
171  stringstream sstream;
172  sstream << value;
173  return sstream.str();
174 }
175 } // namespace std
176 #endif // GEN_GUARD_AD_PHYSICS_ACCELERATIONRANGE
ad
namespace ad
Definition: Acceleration.hpp:30
ad::physics::AccelerationRange::AccelerationRange
AccelerationRange()=default
standard constructor
ad::physics::AccelerationRange::operator!=
bool operator!=(const AccelerationRange &other) const
standard comparison operator
Definition: AccelerationRange.hpp:108
ad::physics::AccelerationRange::operator=
AccelerationRange & operator=(const AccelerationRange &other)=default
standard assignment operator
ad::physics::AccelerationRange::~AccelerationRange
~AccelerationRange()=default
standard destructor
Acceleration.hpp
ad::physics::Acceleration
DataType Acceleration.
Definition: Acceleration.hpp:59
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::AccelerationRange::ConstPtr
std::shared_ptr< AccelerationRange const > ConstPtr
Smart pointer on constant AccelerationRange.
Definition: AccelerationRange.hpp:49
ad::physics::AccelerationRange::operator==
bool operator==(const AccelerationRange &other) const
standard comparison operator
Definition: AccelerationRange.hpp:96
ad::physics::operator<<
std::ostream & operator<<(std::ostream &os, Acceleration const &_value)
standard ostream operator
Definition: Acceleration.hpp:547
ad::physics::AccelerationRange::minimum
::ad::physics::Acceleration minimum
Definition: AccelerationRange.hpp:116
ad::physics::AccelerationRange
DataType AccelerationRange.
Definition: AccelerationRange.hpp:39
ad::physics::AccelerationRange::Ptr
std::shared_ptr< AccelerationRange > Ptr
Smart pointer on AccelerationRange.
Definition: AccelerationRange.hpp:44
ad::physics::AccelerationRange::maximum
::ad::physics::Acceleration maximum
Definition: AccelerationRange.hpp:121