ad_rss
ProperResponse.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 <limits>
22 #include <memory>
23 #include <sstream>
24 #include "ad/geometry/HeadingRangeVector.hpp"
34 namespace ad {
38 namespace rss {
42 namespace state {
43 
50 {
54  typedef std::shared_ptr<ProperResponse> Ptr;
55 
59  typedef std::shared_ptr<ProperResponse const> ConstPtr;
60 
64  ProperResponse() = default;
65 
69  ~ProperResponse() = default;
70 
74  ProperResponse(const ProperResponse &other) = default;
75 
79  ProperResponse(ProperResponse &&other) = default;
80 
88  ProperResponse &operator=(const ProperResponse &other) = default;
89 
98 
106  bool operator==(const ProperResponse &other) const
107  {
108  return (time_index == other.time_index) && (is_safe == other.is_safe)
114  }
115 
123  bool operator!=(const ProperResponse &other) const
124  {
125  return !operator==(other);
126  }
127 
134 
139  bool is_safe{false};
140 
145 
150 
155 
160 
165  ::ad::geometry::HeadingRangeVector heading_ranges;
166 
171 
176 };
177 
178 } // namespace state
179 } // namespace rss
180 } // namespace ad
181 
185 #ifndef GEN_GUARD_AD_RSS_STATE_PROPERRESPONSE
186 #define GEN_GUARD_AD_RSS_STATE_PROPERRESPONSE
190 namespace ad {
194 namespace rss {
198 namespace state {
199 
209 inline std::ostream &operator<<(std::ostream &os, ProperResponse const &_value)
210 {
211  os << "ProperResponse(";
212  os << "time_index:";
213  os << _value.time_index;
214  os << ",";
215  os << "is_safe:";
216  os << _value.is_safe;
217  os << ",";
218  os << "dangerous_objects:";
219  os << _value.dangerous_objects;
220  os << ",";
221  os << "longitudinal_response:";
222  os << _value.longitudinal_response;
223  os << ",";
224  os << "lateral_response_right:";
225  os << _value.lateral_response_right;
226  os << ",";
227  os << "lateral_response_left:";
228  os << _value.lateral_response_left;
229  os << ",";
230  os << "heading_ranges:";
231  os << _value.heading_ranges;
232  os << ",";
233  os << "acceleration_restrictions:";
234  os << _value.acceleration_restrictions;
235  os << ",";
236  os << "unstructured_constellation_response:";
238  os << ")";
239  return os;
240 }
241 
242 } // namespace state
243 } // namespace rss
244 } // namespace ad
245 
246 namespace std {
250 inline std::string to_string(::ad::rss::state::ProperResponse const &value)
251 {
252  stringstream sstream;
253  sstream << value;
254  return sstream.str();
255 }
256 } // namespace std
257 
261 template <> struct fmt::formatter<::ad::rss::state::ProperResponse> : formatter<string_view>
262 {
263  template <typename FormatContext> auto format(::ad::rss::state::ProperResponse const &value, FormatContext &ctx)
264  {
265  return formatter<string_view>::format(std::to_string(value), ctx);
266  }
267 };
268 
269 #endif // GEN_GUARD_AD_RSS_STATE_PROPERRESPONSE
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
LateralResponse
DataType LateralResponse.
Definition: LateralResponse.hpp:46
LongitudinalResponse
DataType LongitudinalResponse.
Definition: LongitudinalResponse.hpp:46
std::ostream & operator<<(std::ostream &os, AccelerationRestriction const &_value)
standard ostream operator
Definition: AccelerationRestriction.hpp:164
UnstructuredConstellationResponse
DataType UnstructuredConstellationResponse.
Definition: UnstructuredConstellationResponse.hpp:44
std::vector<::ad::rss::world::ObjectId > ObjectIdVector
DataType ObjectIdVector.
Definition: ObjectIdVector.hpp:44
uint64_t TimeIndex
DataType TimeIndex.
Definition: TimeIndex.hpp:39
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType AccelerationRestriction.
Definition: AccelerationRestriction.hpp:43
DataType ProperResponse.
Definition: ProperResponse.hpp:50
::ad::rss::state::AccelerationRestriction acceleration_restrictions
Definition: ProperResponse.hpp:170
::ad::rss::state::LongitudinalResponse longitudinal_response
Definition: ProperResponse.hpp:149
::ad::rss::world::TimeIndex time_index
Definition: ProperResponse.hpp:133
::ad::rss::state::LateralResponse lateral_response_right
Definition: ProperResponse.hpp:154
std::shared_ptr< ProperResponse > Ptr
Smart pointer on ProperResponse.
Definition: ProperResponse.hpp:54
bool operator!=(const ProperResponse &other) const
standard comparison operator
Definition: ProperResponse.hpp:123
::ad::rss::world::ObjectIdVector dangerous_objects
Definition: ProperResponse.hpp:144
::ad::rss::state::LateralResponse lateral_response_left
Definition: ProperResponse.hpp:159
::ad::geometry::HeadingRangeVector heading_ranges
Definition: ProperResponse.hpp:165
ProperResponse & operator=(const ProperResponse &other)=default
standard assignment operator
~ProperResponse()=default
standard destructor
::ad::rss::state::UnstructuredConstellationResponse unstructured_constellation_response
Definition: ProperResponse.hpp:175
ProperResponse()=default
standard constructor
bool operator==(const ProperResponse &other) const
standard comparison operator
Definition: ProperResponse.hpp:106
bool is_safe
Definition: ProperResponse.hpp:139
ProperResponse(ProperResponse &&other)=default
standard move constructor
ProperResponse & operator=(ProperResponse &&other)=default
standard move operator
ProperResponse(const ProperResponse &other)=default
standard copy constructor
std::shared_ptr< ProperResponse const > ConstPtr
Smart pointer on constant ProperResponse.
Definition: ProperResponse.hpp:59