ad_map_access
Restriction.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>
29 namespace ad {
33 namespace map {
39 namespace restriction {
40 
45 {
49  typedef std::shared_ptr<Restriction> Ptr;
50 
54  typedef std::shared_ptr<Restriction const> ConstPtr;
55 
59  Restriction() = default;
60 
64  ~Restriction() = default;
65 
69  Restriction(const Restriction &other) = default;
70 
74  Restriction(Restriction &&other) = default;
75 
83  Restriction &operator=(const Restriction &other) = default;
84 
92  Restriction &operator=(Restriction &&other) = default;
93 
101  bool operator==(const Restriction &other) const
102  {
103  return (negated == other.negated) && (roadUserTypes == other.roadUserTypes)
104  && (passengersMin == other.passengersMin);
105  }
106 
114  bool operator!=(const Restriction &other) const
115  {
116  return !operator==(other);
117  }
118 
119  bool negated{false};
122 };
123 
124 } // namespace restriction
125 } // namespace map
126 } // namespace ad
127 
131 #ifndef GEN_GUARD_AD_MAP_RESTRICTION_RESTRICTION
132 #define GEN_GUARD_AD_MAP_RESTRICTION_RESTRICTION
133 
136 namespace ad {
140 namespace map {
146 namespace restriction {
147 
157 inline std::ostream &operator<<(std::ostream &os, Restriction const &_value)
158 {
159  os << "Restriction(";
160  os << "negated:";
161  os << _value.negated;
162  os << ",";
163  os << "roadUserTypes:";
164  os << _value.roadUserTypes;
165  os << ",";
166  os << "passengersMin:";
167  os << _value.passengersMin;
168  os << ")";
169  return os;
170 }
171 
172 } // namespace restriction
173 } // namespace map
174 } // namespace ad
175 
176 namespace std {
180 inline std::string to_string(::ad::map::restriction::Restriction const &value)
181 {
182  stringstream sstream;
183  sstream << value;
184  return sstream.str();
185 }
186 } // namespace std
187 #endif // GEN_GUARD_AD_MAP_RESTRICTION_RESTRICTION
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
PassengerCount.hpp
ad::map::restriction::Restriction::operator=
Restriction & operator=(const Restriction &other)=default
standard assignment operator
ad::map::restriction::Restriction
DataType Restriction.
Definition: Restriction.hpp:44
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::Restriction::Restriction
Restriction()=default
standard constructor
ad::map::restriction::PassengerCount
uint16_t PassengerCount
DataType PassengerCount.
Definition: PassengerCount.hpp:39
ad::map::restriction::RoadUserTypeList
std::vector<::ad::map::restriction::RoadUserType > RoadUserTypeList
DataType RoadUserTypeList.
Definition: RoadUserTypeList.hpp:42
ad::map::restriction::Restriction::operator!=
bool operator!=(const Restriction &other) const
standard comparison operator
Definition: Restriction.hpp:114
ad::map::restriction::Restriction::ConstPtr
std::shared_ptr< Restriction const > ConstPtr
Smart pointer on constant Restriction.
Definition: Restriction.hpp:54
RoadUserTypeList.hpp
ad::map::restriction::Restriction::Ptr
std::shared_ptr< Restriction > Ptr
Smart pointer on Restriction.
Definition: Restriction.hpp:49
ad::map::restriction::Restriction::operator==
bool operator==(const Restriction &other) const
standard comparison operator
Definition: Restriction.hpp:101
ad::map::restriction::Restriction::~Restriction
~Restriction()=default
standard destructor
ad::map::restriction::operator<<
std::ostream & operator<<(std::ostream &os, Restriction const &_value)
standard ostream operator
Definition: Restriction.hpp:157