ad_rss
Constellation.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>
24 #include "ad/rss/world/Object.hpp"
30 namespace ad {
34 namespace rss {
38 namespace world {
39 
49 {
53  typedef std::shared_ptr<Constellation> Ptr;
54 
58  typedef std::shared_ptr<Constellation const> ConstPtr;
59 
63  Constellation() = default;
64 
68  ~Constellation() = default;
69 
73  Constellation(const Constellation &other) = default;
74 
78  Constellation(Constellation &&other) = default;
79 
87  Constellation &operator=(const Constellation &other) = default;
88 
96  Constellation &operator=(Constellation &&other) = default;
97 
105  bool operator==(const Constellation &other) const
106  {
107  return (constellation_type == other.constellation_type) && (ego_vehicle == other.ego_vehicle)
108  && (ego_vehicle_rss_dynamics == other.ego_vehicle_rss_dynamics) && (object == other.object)
110  && (ego_vehicle_road == other.ego_vehicle_road);
111  }
112 
120  bool operator!=(const Constellation &other) const
121  {
122  return !operator==(other);
123  }
124 
128  ::ad::rss::world::ConstellationType constellation_type{::ad::rss::world::ConstellationType::SameDirection};
129 
134 
141 
146 
152 
159 
165 };
166 
167 } // namespace world
168 } // namespace rss
169 } // namespace ad
170 
174 #ifndef GEN_GUARD_AD_RSS_WORLD_CONSTELLATION
175 #define GEN_GUARD_AD_RSS_WORLD_CONSTELLATION
179 namespace ad {
183 namespace rss {
187 namespace world {
188 
198 inline std::ostream &operator<<(std::ostream &os, Constellation const &_value)
199 {
200  os << "Constellation(";
201  os << "constellation_type:";
202  os << _value.constellation_type;
203  os << ",";
204  os << "ego_vehicle:";
205  os << _value.ego_vehicle;
206  os << ",";
207  os << "ego_vehicle_rss_dynamics:";
208  os << _value.ego_vehicle_rss_dynamics;
209  os << ",";
210  os << "object:";
211  os << _value.object;
212  os << ",";
213  os << "object_rss_dynamics:";
214  os << _value.object_rss_dynamics;
215  os << ",";
216  os << "intersecting_road:";
217  os << _value.intersecting_road;
218  os << ",";
219  os << "ego_vehicle_road:";
220  os << _value.ego_vehicle_road;
221  os << ")";
222  return os;
223 }
224 
225 } // namespace world
226 } // namespace rss
227 } // namespace ad
228 
229 namespace std {
233 inline std::string to_string(::ad::rss::world::Constellation const &value)
234 {
235  stringstream sstream;
236  sstream << value;
237  return sstream.str();
238 }
239 } // namespace std
240 
244 template <> struct fmt::formatter<::ad::rss::world::Constellation> : formatter<string_view>
245 {
246  template <typename FormatContext> auto format(::ad::rss::world::Constellation const &value, FormatContext &ctx)
247  {
248  return formatter<string_view>::format(std::to_string(value), ctx);
249  }
250 };
251 
252 #endif // GEN_GUARD_AD_RSS_WORLD_CONSTELLATION
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
std::vector<::ad::rss::world::RoadSegment > RoadArea
DataType RoadArea.
Definition: RoadArea.hpp:43
ConstellationType
DataType ConstellationType.
Definition: ConstellationType.hpp:44
std::ostream & operator<<(std::ostream &os, Constellation const &_value)
standard ostream operator
Definition: Constellation.hpp:198
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType Constellation.
Definition: Constellation.hpp:49
::ad::rss::world::RssDynamics ego_vehicle_rss_dynamics
Definition: Constellation.hpp:140
::ad::rss::world::RssDynamics object_rss_dynamics
Definition: Constellation.hpp:151
bool operator!=(const Constellation &other) const
standard comparison operator
Definition: Constellation.hpp:120
bool operator==(const Constellation &other) const
standard comparison operator
Definition: Constellation.hpp:105
::ad::rss::world::RoadArea ego_vehicle_road
Definition: Constellation.hpp:164
std::shared_ptr< Constellation > Ptr
Smart pointer on Constellation.
Definition: Constellation.hpp:53
::ad::rss::world::ConstellationType constellation_type
Definition: Constellation.hpp:128
~Constellation()=default
standard destructor
Constellation & operator=(Constellation &&other)=default
standard move operator
::ad::rss::world::RoadArea intersecting_road
Definition: Constellation.hpp:158
Constellation(Constellation &&other)=default
standard move constructor
Constellation(const Constellation &other)=default
standard copy constructor
::ad::rss::world::Object object
Definition: Constellation.hpp:145
Constellation & operator=(const Constellation &other)=default
standard assignment operator
std::shared_ptr< Constellation const > ConstPtr
Smart pointer on constant Constellation.
Definition: Constellation.hpp:58
::ad::rss::world::Object ego_vehicle
Definition: Constellation.hpp:133
Constellation()=default
standard constructor
DataType Object.
Definition: Object.hpp:49
DataType RssDynamics.
Definition: RssDynamics.hpp:51