Branch data Line data Source code
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 : : 11 : : /** 12 : : * Generated file 13 : : * @file 14 : : * 15 : : * Generator Version : 11.0.0-1997 16 : : */ 17 : : 18 : : #pragma once 19 : : 20 : : #include <iostream> 21 : : #include <limits> 22 : : #include <memory> 23 : : #include <sstream> 24 : : #include "ad/map/restriction/PassengerCount.hpp" 25 : : #include "ad/map/restriction/RoadUserTypeList.hpp" 26 : : /*! 27 : : * @brief namespace ad 28 : : */ 29 : : namespace ad { 30 : : /*! 31 : : * @brief namespace map 32 : : */ 33 : : namespace map { 34 : : /*! 35 : : * @brief namespace restriction 36 : : * 37 : : * Handling of traffic restrictions 38 : : */ 39 : : namespace restriction { 40 : : 41 : : /*! 42 : : * \brief DataType Restriction 43 : : */ 44 : 11 : struct Restriction 45 : : { 46 : : /*! 47 : : * \brief Smart pointer on Restriction 48 : : */ 49 : : typedef std::shared_ptr<Restriction> Ptr; 50 : : 51 : : /*! 52 : : * \brief Smart pointer on constant Restriction 53 : : */ 54 : : typedef std::shared_ptr<Restriction const> ConstPtr; 55 : : 56 : : /*! 57 : : * \brief standard constructor 58 : : */ 59 : 171561 : Restriction() = default; 60 : : 61 : : /*! 62 : : * \brief standard destructor 63 : : */ 64 : 1745917 : ~Restriction() = default; 65 : : 66 : : /*! 67 : : * \brief standard copy constructor 68 : : */ 69 : 1574358 : Restriction(const Restriction &other) = default; 70 : : 71 : : /*! 72 : : * \brief standard move constructor 73 : : */ 74 : 2 : Restriction(Restriction &&other) = default; 75 : : 76 : : /** 77 : : * \brief standard assignment operator 78 : : * 79 : : * \param[in] other Other Restriction 80 : : * 81 : : * \returns Reference to this Restriction. 82 : : */ 83 : : Restriction &operator=(const Restriction &other) = default; 84 : : 85 : : /** 86 : : * \brief standard move operator 87 : : * 88 : : * \param[in] other Other Restriction 89 : : * 90 : : * \returns Reference to this Restriction. 91 : : */ 92 : : Restriction &operator=(Restriction &&other) = default; 93 : : 94 : : /** 95 : : * \brief standard comparison operator 96 : : * 97 : : * \param[in] other Other Restriction 98 : : * 99 : : * \returns \c true if both Restriction are equal 100 : : */ 101 : 134 : bool operator==(const Restriction &other) const 102 : : { 103 [ + + ]: 132 : return (negated == other.negated) && (roadUserTypes == other.roadUserTypes) 104 [ + + + + ]: 266 : && (passengersMin == other.passengersMin); 105 : : } 106 : : 107 : : /** 108 : : * \brief standard comparison operator 109 : : * 110 : : * \param[in] other Other Restriction. 111 : : * 112 : : * \returns \c true if both Restriction are different 113 : : */ 114 : 4 : bool operator!=(const Restriction &other) const 115 : : { 116 : 4 : return !operator==(other); 117 : : } 118 : : 119 : : bool negated{false}; 120 : : ::ad::map::restriction::RoadUserTypeList roadUserTypes; 121 : : ::ad::map::restriction::PassengerCount passengersMin{0}; 122 : : }; 123 : : 124 : : } // namespace restriction 125 : : } // namespace map 126 : : } // namespace ad 127 : : 128 : : /*! 129 : : * \brief protect the definition of functions from duplicates by typedef usage within other data types 130 : : */ 131 : : #ifndef GEN_GUARD_AD_MAP_RESTRICTION_RESTRICTION 132 : : #define GEN_GUARD_AD_MAP_RESTRICTION_RESTRICTION 133 : : /*! 134 : : * @brief namespace ad 135 : : */ 136 : : namespace ad { 137 : : /*! 138 : : * @brief namespace map 139 : : */ 140 : : namespace map { 141 : : /*! 142 : : * @brief namespace restriction 143 : : * 144 : : * Handling of traffic restrictions 145 : : */ 146 : : namespace restriction { 147 : : 148 : : /** 149 : : * \brief standard ostream operator 150 : : * 151 : : * \param[in] os The output stream to write to 152 : : * \param[in] _value Restriction value 153 : : * 154 : : * \returns The stream object. 155 : : * 156 : : */ 157 : 94 : inline std::ostream &operator<<(std::ostream &os, Restriction const &_value) 158 : : { 159 : 94 : os << "Restriction("; 160 : 94 : os << "negated:"; 161 : 94 : os << _value.negated; 162 : 94 : os << ","; 163 : 94 : os << "roadUserTypes:"; 164 : 94 : os << _value.roadUserTypes; 165 : 94 : os << ","; 166 : 94 : os << "passengersMin:"; 167 : 94 : os << _value.passengersMin; 168 : 94 : os << ")"; 169 : 94 : return os; 170 : : } 171 : : 172 : : } // namespace restriction 173 : : } // namespace map 174 : : } // namespace ad 175 : : 176 : : namespace std { 177 : : /*! 178 : : * \brief overload of the std::to_string for Restriction 179 : : */ 180 : 1 : inline std::string to_string(::ad::map::restriction::Restriction const &value) 181 : : { 182 [ + - ]: 2 : stringstream sstream; 183 [ + - ]: 1 : sstream << value; 184 [ + - ]: 2 : return sstream.str(); 185 : : } 186 : : } // namespace std 187 : : #endif // GEN_GUARD_AD_MAP_RESTRICTION_RESTRICTION