ad_rss
RssStateInformation.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"
29 namespace ad {
33 namespace rss {
37 namespace state {
38 
45 {
49  typedef std::shared_ptr<RssStateInformation> Ptr;
50 
54  typedef std::shared_ptr<RssStateInformation const> ConstPtr;
55 
59  RssStateInformation() = default;
60 
64  ~RssStateInformation() = default;
65 
69  RssStateInformation(const RssStateInformation &other) = default;
70 
74  RssStateInformation(RssStateInformation &&other) = default;
75 
83  RssStateInformation &operator=(const RssStateInformation &other) = default;
84 
93 
101  bool operator==(const RssStateInformation &other) const
102  {
103  return (safeDistance == other.safeDistance) && (currentDistance == other.currentDistance)
104  && (evaluator == other.evaluator);
105  }
106 
114  bool operator!=(const RssStateInformation &other) const
115  {
116  return !operator==(other);
117  }
118 
122  ::ad::physics::Distance safeDistance{-1.};
123 
127  ::ad::physics::Distance currentDistance{-1.};
128 
133  ::ad::rss::state::RssStateEvaluator evaluator{::ad::rss::state::RssStateEvaluator::None};
134 };
135 
136 } // namespace state
137 } // namespace rss
138 } // namespace ad
139 
143 #ifndef GEN_GUARD_AD_RSS_STATE_RSSSTATEINFORMATION
144 #define GEN_GUARD_AD_RSS_STATE_RSSSTATEINFORMATION
145 
148 namespace ad {
152 namespace rss {
156 namespace state {
157 
167 inline std::ostream &operator<<(std::ostream &os, RssStateInformation const &_value)
168 {
169  os << "RssStateInformation(";
170  os << "safeDistance:";
171  os << _value.safeDistance;
172  os << ",";
173  os << "currentDistance:";
174  os << _value.currentDistance;
175  os << ",";
176  os << "evaluator:";
177  os << _value.evaluator;
178  os << ")";
179  return os;
180 }
181 
182 } // namespace state
183 } // namespace rss
184 } // namespace ad
185 
186 namespace std {
190 inline std::string to_string(::ad::rss::state::RssStateInformation const &value)
191 {
192  stringstream sstream;
193  sstream << value;
194  return sstream.str();
195 }
196 } // namespace std
197 #endif // GEN_GUARD_AD_RSS_STATE_RSSSTATEINFORMATION
ad
namespace ad
Definition: LateralRelativePosition.hpp:26
ad::rss::state::RssStateInformation::~RssStateInformation
~RssStateInformation()=default
standard destructor
ad::rss::state::RssStateInformation::safeDistance
::ad::physics::Distance safeDistance
Definition: RssStateInformation.hpp:122
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
RssStateEvaluator.hpp
ad::rss::state::RssStateInformation::Ptr
std::shared_ptr< RssStateInformation > Ptr
Smart pointer on RssStateInformation.
Definition: RssStateInformation.hpp:49
ad::rss::state::RssStateEvaluator
RssStateEvaluator
DataType RssStateEvaluator.
Definition: RssStateEvaluator.hpp:41
ad::rss::state::RssStateInformation::operator==
bool operator==(const RssStateInformation &other) const
standard comparison operator
Definition: RssStateInformation.hpp:101
ad::rss::state::RssStateInformation::operator=
RssStateInformation & operator=(const RssStateInformation &other)=default
standard assignment operator
ad::rss::state::RssStateInformation::operator!=
bool operator!=(const RssStateInformation &other) const
standard comparison operator
Definition: RssStateInformation.hpp:114
ad::rss::state::operator<<
std::ostream & operator<<(std::ostream &os, AccelerationRestriction const &_value)
standard ostream operator
Definition: AccelerationRestriction.hpp:164
ad::rss::state::RssStateInformation::evaluator
::ad::rss::state::RssStateEvaluator evaluator
Definition: RssStateInformation.hpp:133
ad::rss::state::RssStateInformation::currentDistance
::ad::physics::Distance currentDistance
Definition: RssStateInformation.hpp:127
ad::rss::state::RssStateInformation::RssStateInformation
RssStateInformation()=default
standard constructor
ad::rss::state::RssStateInformation::ConstPtr
std::shared_ptr< RssStateInformation const > ConstPtr
Smart pointer on constant RssStateInformation.
Definition: RssStateInformation.hpp:54
ad::rss::state::RssStateInformation
DataType RssStateInformation.
Definition: RssStateInformation.hpp:44