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