ad_rss
RelativePosition.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 <limits>
22 #include <memory>
23 #include <sstream>
24 #include "ad/physics/Distance.hpp"
30 namespace ad {
34 namespace rss {
38 namespace situation {
39 
46 {
50  typedef std::shared_ptr<RelativePosition> Ptr;
51 
55  typedef std::shared_ptr<RelativePosition const> ConstPtr;
56 
60  RelativePosition() = default;
61 
65  ~RelativePosition() = default;
66 
70  RelativePosition(const RelativePosition &other) = default;
71 
75  RelativePosition(RelativePosition &&other) = default;
76 
84  RelativePosition &operator=(const RelativePosition &other) = default;
85 
93  RelativePosition &operator=(RelativePosition &&other) = default;
94 
102  bool operator==(const RelativePosition &other) const
103  {
106  }
107 
115  bool operator!=(const RelativePosition &other) const
116  {
117  return !operator==(other);
118  }
119 
124  ::ad::rss::situation::LongitudinalRelativePosition::Overlap};
125 
129  ::ad::physics::Distance longitudinalDistance{0.0};
130 
134  ::ad::rss::situation::LateralRelativePosition lateralPosition{::ad::rss::situation::LateralRelativePosition::Overlap};
135 
139  ::ad::physics::Distance lateralDistance{0.0};
140 };
141 
142 } // namespace situation
143 } // namespace rss
144 } // namespace ad
145 
149 #ifndef GEN_GUARD_AD_RSS_SITUATION_RELATIVEPOSITION
150 #define GEN_GUARD_AD_RSS_SITUATION_RELATIVEPOSITION
151 
154 namespace ad {
158 namespace rss {
162 namespace situation {
163 
173 inline std::ostream &operator<<(std::ostream &os, RelativePosition const &_value)
174 {
175  os << "RelativePosition(";
176  os << "longitudinalPosition:";
177  os << _value.longitudinalPosition;
178  os << ",";
179  os << "longitudinalDistance:";
180  os << _value.longitudinalDistance;
181  os << ",";
182  os << "lateralPosition:";
183  os << _value.lateralPosition;
184  os << ",";
185  os << "lateralDistance:";
186  os << _value.lateralDistance;
187  os << ")";
188  return os;
189 }
190 
191 } // namespace situation
192 } // namespace rss
193 } // namespace ad
194 
195 namespace std {
199 inline std::string to_string(::ad::rss::situation::RelativePosition const &value)
200 {
201  stringstream sstream;
202  sstream << value;
203  return sstream.str();
204 }
205 } // namespace std
206 #endif // GEN_GUARD_AD_RSS_SITUATION_RELATIVEPOSITION
ad
namespace ad
Definition: LateralRelativePosition.hpp:26
ad::rss::situation::RelativePosition::ConstPtr
std::shared_ptr< RelativePosition const > ConstPtr
Smart pointer on constant RelativePosition.
Definition: RelativePosition.hpp:55
ad::rss::situation::RelativePosition::operator==
bool operator==(const RelativePosition &other) const
standard comparison operator
Definition: RelativePosition.hpp:102
ad::rss::situation::RelativePosition::~RelativePosition
~RelativePosition()=default
standard destructor
ad::rss::situation::RelativePosition::longitudinalPosition
::ad::rss::situation::LongitudinalRelativePosition longitudinalPosition
Definition: RelativePosition.hpp:123
ad::rss::situation::LongitudinalRelativePosition
LongitudinalRelativePosition
DataType LongitudinalRelativePosition.
Definition: LongitudinalRelativePosition.hpp:42
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
LongitudinalRelativePosition.hpp
ad::rss::situation::RelativePosition::RelativePosition
RelativePosition()=default
standard constructor
ad::rss::situation::operator<<
std::ostream & operator<<(std::ostream &os, LateralRelativePosition const &value)
standard ostream operator
Definition: LateralRelativePosition.hpp:147
ad::rss::situation::RelativePosition::lateralPosition
::ad::rss::situation::LateralRelativePosition lateralPosition
Definition: RelativePosition.hpp:134
ad::rss::situation::RelativePosition::lateralDistance
::ad::physics::Distance lateralDistance
Definition: RelativePosition.hpp:139
ad::rss::situation::RelativePosition::longitudinalDistance
::ad::physics::Distance longitudinalDistance
Definition: RelativePosition.hpp:129
ad::rss::situation::LateralRelativePosition
LateralRelativePosition
DataType LateralRelativePosition.
Definition: LateralRelativePosition.hpp:42
ad::rss::situation::RelativePosition::operator=
RelativePosition & operator=(const RelativePosition &other)=default
standard assignment operator
ad::rss::situation::RelativePosition::Ptr
std::shared_ptr< RelativePosition > Ptr
Smart pointer on RelativePosition.
Definition: RelativePosition.hpp:50
ad::rss::situation::RelativePosition::operator!=
bool operator!=(const RelativePosition &other) const
standard comparison operator
Definition: RelativePosition.hpp:115
ad::rss::situation::RelativePosition
DataType RelativePosition.
Definition: RelativePosition.hpp:45
LateralRelativePosition.hpp