ad_rss
LongitudinalRssState.hpp
Go to the documentation of this file.
1 /*
2  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3  *
4  * Copyright (C) 2018-2022 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 
75 
84 
93 
101  bool operator==(const LongitudinalRssState &other) const
102  {
103  return (is_safe == other.is_safe) && (response == other.response) && (alpha_lon == other.alpha_lon)
105  }
106 
114  bool operator!=(const LongitudinalRssState &other) const
115  {
116  return !operator==(other);
117  }
118 
122  bool is_safe{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
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 << "is_safe:";
175  os << _value.is_safe;
176  os << ",";
177  os << "response:";
178  os << _value.response;
179  os << ",";
180  os << "alpha_lon:";
181  os << _value.alpha_lon;
182  os << ",";
183  os << "rss_state_information:";
184  os << _value.rss_state_information;
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 
208 template <> struct fmt::formatter<::ad::rss::state::LongitudinalRssState> : formatter<string_view>
209 {
210  template <typename FormatContext> auto format(::ad::rss::state::LongitudinalRssState const &value, FormatContext &ctx)
211  {
212  return formatter<string_view>::format(std::to_string(value), ctx);
213  }
214 };
215 
216 #endif // GEN_GUARD_AD_RSS_STATE_LONGITUDINALRSSSTATE
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
LongitudinalResponse
DataType LongitudinalResponse.
Definition: LongitudinalResponse.hpp:46
std::ostream & operator<<(std::ostream &os, AccelerationRestriction const &_value)
standard ostream operator
Definition: AccelerationRestriction.hpp:164
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType LongitudinalRssState.
Definition: LongitudinalRssState.hpp:45
LongitudinalRssState & operator=(const LongitudinalRssState &other)=default
standard assignment operator
~LongitudinalRssState()=default
standard destructor
::ad::rss::state::RssStateInformation rss_state_information
Definition: LongitudinalRssState.hpp:137
LongitudinalRssState & operator=(LongitudinalRssState &&other)=default
standard move operator
std::shared_ptr< LongitudinalRssState > Ptr
Smart pointer on LongitudinalRssState.
Definition: LongitudinalRssState.hpp:49
LongitudinalRssState()=default
standard constructor
LongitudinalRssState(LongitudinalRssState &&other)=default
standard move constructor
bool is_safe
Definition: LongitudinalRssState.hpp:122
bool operator!=(const LongitudinalRssState &other) const
standard comparison operator
Definition: LongitudinalRssState.hpp:114
::ad::rss::world::LongitudinalRssAccelerationValues alpha_lon
Definition: LongitudinalRssState.hpp:132
LongitudinalRssState(const LongitudinalRssState &other)=default
standard copy constructor
std::shared_ptr< LongitudinalRssState const > ConstPtr
Smart pointer on constant LongitudinalRssState.
Definition: LongitudinalRssState.hpp:54
bool operator==(const LongitudinalRssState &other) const
standard comparison operator
Definition: LongitudinalRssState.hpp:101
::ad::rss::state::LongitudinalResponse response
Definition: LongitudinalRssState.hpp:127
DataType RssStateInformation.
Definition: RssStateInformation.hpp:45
DataType LongitudinalRssAccelerationValues.
Definition: LongitudinalRssAccelerationValues.hpp:44