ad_map_access
RoadSegment.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>
30 namespace ad {
34 namespace map {
40 namespace route {
41 
62 {
66  typedef std::shared_ptr<RoadSegment> Ptr;
67 
71  typedef std::shared_ptr<RoadSegment const> ConstPtr;
72 
76  RoadSegment() = default;
77 
81  ~RoadSegment() = default;
82 
86  RoadSegment(const RoadSegment &other) = default;
87 
91  RoadSegment(RoadSegment &&other) = default;
92 
100  RoadSegment &operator=(const RoadSegment &other) = default;
101 
109  RoadSegment &operator=(RoadSegment &&other) = default;
110 
118  bool operator==(const RoadSegment &other) const
119  {
120  return (drivableLaneSegments == other.drivableLaneSegments)
121  && (segmentCountFromDestination == other.segmentCountFromDestination) && (boundingSphere == other.boundingSphere);
122  }
123 
131  bool operator!=(const RoadSegment &other) const
132  {
133  return !operator==(other);
134  }
135 
136  ::ad::map::route::LaneSegmentList drivableLaneSegments;
137  ::ad::map::route::SegmentCounter segmentCountFromDestination{0};
138 
143 };
144 
145 } // namespace route
146 } // namespace map
147 } // namespace ad
148 
152 #ifndef GEN_GUARD_AD_MAP_ROUTE_ROADSEGMENT
153 #define GEN_GUARD_AD_MAP_ROUTE_ROADSEGMENT
154 
157 namespace ad {
161 namespace map {
167 namespace route {
168 
178 inline std::ostream &operator<<(std::ostream &os, RoadSegment const &_value)
179 {
180  os << "RoadSegment(";
181  os << "drivableLaneSegments:";
182  os << _value.drivableLaneSegments;
183  os << ",";
184  os << "segmentCountFromDestination:";
185  os << _value.segmentCountFromDestination;
186  os << ",";
187  os << "boundingSphere:";
188  os << _value.boundingSphere;
189  os << ")";
190  return os;
191 }
192 
193 } // namespace route
194 } // namespace map
195 } // namespace ad
196 
197 namespace std {
201 inline std::string to_string(::ad::map::route::RoadSegment const &value)
202 {
203  stringstream sstream;
204  sstream << value;
205  return sstream.str();
206 }
207 } // namespace std
208 #endif // GEN_GUARD_AD_MAP_ROUTE_ROADSEGMENT
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ad::map::route::RoadSegment::Ptr
std::shared_ptr< RoadSegment > Ptr
Smart pointer on RoadSegment.
Definition: RoadSegment.hpp:66
SegmentCounter.hpp
ad::map::route::SegmentCounter
uint64_t SegmentCounter
DataType SegmentCounter.
Definition: SegmentCounter.hpp:41
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
LaneSegmentList.hpp
ad::map::route::RoadSegment::boundingSphere
::ad::map::point::BoundingSphere boundingSphere
Definition: RoadSegment.hpp:142
ad::map::route::RoadSegment::operator!=
bool operator!=(const RoadSegment &other) const
standard comparison operator
Definition: RoadSegment.hpp:131
ad::map::route::RoadSegment::operator==
bool operator==(const RoadSegment &other) const
standard comparison operator
Definition: RoadSegment.hpp:118
ad::map::route::RoadSegment
DataType RoadSegment.
Definition: RoadSegment.hpp:61
ad::map::point::BoundingSphere
DataType BoundingSphere.
Definition: BoundingSphere.hpp:46
ad::map::route::operator<<
std::ostream & operator<<(std::ostream &os, ConnectingRoute const &_value)
standard ostream operator
Definition: ConnectingRoute.hpp:193
ad::map::route::RoadSegment::ConstPtr
std::shared_ptr< RoadSegment const > ConstPtr
Smart pointer on constant RoadSegment.
Definition: RoadSegment.hpp:71
BoundingSphere.hpp
ad::map::route::LaneSegmentList
std::vector<::ad::map::route::LaneSegment > LaneSegmentList
DataType LaneSegmentList.
Definition: LaneSegmentList.hpp:44
ad::map::route::RoadSegment::operator=
RoadSegment & operator=(const RoadSegment &other)=default
standard assignment operator
ad::map::route::RoadSegment::~RoadSegment
~RoadSegment()=default
standard destructor
ad::map::route::RoadSegment::RoadSegment
RoadSegment()=default
standard constructor