ad_map_access
VehicleDescriptor.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>
26 #include "ad/physics/Distance.hpp"
27 #include "ad/physics/Weight.hpp"
31 namespace ad {
35 namespace map {
41 namespace restriction {
42 
47 {
51  typedef std::shared_ptr<VehicleDescriptor> Ptr;
52 
56  typedef std::shared_ptr<VehicleDescriptor const> ConstPtr;
57 
61  VehicleDescriptor() = default;
62 
66  ~VehicleDescriptor() = default;
67 
71  VehicleDescriptor(const VehicleDescriptor &other) = default;
72 
76  VehicleDescriptor(VehicleDescriptor &&other) = default;
77 
85  VehicleDescriptor &operator=(const VehicleDescriptor &other) = default;
86 
94  VehicleDescriptor &operator=(VehicleDescriptor &&other) = default;
95 
103  bool operator==(const VehicleDescriptor &other) const
104  {
105  return (passengers == other.passengers) && (type == other.type) && (width == other.width)
106  && (height == other.height) && (length == other.length) && (weight == other.weight);
107  }
108 
116  bool operator!=(const VehicleDescriptor &other) const
117  {
118  return !operator==(other);
119  }
120 
123  ::ad::physics::Distance width;
124  ::ad::physics::Distance height;
125  ::ad::physics::Distance length;
126  ::ad::physics::Weight weight;
127 };
128 
129 } // namespace restriction
130 } // namespace map
131 } // namespace ad
132 
136 #ifndef GEN_GUARD_AD_MAP_RESTRICTION_VEHICLEDESCRIPTOR
137 #define GEN_GUARD_AD_MAP_RESTRICTION_VEHICLEDESCRIPTOR
138 
141 namespace ad {
145 namespace map {
151 namespace restriction {
152 
162 inline std::ostream &operator<<(std::ostream &os, VehicleDescriptor const &_value)
163 {
164  os << "VehicleDescriptor(";
165  os << "passengers:";
166  os << _value.passengers;
167  os << ",";
168  os << "type:";
169  os << _value.type;
170  os << ",";
171  os << "width:";
172  os << _value.width;
173  os << ",";
174  os << "height:";
175  os << _value.height;
176  os << ",";
177  os << "length:";
178  os << _value.length;
179  os << ",";
180  os << "weight:";
181  os << _value.weight;
182  os << ")";
183  return os;
184 }
185 
186 } // namespace restriction
187 } // namespace map
188 } // namespace ad
189 
190 namespace std {
194 inline std::string to_string(::ad::map::restriction::VehicleDescriptor const &value)
195 {
196  stringstream sstream;
197  sstream << value;
198  return sstream.str();
199 }
200 } // namespace std
201 #endif // GEN_GUARD_AD_MAP_RESTRICTION_VEHICLEDESCRIPTOR
ad::map::restriction::VehicleDescriptor::Ptr
std::shared_ptr< VehicleDescriptor > Ptr
Smart pointer on VehicleDescriptor.
Definition: VehicleDescriptor.hpp:51
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ad::map::restriction::VehicleDescriptor::~VehicleDescriptor
~VehicleDescriptor()=default
standard destructor
PassengerCount.hpp
ad::map::restriction::VehicleDescriptor::operator!=
bool operator!=(const VehicleDescriptor &other) const
standard comparison operator
Definition: VehicleDescriptor.hpp:116
ad::map::restriction::VehicleDescriptor::operator=
VehicleDescriptor & operator=(const VehicleDescriptor &other)=default
standard assignment operator
ad::map::restriction::VehicleDescriptor::operator==
bool operator==(const VehicleDescriptor &other) const
standard comparison operator
Definition: VehicleDescriptor.hpp:103
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::VehicleDescriptor
DataType VehicleDescriptor.
Definition: VehicleDescriptor.hpp:46
ad::map::restriction::RoadUserType::INVALID
@ INVALID
ad::map::restriction::PassengerCount
uint16_t PassengerCount
DataType PassengerCount.
Definition: PassengerCount.hpp:39
RoadUserType.hpp
ad::map::restriction::VehicleDescriptor::VehicleDescriptor
VehicleDescriptor()=default
standard constructor
ad::map::restriction::VehicleDescriptor::ConstPtr
std::shared_ptr< VehicleDescriptor const > ConstPtr
Smart pointer on constant VehicleDescriptor.
Definition: VehicleDescriptor.hpp:56
ad::map::restriction::RoadUserType
RoadUserType
DataType RoadUserType.
Definition: RoadUserType.hpp:41
ad::map::restriction::operator<<
std::ostream & operator<<(std::ostream &os, Restriction const &_value)
standard ostream operator
Definition: Restriction.hpp:157