ad_rss
RelativeConstellation.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 core {
42 
56 {
60  typedef std::shared_ptr<RelativeConstellation> Ptr;
61 
65  typedef std::shared_ptr<RelativeConstellation const> ConstPtr;
66 
70  RelativeConstellation() = default;
71 
76 
81 
86 
95 
104 
112  bool operator==(const RelativeConstellation &other) const
113  {
114  return (ego_id == other.ego_id) && (object_id == other.object_id) && (constellation_id == other.constellation_id)
115  && (constellation_type == other.constellation_type) && (ego_state == other.ego_state)
116  && (other_state == other.other_state) && (relative_position == other.relative_position)
118  }
119 
127  bool operator!=(const RelativeConstellation &other) const
128  {
129  return !operator==(other);
130  }
131 
136 
141 
148 
152  ::ad::rss::world::ConstellationType constellation_type{::ad::rss::world::ConstellationType::NotRelevant};
153 
158 
163 
169 
175 };
176 
177 } // namespace core
178 } // namespace rss
179 } // namespace ad
180 
184 #ifndef GEN_GUARD_AD_RSS_CORE_RELATIVECONSTELLATION
185 #define GEN_GUARD_AD_RSS_CORE_RELATIVECONSTELLATION
189 namespace ad {
193 namespace rss {
197 namespace core {
198 
208 inline std::ostream &operator<<(std::ostream &os, RelativeConstellation const &_value)
209 {
210  os << "RelativeConstellation(";
211  os << "ego_id:";
212  os << _value.ego_id;
213  os << ",";
214  os << "object_id:";
215  os << _value.object_id;
216  os << ",";
217  os << "constellation_id:";
218  os << _value.constellation_id;
219  os << ",";
220  os << "constellation_type:";
221  os << _value.constellation_type;
222  os << ",";
223  os << "ego_state:";
224  os << _value.ego_state;
225  os << ",";
226  os << "other_state:";
227  os << _value.other_state;
228  os << ",";
229  os << "relative_position:";
230  os << _value.relative_position;
231  os << ",";
232  os << "world_model_indices:";
233  os << _value.world_model_indices;
234  os << ")";
235  return os;
236 }
237 
238 } // namespace core
239 } // namespace rss
240 } // namespace ad
241 
242 namespace std {
246 inline std::string to_string(::ad::rss::core::RelativeConstellation const &value)
247 {
248  stringstream sstream;
249  sstream << value;
250  return sstream.str();
251 }
252 } // namespace std
253 
257 template <> struct fmt::formatter<::ad::rss::core::RelativeConstellation> : formatter<string_view>
258 {
259  template <typename FormatContext> auto format(::ad::rss::core::RelativeConstellation const &value, FormatContext &ctx)
260  {
261  return formatter<string_view>::format(std::to_string(value), ctx);
262  }
263 };
264 
265 #endif // GEN_GUARD_AD_RSS_CORE_RELATIVECONSTELLATION
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, LateralRelativePosition const &value)
standard ostream operator
Definition: LateralRelativePosition.hpp:149
std::vector<::ad::rss::world::WorldModelIndex > WorldModelIndexVector
DataType WorldModelIndexVector.
Definition: WorldModelIndexVector.hpp:44
ConstellationType
DataType ConstellationType.
Definition: ConstellationType.hpp:44
uint64_t ObjectId
DataType ObjectId.
Definition: ObjectId.hpp:39
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType RelativeConstellation.
Definition: RelativeConstellation.hpp:56
RelativeConstellation & operator=(RelativeConstellation &&other)=default
standard move operator
::ad::rss::core::RelativeObjectState other_state
Definition: RelativeConstellation.hpp:162
std::shared_ptr< RelativeConstellation const > ConstPtr
Smart pointer on constant RelativeConstellation.
Definition: RelativeConstellation.hpp:65
bool operator==(const RelativeConstellation &other) const
standard comparison operator
Definition: RelativeConstellation.hpp:112
::ad::rss::world::ObjectId ego_id
Definition: RelativeConstellation.hpp:135
RelativeConstellation(RelativeConstellation &&other)=default
standard move constructor
~RelativeConstellation()=default
standard destructor
::ad::rss::world::WorldModelIndexVector world_model_indices
Definition: RelativeConstellation.hpp:174
::ad::rss::world::ConstellationType constellation_type
Definition: RelativeConstellation.hpp:152
::ad::rss::core::RelativeObjectState ego_state
Definition: RelativeConstellation.hpp:157
::ad::rss::core::RelativeConstellationId constellation_id
Definition: RelativeConstellation.hpp:147
RelativeConstellation & operator=(const RelativeConstellation &other)=default
standard assignment operator
RelativeConstellation()=default
standard constructor
std::shared_ptr< RelativeConstellation > Ptr
Smart pointer on RelativeConstellation.
Definition: RelativeConstellation.hpp:60
RelativeConstellation(const RelativeConstellation &other)=default
standard copy constructor
::ad::rss::world::ObjectId object_id
Definition: RelativeConstellation.hpp:140
bool operator!=(const RelativeConstellation &other) const
standard comparison operator
Definition: RelativeConstellation.hpp:127
::ad::rss::core::RelativePosition relative_position
Definition: RelativeConstellation.hpp:168
DataType RelativeObjectState.
Definition: RelativeObjectState.hpp:48
DataType RelativePosition.
Definition: RelativePosition.hpp:46