ad_rss
RssState.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>
33 namespace ad {
37 namespace rss {
41 namespace state {
42 
48 struct RssState
49 {
53  typedef std::shared_ptr<RssState> Ptr;
54 
58  typedef std::shared_ptr<RssState const> ConstPtr;
59 
63  RssState() = default;
64 
68  ~RssState() = default;
69 
73  RssState(const RssState &other) = default;
74 
78  RssState(RssState &&other) = default;
79 
87  RssState &operator=(const RssState &other) = default;
88 
96  RssState &operator=(RssState &&other) = default;
97 
105  bool operator==(const RssState &other) const
106  {
107  return (ego_id == other.ego_id) && (object_id == other.object_id) && (constellation_id == other.constellation_id)
112  }
113 
121  bool operator!=(const RssState &other) const
122  {
123  return !operator==(other);
124  }
125 
130 
135 
144 
149 
154 
159 
164 
169 };
170 
171 } // namespace state
172 } // namespace rss
173 } // namespace ad
174 
178 #ifndef GEN_GUARD_AD_RSS_STATE_RSSSTATE
179 #define GEN_GUARD_AD_RSS_STATE_RSSSTATE
183 namespace ad {
187 namespace rss {
191 namespace state {
192 
202 inline std::ostream &operator<<(std::ostream &os, RssState const &_value)
203 {
204  os << "RssState(";
205  os << "ego_id:";
206  os << _value.ego_id;
207  os << ",";
208  os << "object_id:";
209  os << _value.object_id;
210  os << ",";
211  os << "constellation_id:";
212  os << _value.constellation_id;
213  os << ",";
214  os << "longitudinal_state:";
215  os << _value.longitudinal_state;
216  os << ",";
217  os << "lateral_state_right:";
218  os << _value.lateral_state_right;
219  os << ",";
220  os << "lateral_state_left:";
221  os << _value.lateral_state_left;
222  os << ",";
223  os << "unstructured_constellation_state:";
225  os << ",";
226  os << "constellation_type:";
227  os << _value.constellation_type;
228  os << ")";
229  return os;
230 }
231 
232 } // namespace state
233 } // namespace rss
234 } // namespace ad
235 
236 namespace std {
240 inline std::string to_string(::ad::rss::state::RssState const &value)
241 {
242  stringstream sstream;
243  sstream << value;
244  return sstream.str();
245 }
246 } // namespace std
247 
251 template <> struct fmt::formatter<::ad::rss::state::RssState> : formatter<string_view>
252 {
253  template <typename FormatContext> auto format(::ad::rss::state::RssState const &value, FormatContext &ctx)
254  {
255  return formatter<string_view>::format(std::to_string(value), ctx);
256  }
257 };
258 
259 #endif // GEN_GUARD_AD_RSS_STATE_RSSSTATE
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
uint64_t RelativeConstellationId
DataType RelativeConstellationId.
Definition: RelativeConstellationId.hpp:39
std::ostream & operator<<(std::ostream &os, AccelerationRestriction const &_value)
standard ostream operator
Definition: AccelerationRestriction.hpp:164
ConstellationType
DataType ConstellationType.
Definition: ConstellationType.hpp:44
uint64_t ObjectId
DataType ObjectId.
Definition: ObjectId.hpp:39
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType LateralRssState.
Definition: LateralRssState.hpp:45
DataType LongitudinalRssState.
Definition: LongitudinalRssState.hpp:45
DataType RssState.
Definition: RssState.hpp:49
RssState(const RssState &other)=default
standard copy constructor
std::shared_ptr< RssState const > ConstPtr
Smart pointer on constant RssState.
Definition: RssState.hpp:58
::ad::rss::state::LateralRssState lateral_state_left
Definition: RssState.hpp:158
::ad::rss::state::UnstructuredConstellationRssState unstructured_constellation_state
Definition: RssState.hpp:163
::ad::rss::state::LateralRssState lateral_state_right
Definition: RssState.hpp:153
RssState & operator=(RssState &&other)=default
standard move operator
::ad::rss::world::ConstellationType constellation_type
Definition: RssState.hpp:168
::ad::rss::world::ObjectId object_id
Definition: RssState.hpp:134
::ad::rss::state::LongitudinalRssState longitudinal_state
Definition: RssState.hpp:148
RssState(RssState &&other)=default
standard move constructor
RssState & operator=(const RssState &other)=default
standard assignment operator
::ad::rss::world::ObjectId ego_id
Definition: RssState.hpp:129
~RssState()=default
standard destructor
bool operator!=(const RssState &other) const
standard comparison operator
Definition: RssState.hpp:121
bool operator==(const RssState &other) const
standard comparison operator
Definition: RssState.hpp:105
std::shared_ptr< RssState > Ptr
Smart pointer on RssState.
Definition: RssState.hpp:53
RssState()=default
standard constructor
::ad::rss::core::RelativeConstellationId constellation_id
Definition: RssState.hpp:143
DataType UnstructuredConstellationRssState.
Definition: UnstructuredConstellationRssState.hpp:46