ad_rss
VelocityRange.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: LGPL-2.1-only
7  *
8  * ----------------- END LICENSE BLOCK -----------------------------------
9  */
10 
18 #pragma once
19 
20 #include <iostream>
21 #include <memory>
22 #include <sstream>
23 #include "ad/physics/SpeedRange.hpp"
27 namespace ad {
31 namespace rss {
35 namespace situation {
36 
44 {
48  typedef std::shared_ptr<VelocityRange> Ptr;
49 
53  typedef std::shared_ptr<VelocityRange const> ConstPtr;
54 
58  VelocityRange() = default;
59 
63  ~VelocityRange() = default;
64 
68  VelocityRange(const VelocityRange &other) = default;
69 
73  VelocityRange(VelocityRange &&other) = default;
74 
82  VelocityRange &operator=(const VelocityRange &other) = default;
83 
91  VelocityRange &operator=(VelocityRange &&other) = default;
92 
100  bool operator==(const VelocityRange &other) const
101  {
102  return (speedLon == other.speedLon) && (speedLat == other.speedLat);
103  }
104 
112  bool operator!=(const VelocityRange &other) const
113  {
114  return !operator==(other);
115  }
116 
122  ::ad::physics::SpeedRange speedLon;
123 
129  ::ad::physics::SpeedRange speedLat;
130 };
131 
132 } // namespace situation
133 } // namespace rss
134 } // namespace ad
135 
139 #ifndef GEN_GUARD_AD_RSS_SITUATION_VELOCITYRANGE
140 #define GEN_GUARD_AD_RSS_SITUATION_VELOCITYRANGE
141 
144 namespace ad {
148 namespace rss {
152 namespace situation {
153 
163 inline std::ostream &operator<<(std::ostream &os, VelocityRange const &_value)
164 {
165  os << "VelocityRange(";
166  os << "speedLon:";
167  os << _value.speedLon;
168  os << ",";
169  os << "speedLat:";
170  os << _value.speedLat;
171  os << ")";
172  return os;
173 }
174 
175 } // namespace situation
176 } // namespace rss
177 } // namespace ad
178 
179 namespace std {
183 inline std::string to_string(::ad::rss::situation::VelocityRange const &value)
184 {
185  stringstream sstream;
186  sstream << value;
187  return sstream.str();
188 }
189 } // namespace std
190 #endif // GEN_GUARD_AD_RSS_SITUATION_VELOCITYRANGE
ad::rss::situation::VelocityRange::operator==
bool operator==(const VelocityRange &other) const
standard comparison operator
Definition: VelocityRange.hpp:100
ad
namespace ad
Definition: LateralRelativePosition.hpp:26
ad::rss::situation::VelocityRange::VelocityRange
VelocityRange()=default
standard constructor
ad::rss::situation::VelocityRange::Ptr
std::shared_ptr< VelocityRange > Ptr
Smart pointer on VelocityRange.
Definition: VelocityRange.hpp:48
std::to_string
std::string to_string(::ad::rss::situation::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:160
ad::rss::situation::VelocityRange::ConstPtr
std::shared_ptr< VelocityRange const > ConstPtr
Smart pointer on constant VelocityRange.
Definition: VelocityRange.hpp:53
ad::rss::situation::operator<<
std::ostream & operator<<(std::ostream &os, LateralRelativePosition const &value)
standard ostream operator
Definition: LateralRelativePosition.hpp:147
ad::rss::situation::VelocityRange::operator=
VelocityRange & operator=(const VelocityRange &other)=default
standard assignment operator
ad::rss::situation::VelocityRange::operator!=
bool operator!=(const VelocityRange &other) const
standard comparison operator
Definition: VelocityRange.hpp:112
ad::rss::situation::VelocityRange::speedLat
::ad::physics::SpeedRange speedLat
Definition: VelocityRange.hpp:129
ad::rss::situation::VelocityRange::~VelocityRange
~VelocityRange()=default
standard destructor
ad::rss::situation::VelocityRange::speedLon
::ad::physics::SpeedRange speedLon
Definition: VelocityRange.hpp:122
ad::rss::situation::VelocityRange
DataType VelocityRange.
Definition: VelocityRange.hpp:43