ad_rss_map_integration
RssEgoVehicleDynamicsOnRoute.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 <chrono>
21 #include <iostream>
22 #include <limits>
23 #include <memory>
24 #include <sstream>
25 #include "ad/physics/Acceleration.hpp"
30 namespace ad {
34 namespace rss {
38 namespace map {
39 
46 {
50  typedef std::shared_ptr<RssEgoVehicleDynamicsOnRoute> Ptr;
51 
55  typedef std::shared_ptr<RssEgoVehicleDynamicsOnRoute const> ConstPtr;
56 
61 
66 
71 
76 
85 
94 
102  bool operator==(const RssEgoVehicleDynamicsOnRoute &other) const
103  {
104  return (last_update == other.last_update) && (route_accel_lon == other.route_accel_lon)
107  }
108 
116  bool operator!=(const RssEgoVehicleDynamicsOnRoute &other) const
117  {
118  return !operator==(other);
119  }
120 
124  std::chrono::system_clock::time_point last_update;
125 
129  ::ad::physics::Acceleration route_accel_lon{0.};
130 
134  ::ad::physics::Acceleration route_accel_lat{0.};
135 
139  ::ad::physics::Acceleration avg_route_accel_lon{0.};
140 
144  ::ad::physics::Acceleration avg_route_accel_lat{0.};
145 };
146 
147 } // namespace map
148 } // namespace rss
149 } // namespace ad
150 
154 #ifndef GEN_GUARD_AD_RSS_MAP_RSSEGOVEHICLEDYNAMICSONROUTE
155 #define GEN_GUARD_AD_RSS_MAP_RSSEGOVEHICLEDYNAMICSONROUTE
159 namespace ad {
163 namespace rss {
167 namespace map {
168 
178 inline std::ostream &operator<<(std::ostream &os, RssEgoVehicleDynamicsOnRoute const &_value)
179 {
180  os << "RssEgoVehicleDynamicsOnRoute(";
181  os << "last_update:";
182  os << _value.last_update;
183  os << ",";
184  os << "route_accel_lon:";
185  os << _value.route_accel_lon;
186  os << ",";
187  os << "route_accel_lat:";
188  os << _value.route_accel_lat;
189  os << ",";
190  os << "avg_route_accel_lon:";
191  os << _value.avg_route_accel_lon;
192  os << ",";
193  os << "avg_route_accel_lat:";
194  os << _value.avg_route_accel_lat;
195  os << ")";
196  return os;
197 }
198 
199 } // namespace map
200 } // namespace rss
201 } // namespace ad
202 
203 namespace std {
207 inline std::string to_string(::ad::rss::map::RssEgoVehicleDynamicsOnRoute const &value)
208 {
209  stringstream sstream;
210  sstream << value;
211  return sstream.str();
212 }
213 } // namespace std
214 
218 template <> struct fmt::formatter<::ad::rss::map::RssEgoVehicleDynamicsOnRoute> : formatter<string_view>
219 {
220  template <typename FormatContext>
221  auto format(::ad::rss::map::RssEgoVehicleDynamicsOnRoute const &value, FormatContext &ctx)
222  {
223  return formatter<string_view>::format(std::to_string(value), ctx);
224  }
225 };
226 
227 #endif // GEN_GUARD_AD_RSS_MAP_RSSEGOVEHICLEDYNAMICSONROUTE
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
DataType RssEgoVehicleDynamicsOnRoute.
Definition: RssEgoVehicleDynamicsOnRoute.hpp:46
bool operator==(const RssEgoVehicleDynamicsOnRoute &other) const
standard comparison operator
Definition: RssEgoVehicleDynamicsOnRoute.hpp:102
RssEgoVehicleDynamicsOnRoute & operator=(RssEgoVehicleDynamicsOnRoute &&other)=default
standard move operator
RssEgoVehicleDynamicsOnRoute()=default
standard constructor
RssEgoVehicleDynamicsOnRoute(const RssEgoVehicleDynamicsOnRoute &other)=default
standard copy constructor
std::shared_ptr< RssEgoVehicleDynamicsOnRoute const > ConstPtr
Smart pointer on constant RssEgoVehicleDynamicsOnRoute.
Definition: RssEgoVehicleDynamicsOnRoute.hpp:55
::ad::physics::Acceleration avg_route_accel_lon
Definition: RssEgoVehicleDynamicsOnRoute.hpp:139
::ad::physics::Acceleration route_accel_lon
Definition: RssEgoVehicleDynamicsOnRoute.hpp:129
RssEgoVehicleDynamicsOnRoute(RssEgoVehicleDynamicsOnRoute &&other)=default
standard move constructor
bool operator!=(const RssEgoVehicleDynamicsOnRoute &other) const
standard comparison operator
Definition: RssEgoVehicleDynamicsOnRoute.hpp:116
::ad::physics::Acceleration route_accel_lat
Definition: RssEgoVehicleDynamicsOnRoute.hpp:134
::ad::physics::Acceleration avg_route_accel_lat
Definition: RssEgoVehicleDynamicsOnRoute.hpp:144
std::chrono::system_clock::time_point last_update
Definition: RssEgoVehicleDynamicsOnRoute.hpp:124
std::shared_ptr< RssEgoVehicleDynamicsOnRoute > Ptr
Smart pointer on RssEgoVehicleDynamicsOnRoute.
Definition: RssEgoVehicleDynamicsOnRoute.hpp:50
~RssEgoVehicleDynamicsOnRoute()=default
standard destructor
RssEgoVehicleDynamicsOnRoute & operator=(const RssEgoVehicleDynamicsOnRoute &other)=default
standard assignment operator