ad_map_access
SpeedLimit.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>
24 #include "ad/physics/ParametricRange.hpp"
25 #include "ad/physics/Speed.hpp"
29 namespace ad {
33 namespace map {
39 namespace restriction {
40 
44 struct SpeedLimit
45 {
49  typedef std::shared_ptr<SpeedLimit> Ptr;
50 
54  typedef std::shared_ptr<SpeedLimit const> ConstPtr;
55 
59  SpeedLimit() = default;
60 
64  ~SpeedLimit() = default;
65 
69  SpeedLimit(const SpeedLimit &other) = default;
70 
74  SpeedLimit(SpeedLimit &&other) = default;
75 
83  SpeedLimit &operator=(const SpeedLimit &other) = default;
84 
92  SpeedLimit &operator=(SpeedLimit &&other) = default;
93 
101  bool operator==(const SpeedLimit &other) const
102  {
103  return (speedLimit == other.speedLimit) && (lanePiece == other.lanePiece);
104  }
105 
113  bool operator!=(const SpeedLimit &other) const
114  {
115  return !operator==(other);
116  }
117 
118  ::ad::physics::Speed speedLimit;
119  ::ad::physics::ParametricRange lanePiece;
120 };
121 
122 } // namespace restriction
123 } // namespace map
124 } // namespace ad
125 
129 #ifndef GEN_GUARD_AD_MAP_RESTRICTION_SPEEDLIMIT
130 #define GEN_GUARD_AD_MAP_RESTRICTION_SPEEDLIMIT
131 
134 namespace ad {
138 namespace map {
144 namespace restriction {
145 
155 inline std::ostream &operator<<(std::ostream &os, SpeedLimit const &_value)
156 {
157  os << "SpeedLimit(";
158  os << "speedLimit:";
159  os << _value.speedLimit;
160  os << ",";
161  os << "lanePiece:";
162  os << _value.lanePiece;
163  os << ")";
164  return os;
165 }
166 
167 } // namespace restriction
168 } // namespace map
169 } // namespace ad
170 
171 namespace std {
175 inline std::string to_string(::ad::map::restriction::SpeedLimit const &value)
176 {
177  stringstream sstream;
178  sstream << value;
179  return sstream.str();
180 }
181 } // namespace std
182 #endif // GEN_GUARD_AD_MAP_RESTRICTION_SPEEDLIMIT
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ad::map::restriction::SpeedLimit::operator=
SpeedLimit & operator=(const SpeedLimit &other)=default
standard assignment operator
ad::map::restriction::SpeedLimit::Ptr
std::shared_ptr< SpeedLimit > Ptr
Smart pointer on SpeedLimit.
Definition: SpeedLimit.hpp:49
ad::map::restriction::SpeedLimit::operator!=
bool operator!=(const SpeedLimit &other) const
standard comparison operator
Definition: SpeedLimit.hpp:113
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::restriction::SpeedLimit
DataType SpeedLimit.
Definition: SpeedLimit.hpp:44
ad::map::restriction::SpeedLimit::SpeedLimit
SpeedLimit()=default
standard constructor
ad::map::restriction::SpeedLimit::operator==
bool operator==(const SpeedLimit &other) const
standard comparison operator
Definition: SpeedLimit.hpp:101
ad::map::restriction::SpeedLimit::~SpeedLimit
~SpeedLimit()=default
standard destructor
ad::map::restriction::SpeedLimit::ConstPtr
std::shared_ptr< SpeedLimit const > ConstPtr
Smart pointer on constant SpeedLimit.
Definition: SpeedLimit.hpp:54
ad::map::restriction::operator<<
std::ostream & operator<<(std::ostream &os, Restriction const &_value)
standard ostream operator
Definition: Restriction.hpp:157