ad_rss
LaneSegment.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: 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/MetricRange.hpp"
31 namespace ad {
35 namespace rss {
39 namespace world {
40 
47 {
51  typedef std::shared_ptr<LaneSegment> Ptr;
52 
56  typedef std::shared_ptr<LaneSegment const> ConstPtr;
57 
61  LaneSegment() = default;
62 
66  ~LaneSegment() = default;
67 
71  LaneSegment(const LaneSegment &other) = default;
72 
76  LaneSegment(LaneSegment &&other) = default;
77 
85  LaneSegment &operator=(const LaneSegment &other) = default;
86 
94  LaneSegment &operator=(LaneSegment &&other) = default;
95 
103  bool operator==(const LaneSegment &other) const
104  {
105  return (id == other.id) && (type == other.type) && (drivingDirection == other.drivingDirection)
106  && (length == other.length) && (width == other.width);
107  }
108 
116  bool operator!=(const LaneSegment &other) const
117  {
118  return !operator==(other);
119  }
120 
125 
129  ::ad::rss::world::LaneSegmentType type{::ad::rss::world::LaneSegmentType::Normal};
130 
134  ::ad::rss::world::LaneDrivingDirection drivingDirection{::ad::rss::world::LaneDrivingDirection::Bidirectional};
135 
139  ::ad::physics::MetricRange length;
140 
144  ::ad::physics::MetricRange width;
145 };
146 
147 } // namespace world
148 } // namespace rss
149 } // namespace ad
150 
154 #ifndef GEN_GUARD_AD_RSS_WORLD_LANESEGMENT
155 #define GEN_GUARD_AD_RSS_WORLD_LANESEGMENT
156 
159 namespace ad {
163 namespace rss {
167 namespace world {
168 
178 inline std::ostream &operator<<(std::ostream &os, LaneSegment const &_value)
179 {
180  os << "LaneSegment(";
181  os << "id:";
182  os << _value.id;
183  os << ",";
184  os << "type:";
185  os << _value.type;
186  os << ",";
187  os << "drivingDirection:";
188  os << _value.drivingDirection;
189  os << ",";
190  os << "length:";
191  os << _value.length;
192  os << ",";
193  os << "width:";
194  os << _value.width;
195  os << ")";
196  return os;
197 }
198 
199 } // namespace world
200 } // namespace rss
201 } // namespace ad
202 
203 namespace std {
207 inline std::string to_string(::ad::rss::world::LaneSegment const &value)
208 {
209  stringstream sstream;
210  sstream << value;
211  return sstream.str();
212 }
213 } // namespace std
214 #endif // GEN_GUARD_AD_RSS_WORLD_LANESEGMENT
ad
namespace ad
Definition: LateralRelativePosition.hpp:26
ad::rss::world::LaneSegment::operator==
bool operator==(const LaneSegment &other) const
standard comparison operator
Definition: LaneSegment.hpp:103
ad::rss::world::LaneSegment::operator!=
bool operator!=(const LaneSegment &other) const
standard comparison operator
Definition: LaneSegment.hpp:116
ad::rss::world::LaneSegment::~LaneSegment
~LaneSegment()=default
standard destructor
ad::rss::world::LaneSegment::ConstPtr
std::shared_ptr< LaneSegment const > ConstPtr
Smart pointer on constant LaneSegment.
Definition: LaneSegment.hpp:56
ad::rss::world::LaneSegment::id
::ad::rss::world::LaneSegmentId id
Definition: LaneSegment.hpp:124
LaneDrivingDirection.hpp
std::to_string
std::string to_string(::ad::rss::situation::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:160
ad::rss::world::operator<<
std::ostream & operator<<(std::ostream &os, LaneDrivingDirection const &value)
standard ostream operator
Definition: LaneDrivingDirection.hpp:132
ad::rss::world::LaneSegmentId
uint64_t LaneSegmentId
DataType LaneSegmentId.
Definition: LaneSegmentId.hpp:39
ad::rss::world::LaneDrivingDirection
LaneDrivingDirection
DataType LaneDrivingDirection.
Definition: LaneDrivingDirection.hpp:39
ad::rss::world::LaneSegment::length
::ad::physics::MetricRange length
Definition: LaneSegment.hpp:139
ad::rss::world::LaneSegment
DataType LaneSegment.
Definition: LaneSegment.hpp:46
ad::rss::world::LaneSegment::LaneSegment
LaneSegment()=default
standard constructor
LaneSegmentId.hpp
ad::rss::world::LaneSegmentType
LaneSegmentType
DataType LaneSegmentType.
Definition: LaneSegmentType.hpp:39
ad::rss::world::LaneSegment::width
::ad::physics::MetricRange width
Definition: LaneSegment.hpp:144
ad::rss::world::LaneSegment::drivingDirection
::ad::rss::world::LaneDrivingDirection drivingDirection
Definition: LaneSegment.hpp:134
ad::rss::world::LaneSegment::type
::ad::rss::world::LaneSegmentType type
Definition: LaneSegment.hpp:129
ad::rss::world::LaneSegment::operator=
LaneSegment & operator=(const LaneSegment &other)=default
standard assignment operator
ad::rss::world::LaneSegment::Ptr
std::shared_ptr< LaneSegment > Ptr
Smart pointer on LaneSegment.
Definition: LaneSegment.hpp:51
LaneSegmentType.hpp