ad_map_access
LanePoint.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>
25 #include "ad/physics/Distance.hpp"
26 #include "ad/physics/RatioValue.hpp"
30 namespace ad {
34 namespace map {
40 namespace match {
41 
49 struct LanePoint
50 {
54  typedef std::shared_ptr<LanePoint> Ptr;
55 
59  typedef std::shared_ptr<LanePoint const> ConstPtr;
60 
64  LanePoint() = default;
65 
69  ~LanePoint() = default;
70 
74  LanePoint(const LanePoint &other) = default;
75 
79  LanePoint(LanePoint &&other) = default;
80 
88  LanePoint &operator=(const LanePoint &other) = default;
89 
97  LanePoint &operator=(LanePoint &&other) = default;
98 
106  bool operator==(const LanePoint &other) const
107  {
108  return (paraPoint == other.paraPoint) && (lateralT == other.lateralT) && (laneLength == other.laneLength)
109  && (laneWidth == other.laneWidth);
110  }
111 
119  bool operator!=(const LanePoint &other) const
120  {
121  return !operator==(other);
122  }
123 
124  ::ad::map::point::ParaPoint paraPoint;
125  ::ad::physics::RatioValue lateralT;
126 
130  ::ad::physics::Distance laneLength;
131 
135  ::ad::physics::Distance laneWidth;
136 };
137 
138 } // namespace match
139 } // namespace map
140 } // namespace ad
141 
145 #ifndef GEN_GUARD_AD_MAP_MATCH_LANEPOINT
146 #define GEN_GUARD_AD_MAP_MATCH_LANEPOINT
147 
150 namespace ad {
154 namespace map {
160 namespace match {
161 
171 inline std::ostream &operator<<(std::ostream &os, LanePoint const &_value)
172 {
173  os << "LanePoint(";
174  os << "paraPoint:";
175  os << _value.paraPoint;
176  os << ",";
177  os << "lateralT:";
178  os << _value.lateralT;
179  os << ",";
180  os << "laneLength:";
181  os << _value.laneLength;
182  os << ",";
183  os << "laneWidth:";
184  os << _value.laneWidth;
185  os << ")";
186  return os;
187 }
188 
189 } // namespace match
190 } // namespace map
191 } // namespace ad
192 
193 namespace std {
197 inline std::string to_string(::ad::map::match::LanePoint const &value)
198 {
199  stringstream sstream;
200  sstream << value;
201  return sstream.str();
202 }
203 } // namespace std
204 #endif // GEN_GUARD_AD_MAP_MATCH_LANEPOINT
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ad::map::point::ParaPoint
DataType ParaPoint.
Definition: ParaPoint.hpp:48
ad::map::match::LanePoint::operator==
bool operator==(const LanePoint &other) const
standard comparison operator
Definition: LanePoint.hpp:106
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::match::LanePoint::operator=
LanePoint & operator=(const LanePoint &other)=default
standard assignment operator
ad::map::match::LanePoint::LanePoint
LanePoint()=default
standard constructor
ad::map::match::LanePoint::operator!=
bool operator!=(const LanePoint &other) const
standard comparison operator
Definition: LanePoint.hpp:119
ad::map::match::LanePoint
DataType LanePoint.
Definition: LanePoint.hpp:49
ad::map::match::LanePoint::ConstPtr
std::shared_ptr< LanePoint const > ConstPtr
Smart pointer on constant LanePoint.
Definition: LanePoint.hpp:59
ad::map::match::LanePoint::laneWidth
::ad::physics::Distance laneWidth
Definition: LanePoint.hpp:135
ad::map::match::LanePoint::~LanePoint
~LanePoint()=default
standard destructor
ad::map::match::operator<<
std::ostream & operator<<(std::ostream &os, ENUObjectPosition const &_value)
standard ostream operator
Definition: ENUObjectPosition.hpp:175
ParaPoint.hpp
ad::map::match::LanePoint::Ptr
std::shared_ptr< LanePoint > Ptr
Smart pointer on LanePoint.
Definition: LanePoint.hpp:54
ad::map::match::LanePoint::laneLength
::ad::physics::Distance laneLength
Definition: LanePoint.hpp:130