ad_rss
LongitudinalRssState.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>
29 namespace ad {
33 namespace rss {
37 namespace state {
38 
45 {
49  typedef std::shared_ptr<LongitudinalRssState> Ptr;
50 
54  typedef std::shared_ptr<LongitudinalRssState const> ConstPtr;
55 
59  LongitudinalRssState() = default;
60 
64  ~LongitudinalRssState() = default;
65 
69  LongitudinalRssState(const LongitudinalRssState &other) = default;
70 
74  LongitudinalRssState(LongitudinalRssState &&other) = default;
75 
83  LongitudinalRssState &operator=(const LongitudinalRssState &other) = default;
84 
93 
101  bool operator==(const LongitudinalRssState &other) const
102  {
103  return (isSafe == other.isSafe) && (response == other.response) && (alphaLon == other.alphaLon)
105  }
106 
114  bool operator!=(const LongitudinalRssState &other) const
115  {
116  return !operator==(other);
117  }
118 
122  bool isSafe{false};
123 
127  ::ad::rss::state::LongitudinalResponse response{::ad::rss::state::LongitudinalResponse::BrakeMin};
128 
133 
138 };
139 
140 } // namespace state
141 } // namespace rss
142 } // namespace ad
143 
147 #ifndef GEN_GUARD_AD_RSS_STATE_LONGITUDINALRSSSTATE
148 #define GEN_GUARD_AD_RSS_STATE_LONGITUDINALRSSSTATE
149 
152 namespace ad {
156 namespace rss {
160 namespace state {
161 
171 inline std::ostream &operator<<(std::ostream &os, LongitudinalRssState const &_value)
172 {
173  os << "LongitudinalRssState(";
174  os << "isSafe:";
175  os << _value.isSafe;
176  os << ",";
177  os << "response:";
178  os << _value.response;
179  os << ",";
180  os << "alphaLon:";
181  os << _value.alphaLon;
182  os << ",";
183  os << "rssStateInformation:";
184  os << _value.rssStateInformation;
185  os << ")";
186  return os;
187 }
188 
189 } // namespace state
190 } // namespace rss
191 } // namespace ad
192 
193 namespace std {
197 inline std::string to_string(::ad::rss::state::LongitudinalRssState const &value)
198 {
199  stringstream sstream;
200  sstream << value;
201  return sstream.str();
202 }
203 } // namespace std
204 #endif // GEN_GUARD_AD_RSS_STATE_LONGITUDINALRSSSTATE
ad
namespace ad
Definition: LateralRelativePosition.hpp:26
ad::rss::state::LongitudinalRssState::operator==
bool operator==(const LongitudinalRssState &other) const
standard comparison operator
Definition: LongitudinalRssState.hpp:101
ad::rss::state::LongitudinalRssState::Ptr
std::shared_ptr< LongitudinalRssState > Ptr
Smart pointer on LongitudinalRssState.
Definition: LongitudinalRssState.hpp:49
ad::rss::state::LongitudinalRssState
DataType LongitudinalRssState.
Definition: LongitudinalRssState.hpp:44
ad::rss::state::LongitudinalRssState::operator!=
bool operator!=(const LongitudinalRssState &other) const
standard comparison operator
Definition: LongitudinalRssState.hpp:114
ad::rss::state::LongitudinalRssState::isSafe
bool isSafe
Definition: LongitudinalRssState.hpp:122
RssStateInformation.hpp
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
LongitudinalResponse.hpp
LongitudinalRssAccelerationValues.hpp
ad::rss::state::LongitudinalRssState::response
::ad::rss::state::LongitudinalResponse response
Definition: LongitudinalRssState.hpp:127
ad::rss::world::LongitudinalRssAccelerationValues
DataType LongitudinalRssAccelerationValues.
Definition: LongitudinalRssAccelerationValues.hpp:43
ad::rss::state::LongitudinalRssState::ConstPtr
std::shared_ptr< LongitudinalRssState const > ConstPtr
Smart pointer on constant LongitudinalRssState.
Definition: LongitudinalRssState.hpp:54
ad::rss::state::LongitudinalRssState::operator=
LongitudinalRssState & operator=(const LongitudinalRssState &other)=default
standard assignment operator
ad::rss::state::LongitudinalRssState::LongitudinalRssState
LongitudinalRssState()=default
standard constructor
ad::rss::state::LongitudinalRssState::~LongitudinalRssState
~LongitudinalRssState()=default
standard destructor
ad::rss::state::operator<<
std::ostream & operator<<(std::ostream &os, AccelerationRestriction const &_value)
standard ostream operator
Definition: AccelerationRestriction.hpp:164
ad::rss::state::LongitudinalResponse
LongitudinalResponse
DataType LongitudinalResponse.
Definition: LongitudinalResponse.hpp:43
ad::rss::state::LongitudinalRssState::alphaLon
::ad::rss::world::LongitudinalRssAccelerationValues alphaLon
Definition: LongitudinalRssState.hpp:132
ad::rss::state::RssStateInformation
DataType RssStateInformation.
Definition: RssStateInformation.hpp:44
ad::rss::state::LongitudinalRssState::rssStateInformation
::ad::rss::state::RssStateInformation rssStateInformation
Definition: LongitudinalRssState.hpp:137