ad_rss
OccupiedRegion.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>
24 #include "ad/physics/ParametricRange.hpp"
29 namespace ad {
33 namespace rss {
37 namespace world {
38 
47 {
51  typedef std::shared_ptr<OccupiedRegion> Ptr;
52 
56  typedef std::shared_ptr<OccupiedRegion const> ConstPtr;
57 
61  OccupiedRegion() = default;
62 
66  ~OccupiedRegion() = default;
67 
71  OccupiedRegion(const OccupiedRegion &other) = default;
72 
76  OccupiedRegion(OccupiedRegion &&other) = default;
77 
85  OccupiedRegion &operator=(const OccupiedRegion &other) = default;
86 
95 
103  bool operator==(const OccupiedRegion &other) const
104  {
105  return (segment_id == other.segment_id) && (lon_range == other.lon_range) && (lat_range == other.lat_range);
106  }
107 
115  bool operator!=(const OccupiedRegion &other) const
116  {
117  return !operator==(other);
118  }
119 
124 
128  ::ad::physics::ParametricRange lon_range;
129 
133  ::ad::physics::ParametricRange lat_range;
134 };
135 
136 } // namespace world
137 } // namespace rss
138 } // namespace ad
139 
143 #ifndef GEN_GUARD_AD_RSS_WORLD_OCCUPIEDREGION
144 #define GEN_GUARD_AD_RSS_WORLD_OCCUPIEDREGION
148 namespace ad {
152 namespace rss {
156 namespace world {
157 
167 inline std::ostream &operator<<(std::ostream &os, OccupiedRegion const &_value)
168 {
169  os << "OccupiedRegion(";
170  os << "segment_id:";
171  os << _value.segment_id;
172  os << ",";
173  os << "lon_range:";
174  os << _value.lon_range;
175  os << ",";
176  os << "lat_range:";
177  os << _value.lat_range;
178  os << ")";
179  return os;
180 }
181 
182 } // namespace world
183 } // namespace rss
184 } // namespace ad
185 
186 namespace std {
190 inline std::string to_string(::ad::rss::world::OccupiedRegion const &value)
191 {
192  stringstream sstream;
193  sstream << value;
194  return sstream.str();
195 }
196 } // namespace std
197 
201 template <> struct fmt::formatter<::ad::rss::world::OccupiedRegion> : formatter<string_view>
202 {
203  template <typename FormatContext> auto format(::ad::rss::world::OccupiedRegion const &value, FormatContext &ctx)
204  {
205  return formatter<string_view>::format(std::to_string(value), ctx);
206  }
207 };
208 
209 #endif // GEN_GUARD_AD_RSS_WORLD_OCCUPIEDREGION
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
uint64_t LaneSegmentId
DataType LaneSegmentId.
Definition: LaneSegmentId.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 OccupiedRegion.
Definition: OccupiedRegion.hpp:47
OccupiedRegion(const OccupiedRegion &other)=default
standard copy constructor
OccupiedRegion & operator=(const OccupiedRegion &other)=default
standard assignment operator
bool operator!=(const OccupiedRegion &other) const
standard comparison operator
Definition: OccupiedRegion.hpp:115
OccupiedRegion & operator=(OccupiedRegion &&other)=default
standard move operator
OccupiedRegion(OccupiedRegion &&other)=default
standard move constructor
::ad::rss::world::LaneSegmentId segment_id
Definition: OccupiedRegion.hpp:123
::ad::physics::ParametricRange lat_range
Definition: OccupiedRegion.hpp:133
::ad::physics::ParametricRange lon_range
Definition: OccupiedRegion.hpp:128
bool operator==(const OccupiedRegion &other) const
standard comparison operator
Definition: OccupiedRegion.hpp:103
~OccupiedRegion()=default
standard destructor
OccupiedRegion()=default
standard constructor
std::shared_ptr< OccupiedRegion const > ConstPtr
Smart pointer on constant OccupiedRegion.
Definition: OccupiedRegion.hpp:56
std::shared_ptr< OccupiedRegion > Ptr
Smart pointer on OccupiedRegion.
Definition: OccupiedRegion.hpp:51