ad_rss
WorldModel.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>
30 namespace ad {
34 namespace rss {
38 namespace world {
39 
46 struct WorldModel
47 {
51  typedef std::shared_ptr<WorldModel> Ptr;
52 
56  typedef std::shared_ptr<WorldModel const> ConstPtr;
57 
61  WorldModel() = default;
62 
66  ~WorldModel() = default;
67 
71  WorldModel(const WorldModel &other) = default;
72 
76  WorldModel(WorldModel &&other) = default;
77 
85  WorldModel &operator=(const WorldModel &other) = default;
86 
94  WorldModel &operator=(WorldModel &&other) = default;
95 
103  bool operator==(const WorldModel &other) const
104  {
105  return (time_index == other.time_index)
107  && (constellations == other.constellations);
108  }
109 
117  bool operator!=(const WorldModel &other) const
118  {
119  return !operator==(other);
120  }
121 
128 
136 
141 };
142 
143 } // namespace world
144 } // namespace rss
145 } // namespace ad
146 
150 #ifndef GEN_GUARD_AD_RSS_WORLD_WORLDMODEL
151 #define GEN_GUARD_AD_RSS_WORLD_WORLDMODEL
155 namespace ad {
159 namespace rss {
163 namespace world {
164 
174 inline std::ostream &operator<<(std::ostream &os, WorldModel const &_value)
175 {
176  os << "WorldModel(";
177  os << "time_index:";
178  os << _value.time_index;
179  os << ",";
180  os << "default_ego_vehicle_rss_dynamics:";
182  os << ",";
183  os << "constellations:";
184  os << _value.constellations;
185  os << ")";
186  return os;
187 }
188 
189 } // namespace world
190 } // namespace rss
191 } // namespace ad
192 
193 namespace std {
197 inline std::string to_string(::ad::rss::world::WorldModel const &value)
198 {
199  stringstream sstream;
200  sstream << value;
201  return sstream.str();
202 }
203 } // namespace std
204 
208 template <> struct fmt::formatter<::ad::rss::world::WorldModel> : formatter<string_view>
209 {
210  template <typename FormatContext> auto format(::ad::rss::world::WorldModel const &value, FormatContext &ctx)
211  {
212  return formatter<string_view>::format(std::to_string(value), ctx);
213  }
214 };
215 
216 #endif // GEN_GUARD_AD_RSS_WORLD_WORLDMODEL
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::Constellation > ConstellationVector
DataType ConstellationVector.
Definition: ConstellationVector.hpp:42
uint64_t TimeIndex
DataType TimeIndex.
Definition: TimeIndex.hpp:39
std::ostream & operator<<(std::ostream &os, Constellation const &_value)
standard ostream operator
Definition: Constellation.hpp:198
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType RssDynamics.
Definition: RssDynamics.hpp:51
DataType WorldModel.
Definition: WorldModel.hpp:47
WorldModel & operator=(const WorldModel &other)=default
standard assignment operator
WorldModel(const WorldModel &other)=default
standard copy constructor
bool operator!=(const WorldModel &other) const
standard comparison operator
Definition: WorldModel.hpp:117
std::shared_ptr< WorldModel > Ptr
Smart pointer on WorldModel.
Definition: WorldModel.hpp:51
~WorldModel()=default
standard destructor
WorldModel & operator=(WorldModel &&other)=default
standard move operator
std::shared_ptr< WorldModel const > ConstPtr
Smart pointer on constant WorldModel.
Definition: WorldModel.hpp:56
WorldModel()=default
standard constructor
::ad::rss::world::TimeIndex time_index
Definition: WorldModel.hpp:127
bool operator==(const WorldModel &other) const
standard comparison operator
Definition: WorldModel.hpp:103
WorldModel(WorldModel &&other)=default
standard move constructor
::ad::rss::world::ConstellationVector constellations
Definition: WorldModel.hpp:140
::ad::rss::world::RssDynamics default_ego_vehicle_rss_dynamics
Definition: WorldModel.hpp:135