ad_rss_map_integration
RssCheckResult.hpp
Go to the documentation of this file.
1 // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 //
3 // Copyright (C) 2019-2024 Intel Corporation
4 //
5 // SPDX-License-Identifier: LGPL-2.1-only
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
8 
12 #pragma once
13 
15 
19 namespace ad {
23 namespace rss {
27 namespace map {
28 
30 {
31  RssCheckResult() = default;
32 
33  RssCheckResult(RssCheckResult const &other) = default;
34 
35  RssCheckResult(ad::rss::map::RssRouteCheckResult const &route_check_result, ad::physics::Duration const &v2x_latency)
36  : v2x_latency(v2x_latency)
37  , proper_response(route_check_result.proper_response)
38  , result_analysis(route_check_result.result_analysis)
39  , rss_route(route_check_result.rss_route)
40  {
41  }
42 
43  RssCheckResult &operator=(RssCheckResult const &other) = default;
44 
45  bool operator==(RssCheckResult const &other) const
46  {
47  return v2x_latency == other.v2x_latency && proper_response == other.proper_response
48  && result_analysis == other.result_analysis && rss_route == other.rss_route;
49  }
50 
51  ad::physics::Duration v2x_latency;
52  ad::rss::state::ProperResponse proper_response;
54  ad::rss::map::RssRoute rss_route;
55 };
56 
57 using RssCheckResults = std::vector<RssCheckResult>;
58 
68 inline std::ostream &operator<<(std::ostream &os, RssCheckResult const &_value)
69 {
70  os << "RssCheckResult(";
71  os << "v2x_latency:";
72  os << _value.v2x_latency;
73  os << ",";
74  os << "proper_response:";
75  os << _value.proper_response;
76  os << ",";
77  os << "result_analysis:";
78  os << _value.result_analysis;
79  os << ",";
80  os << "rss_route:";
81  os << _value.rss_route;
82  os << ")";
83  return os;
84 }
85 
86 } // namespace map
87 } // namespace rss
88 } // namespace ad
89 
90 namespace std {
94 inline std::string to_string(ad::rss::map::RssCheckResult const &vehicle_result)
95 {
96  stringstream sstream;
97  sstream << vehicle_result.v2x_latency << vehicle_result.proper_response << vehicle_result.result_analysis
98  << vehicle_result.rss_route;
99  return sstream.str();
100 }
101 
102 } // namespace std
103 
107 template <> struct fmt::formatter<::ad::rss::map::RssCheckResult> : formatter<string_view>
108 {
109  template <typename FormatContext> auto format(::ad::rss::map::RssCheckResult const &value, FormatContext &ctx)
110  {
111  return formatter<string_view>::format(std::to_string(value), ctx);
112  }
113 };
std::string to_string(::ad::rss::map::RouteAccelerations const &value)
overload of the std::to_string for RouteAccelerations
Definition: RouteAccelerations.hpp:229
std::ostream & operator<<(std::ostream &os, RouteAccelerations const &_value)
standard ostream operator
Definition: RouteAccelerations.hpp:194
namespace ad
Definition: RouteAccelerations.hpp:33
Definition: RssCheckResult.hpp:30
DataType RssRouteCheckResultAnalysis.
Definition: RssRouteCheckResultAnalysis.hpp:44
DataType RssRouteCheckResult.
Definition: RssRouteCheckResult.hpp:48
::ad::rss::map::RssRouteCheckResultAnalysis result_analysis
Definition: RssRouteCheckResult.hpp:156
::ad::rss::state::ProperResponse proper_response
Definition: RssRouteCheckResult.hpp:151
::ad::rss::map::RssRoute rss_route
Definition: RssRouteCheckResult.hpp:126
DataType RssRoute.
Definition: RssRoute.hpp:49