ad_rss
AccelerationRestriction.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>
23 #include "ad/physics/AccelerationRange.hpp"
27 namespace ad {
31 namespace rss {
35 namespace state {
36 
43 {
47  typedef std::shared_ptr<AccelerationRestriction> Ptr;
48 
52  typedef std::shared_ptr<AccelerationRestriction const> ConstPtr;
53 
58 
63 
68 
73 
82 
91 
99  bool operator==(const AccelerationRestriction &other) const
100  {
103  }
104 
112  bool operator!=(const AccelerationRestriction &other) const
113  {
114  return !operator==(other);
115  }
116 
120  ::ad::physics::AccelerationRange lateral_left_range;
121 
125  ::ad::physics::AccelerationRange longitudinal_range;
126 
130  ::ad::physics::AccelerationRange lateral_right_range;
131 };
132 
133 } // namespace state
134 } // namespace rss
135 } // namespace ad
136 
140 #ifndef GEN_GUARD_AD_RSS_STATE_ACCELERATIONRESTRICTION
141 #define GEN_GUARD_AD_RSS_STATE_ACCELERATIONRESTRICTION
145 namespace ad {
149 namespace rss {
153 namespace state {
154 
164 inline std::ostream &operator<<(std::ostream &os, AccelerationRestriction const &_value)
165 {
166  os << "AccelerationRestriction(";
167  os << "lateral_left_range:";
168  os << _value.lateral_left_range;
169  os << ",";
170  os << "longitudinal_range:";
171  os << _value.longitudinal_range;
172  os << ",";
173  os << "lateral_right_range:";
174  os << _value.lateral_right_range;
175  os << ")";
176  return os;
177 }
178 
179 } // namespace state
180 } // namespace rss
181 } // namespace ad
182 
183 namespace std {
187 inline std::string to_string(::ad::rss::state::AccelerationRestriction const &value)
188 {
189  stringstream sstream;
190  sstream << value;
191  return sstream.str();
192 }
193 } // namespace std
194 
198 template <> struct fmt::formatter<::ad::rss::state::AccelerationRestriction> : formatter<string_view>
199 {
200  template <typename FormatContext>
201  auto format(::ad::rss::state::AccelerationRestriction const &value, FormatContext &ctx)
202  {
203  return formatter<string_view>::format(std::to_string(value), ctx);
204  }
205 };
206 
207 #endif // GEN_GUARD_AD_RSS_STATE_ACCELERATIONRESTRICTION
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
std::ostream & operator<<(std::ostream &os, AccelerationRestriction const &_value)
standard ostream operator
Definition: AccelerationRestriction.hpp:164
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType AccelerationRestriction.
Definition: AccelerationRestriction.hpp:43
AccelerationRestriction(const AccelerationRestriction &other)=default
standard copy constructor
AccelerationRestriction()=default
standard constructor
bool operator==(const AccelerationRestriction &other) const
standard comparison operator
Definition: AccelerationRestriction.hpp:99
::ad::physics::AccelerationRange longitudinal_range
Definition: AccelerationRestriction.hpp:125
::ad::physics::AccelerationRange lateral_right_range
Definition: AccelerationRestriction.hpp:130
AccelerationRestriction(AccelerationRestriction &&other)=default
standard move constructor
~AccelerationRestriction()=default
standard destructor
std::shared_ptr< AccelerationRestriction const > ConstPtr
Smart pointer on constant AccelerationRestriction.
Definition: AccelerationRestriction.hpp:52
AccelerationRestriction & operator=(const AccelerationRestriction &other)=default
standard assignment operator
::ad::physics::AccelerationRange lateral_left_range
Definition: AccelerationRestriction.hpp:120
std::shared_ptr< AccelerationRestriction > Ptr
Smart pointer on AccelerationRestriction.
Definition: AccelerationRestriction.hpp:47
bool operator!=(const AccelerationRestriction &other) const
standard comparison operator
Definition: AccelerationRestriction.hpp:112
AccelerationRestriction & operator=(AccelerationRestriction &&other)=default
standard move operator