ad_map_access
Lane.hpp
Go to the documentation of this file.
1 /*
2  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3  *
4  * Copyright (C) 2018-2020 Intel Corporation
5  *
6  * SPDX-License-Identifier: MIT
7  *
8  * ----------------- END LICENSE BLOCK -----------------------------------
9  */
10 
18 #pragma once
19 
20 #include <iostream>
21 #include <limits>
22 #include <memory>
23 #include <sstream>
28 #include "ad/map/lane/LaneId.hpp"
29 #include "ad/map/lane/LaneType.hpp"
34 #include "ad/physics/Distance.hpp"
35 #include "ad/physics/MetricRange.hpp"
39 namespace ad {
43 namespace map {
49 namespace lane {
50 
56 struct Lane
57 {
61  typedef std::shared_ptr<Lane> Ptr;
62 
66  typedef std::shared_ptr<Lane const> ConstPtr;
67 
71  Lane() = default;
72 
76  ~Lane() = default;
77 
81  Lane(const Lane &other) = default;
82 
86  Lane(Lane &&other) = default;
87 
95  Lane &operator=(const Lane &other) = default;
96 
104  Lane &operator=(Lane &&other) = default;
105 
113  bool operator==(const Lane &other) const
114  {
115  return (id == other.id) && (type == other.type) && (direction == other.direction)
116  && (restrictions == other.restrictions) && (length == other.length) && (lengthRange == other.lengthRange)
117  && (width == other.width) && (widthRange == other.widthRange) && (speedLimits == other.speedLimits)
118  && (edgeLeft == other.edgeLeft) && (edgeRight == other.edgeRight) && (contactLanes == other.contactLanes)
119  && (complianceVersion == other.complianceVersion) && (boundingSphere == other.boundingSphere)
120  && (visibleLandmarks == other.visibleLandmarks);
121  }
122 
130  bool operator!=(const Lane &other) const
131  {
132  return !operator==(other);
133  }
134 
139 
144 
149 
154 
158  ::ad::physics::Distance length;
159  ::ad::physics::MetricRange lengthRange;
160 
164  ::ad::physics::Distance width;
165  ::ad::physics::MetricRange widthRange;
166 
171 
176 
181 
186  ::ad::map::lane::ComplianceVersion complianceVersion;
187  ::ad::map::point::BoundingSphere boundingSphere;
188 
193 };
194 
195 } // namespace lane
196 } // namespace map
197 } // namespace ad
198 
202 #ifndef GEN_GUARD_AD_MAP_LANE_LANE
203 #define GEN_GUARD_AD_MAP_LANE_LANE
204 
207 namespace ad {
211 namespace map {
217 namespace lane {
218 
228 inline std::ostream &operator<<(std::ostream &os, Lane const &_value)
229 {
230  os << "Lane(";
231  os << "id:";
232  os << _value.id;
233  os << ",";
234  os << "type:";
235  os << _value.type;
236  os << ",";
237  os << "direction:";
238  os << _value.direction;
239  os << ",";
240  os << "restrictions:";
241  os << _value.restrictions;
242  os << ",";
243  os << "length:";
244  os << _value.length;
245  os << ",";
246  os << "lengthRange:";
247  os << _value.lengthRange;
248  os << ",";
249  os << "width:";
250  os << _value.width;
251  os << ",";
252  os << "widthRange:";
253  os << _value.widthRange;
254  os << ",";
255  os << "speedLimits:";
256  os << _value.speedLimits;
257  os << ",";
258  os << "edgeLeft:";
259  os << _value.edgeLeft;
260  os << ",";
261  os << "edgeRight:";
262  os << _value.edgeRight;
263  os << ",";
264  os << "contactLanes:";
265  os << _value.contactLanes;
266  os << ",";
267  os << "complianceVersion:";
268  os << _value.complianceVersion;
269  os << ",";
270  os << "boundingSphere:";
271  os << _value.boundingSphere;
272  os << ",";
273  os << "visibleLandmarks:";
274  os << _value.visibleLandmarks;
275  os << ")";
276  return os;
277 }
278 
279 } // namespace lane
280 } // namespace map
281 } // namespace ad
282 
283 namespace std {
287 inline std::string to_string(::ad::map::lane::Lane const &value)
288 {
289  stringstream sstream;
290  sstream << value;
291  return sstream.str();
292 }
293 } // namespace std
294 #endif // GEN_GUARD_AD_MAP_LANE_LANE
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
LaneDirection.hpp
ad::map::lane::Lane::contactLanes
::ad::map::lane::ContactLaneList contactLanes
Definition: Lane.hpp:185
ad::map::restriction::Restrictions
DataType Restrictions.
Definition: Restrictions.hpp:42
ad::map::lane::ContactLaneList
std::vector<::ad::map::lane::ContactLane > ContactLaneList
DataType ContactLaneList.
Definition: ContactLaneList.hpp:42
ad::map::lane::Lane::id
::ad::map::lane::LaneId id
Definition: Lane.hpp:138
ad::map::lane::Lane::Lane
Lane()=default
standard constructor
Restrictions.hpp
ad::map::lane::Lane::operator!=
bool operator!=(const Lane &other) const
standard comparison operator
Definition: Lane.hpp:130
ad::map::lane::Lane::type
::ad::map::lane::LaneType type
Definition: Lane.hpp:143
ad::map::lane::Lane::length
::ad::physics::Distance length
Definition: Lane.hpp:158
ad::map::lane::Lane::Ptr
std::shared_ptr< Lane > Ptr
Smart pointer on Lane.
Definition: Lane.hpp:61
ad::map::lane::Lane::operator=
Lane & operator=(const Lane &other)=default
standard assignment operator
std::to_string
std::string to_string(::ad::map::access::GeometryStoreItem const &value)
overload of the std::to_string for GeometryStoreItem
Definition: GeometryStoreItem.hpp:183
ad::map::lane::Lane::edgeRight
::ad::map::point::Geometry edgeRight
Definition: Lane.hpp:180
ad::map::landmark::LandmarkIdList
std::vector<::ad::map::landmark::LandmarkId > LandmarkIdList
DataType LandmarkIdList.
Definition: LandmarkIdList.hpp:44
ad::map::lane::LaneId
DataType LaneId.
Definition: LaneId.hpp:66
LaneId.hpp
ad::map::lane::ComplianceVersion
uint64_t ComplianceVersion
DataType ComplianceVersion.
Definition: ComplianceVersion.hpp:41
LaneType.hpp
Geometry.hpp
ad::map::point::BoundingSphere
DataType BoundingSphere.
Definition: BoundingSphere.hpp:46
ad::map::lane::Lane::visibleLandmarks
::ad::map::landmark::LandmarkIdList visibleLandmarks
Definition: Lane.hpp:192
ad::map::lane::Lane::restrictions
::ad::map::restriction::Restrictions restrictions
Definition: Lane.hpp:153
LandmarkIdList.hpp
ad::map::lane::Lane::operator==
bool operator==(const Lane &other) const
standard comparison operator
Definition: Lane.hpp:113
ad::map::lane::operator<<
std::ostream & operator<<(std::ostream &os, ContactLane const &_value)
standard ostream operator
Definition: ContactLane.hpp:182
BoundingSphere.hpp
ad::map::lane::LaneDirection::INVALID
@ INVALID
ad::map::point::Geometry
DataType Geometry.
Definition: Geometry.hpp:45
ad::map::lane::Lane::edgeLeft
::ad::map::point::Geometry edgeLeft
Definition: Lane.hpp:175
ad::map::restriction::SpeedLimitList
std::vector<::ad::map::restriction::SpeedLimit > SpeedLimitList
DataType SpeedLimitList.
Definition: SpeedLimitList.hpp:42
ad::map::lane::Lane::~Lane
~Lane()=default
standard destructor
ad::map::lane::LaneType
LaneType
DataType LaneType.
Definition: LaneType.hpp:43
ad::map::lane::Lane::direction
::ad::map::lane::LaneDirection direction
Definition: Lane.hpp:148
ad::map::lane::Lane::speedLimits
::ad::map::restriction::SpeedLimitList speedLimits
Definition: Lane.hpp:170
ContactLaneList.hpp
ad::map::lane::Lane::width
::ad::physics::Distance width
Definition: Lane.hpp:164
ad::map::lane::LaneDirection
LaneDirection
DataType LaneDirection.
Definition: LaneDirection.hpp:43
ad::map::lane::Lane::ConstPtr
std::shared_ptr< Lane const > ConstPtr
Smart pointer on constant Lane.
Definition: Lane.hpp:66
ad::map::lane::Lane
DataType Lane.
Definition: Lane.hpp:56
SpeedLimitList.hpp
ComplianceVersion.hpp