ad_map_access
TrafficSignTypeValidInputRange.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 <cmath>
21 #include <limits>
23 #include "spdlog/fmt/ostr.h"
24 #include "spdlog/spdlog.h"
25 
36 inline bool withinValidInputRange(::ad::map::landmark::TrafficSignType const &input, bool const logErrors = true)
37 {
38  bool inValidInputRange = (input == ::ad::map::landmark::TrafficSignType::INVALID)
40  || (input == ::ad::map::landmark::TrafficSignType::SUPPLEMENT_ARROW_APPLIES_RIGHT)
42  || (input == ::ad::map::landmark::TrafficSignType::SUPPLEMENT_ARROW_APPLIES_UP_DOWN)
44  || (input == ::ad::map::landmark::TrafficSignType::SUPPLEMENT_ARROW_APPLIES_UP_DOWN_BICYCLE)
46  || (input == ::ad::map::landmark::TrafficSignType::SUPPLEMENT_ENDS)
48  || (input == ::ad::map::landmark::TrafficSignType::SUPPLEMENT_BICYCLE_ALLOWED)
50  || (input == ::ad::map::landmark::TrafficSignType::SUPPLEMENT_TRAM_ALLOWED)
52  || (input == ::ad::map::landmark::TrafficSignType::SUPPLEMENT_CONSTRUCTION_VEHICLE_ALLOWED)
54  || (input == ::ad::map::landmark::TrafficSignType::SUPPLEMENT_RAILWAY_ONLY)
56  || (input == ::ad::map::landmark::TrafficSignType::DANGER)
58  || (input == ::ad::map::landmark::TrafficSignType::CAUTION_PEDESTRIAN)
60  || (input == ::ad::map::landmark::TrafficSignType::CAUTION_BICYCLE)
62  || (input == ::ad::map::landmark::TrafficSignType::CAUTION_RAIL_CROSSING_WITH_BARRIER)
64  || (input == ::ad::map::landmark::TrafficSignType::YIELD_TRAIN)
65  || (input == ::ad::map::landmark::TrafficSignType::YIELD) || (input == ::ad::map::landmark::TrafficSignType::STOP)
67  || (input == ::ad::map::landmark::TrafficSignType::REQUIRED_LEFT_TURN)
69  || (input == ::ad::map::landmark::TrafficSignType::REQUIRED_STRAIGHT_OR_RIGHT_TURN)
71  || (input == ::ad::map::landmark::TrafficSignType::ROUNDABOUT)
73  || (input == ::ad::map::landmark::TrafficSignType::PASS_LEFT)
75  || (input == ::ad::map::landmark::TrafficSignType::FOOTWALK)
77  || (input == ::ad::map::landmark::TrafficSignType::FOOTWALK_BICYCLE_SEP_RIGHT)
79  || (input == ::ad::map::landmark::TrafficSignType::PEDESTRIAN_AREA_BEGIN)
81  || (input == ::ad::map::landmark::TrafficSignType::ACCESS_FORBIDDEN_TRUCKS)
83  || (input == ::ad::map::landmark::TrafficSignType::ACCESS_FORBIDDEN_MOTORVEHICLES)
85  || (input == ::ad::map::landmark::TrafficSignType::ACCESS_FORBIDDEN_WIDTH)
87  || (input == ::ad::map::landmark::TrafficSignType::ACCESS_FORBIDDEN_WRONG_DIR)
89  || (input == ::ad::map::landmark::TrafficSignType::ENVIORNMENT_ZONE_END)
91  || (input == ::ad::map::landmark::TrafficSignType::SPEED_ZONE_30_BEGIN)
93  || (input == ::ad::map::landmark::TrafficSignType::HAS_WAY_NEXT_INTERSECTION)
95  || (input == ::ad::map::landmark::TrafficSignType::CITY_BEGIN)
97  || (input == ::ad::map::landmark::TrafficSignType::MOTORWAY_BEGIN)
99  || (input == ::ad::map::landmark::TrafficSignType::MOTORVEHICLE_BEGIN)
101  || (input == ::ad::map::landmark::TrafficSignType::INFO_MOTORWAY_INFO)
103  || (input == ::ad::map::landmark::TrafficSignType::CUL_DE_SAC_EXCEPT_PED_BICYCLE)
105  || (input == ::ad::map::landmark::TrafficSignType::DIRECTION_TURN_TO_AUTOBAHN)
107  || (input == ::ad::map::landmark::TrafficSignType::DESTINATION_BOARD)
109  || (input == ::ad::map::landmark::TrafficSignType::UNKNOWN);
110  if (!inValidInputRange && logErrors)
111  {
112  spdlog::error("withinValidInputRange(::ad::map::landmark::TrafficSignType)>> {}, raw value: {} ",
113  input,
114  static_cast<int32_t>(input)); // LCOV_EXCL_BR_LINE
115  }
116  return inValidInputRange;
117 }
ad::map::landmark::TrafficSignType::SUPPLEMENT_APPLIES_NEXT_N_KM_TIME
@ SUPPLEMENT_APPLIES_NEXT_N_KM_TIME
ad::map::landmark::TrafficSignType::CAUTION_CHILDREN
@ CAUTION_CHILDREN
ad::map::landmark::TrafficSignType::ACCESS_FORBIDDEN_WEIGHT
@ ACCESS_FORBIDDEN_WEIGHT
ad::map::landmark::TrafficSignType::FOOTWALK_BICYCLE_SEP_LEFT
@ FOOTWALK_BICYCLE_SEP_LEFT
ad::map::landmark::TrafficSignType::SUPPLEMENT_ARROW_APPLIES_LEFT
@ SUPPLEMENT_ARROW_APPLIES_LEFT
ad::map::landmark::TrafficSignType::BYBICLE_PATH
@ BYBICLE_PATH
ad::map::landmark::TrafficSignType::SUPPLEMENT_APPLIES_FOR_WEIGHT
@ SUPPLEMENT_APPLIES_FOR_WEIGHT
withinValidInputRange
bool withinValidInputRange(::ad::map::landmark::TrafficSignType const &input, bool const logErrors=true)
check if the given TrafficSignType is within valid input range
Definition: TrafficSignTypeValidInputRange.hpp:36
ad::map::landmark::TrafficSignType::FREE_TEXT
@ FREE_TEXT
ad::map::landmark::TrafficSignType::ACCESS_FORBIDDEN_BICYCLE
@ ACCESS_FORBIDDEN_BICYCLE
TrafficSignType.hpp
ad::map::landmark::TrafficSignType::CITY_END
@ CITY_END
ad::map::landmark::TrafficSignType::CUL_DE_SAC
@ CUL_DE_SAC
ad::map::landmark::TrafficSignType
TrafficSignType
DataType TrafficSignType.
Definition: TrafficSignType.hpp:43
ad::map::landmark::TrafficSignType::MOTORWAY_END
@ MOTORWAY_END
ad::map::landmark::TrafficSignType::SPEED_ZONE_30_END
@ SPEED_ZONE_30_END
ad::map::landmark::TrafficSignType::SUPPLEMENT_MOPED_ALLOWED
@ SUPPLEMENT_MOPED_ALLOWED
ad::map::landmark::TrafficSignType::YIELD
@ YIELD
ad::map::landmark::TrafficSignType::REQUIRED_STRAIGHT_OR_LEFT_TURN
@ REQUIRED_STRAIGHT_OR_LEFT_TURN
ad::map::landmark::TrafficSignType::SUPPLEMENT_ARROW_APPLIES_LEFT_RIGHT_BICYCLE
@ SUPPLEMENT_ARROW_APPLIES_LEFT_RIGHT_BICYCLE
ad::map::landmark::TrafficSignType::MOTORVEHICLE_END
@ MOTORVEHICLE_END
ad::map::landmark::TrafficSignType::CAUTION_RAIL_CROSSING
@ CAUTION_RAIL_CROSSING
ad::map::landmark::TrafficSignType::SUPPLEMENT_ENVIRONMENT_ZONE_YELLOW_GREEN
@ SUPPLEMENT_ENVIRONMENT_ZONE_YELLOW_GREEN
ad::map::landmark::TrafficSignType::MAX_SPEED
@ MAX_SPEED
ad::map::landmark::TrafficSignType::INFO_NUMBER_OF_AUTOBAHN
@ INFO_NUMBER_OF_AUTOBAHN
ad::map::landmark::TrafficSignType::ENVIORNMENT_ZONE_BEGIN
@ ENVIORNMENT_ZONE_BEGIN
ad::map::landmark::TrafficSignType::DIRECTION_TURN_TO_LOCAL
@ DIRECTION_TURN_TO_LOCAL
ad::map::landmark::TrafficSignType::SUPPLEMENT_FORESTAL_ALLOWED
@ SUPPLEMENT_FORESTAL_ALLOWED
ad::map::landmark::TrafficSignType::REQUIRED_RIGHT_TURN
@ REQUIRED_RIGHT_TURN
ad::map::landmark::TrafficSignType::FOOTWALK_BICYCLE_SHARED
@ FOOTWALK_BICYCLE_SHARED
ad::map::landmark::TrafficSignType::ACCESS_FORBIDDEN
@ ACCESS_FORBIDDEN
ad::map::landmark::TrafficSignType::INVALID
@ INVALID
ad::map::landmark::TrafficSignType::SUPPLEMENT_ARROW_APPLIES_LEFT_RIGHT
@ SUPPLEMENT_ARROW_APPLIES_LEFT_RIGHT
ad::map::landmark::TrafficSignType::PASS_RIGHT
@ PASS_RIGHT
ad::map::landmark::TrafficSignType::ACCESS_FORBIDDEN_HEIGHT
@ ACCESS_FORBIDDEN_HEIGHT
ad::map::landmark::TrafficSignType::LANES_MERGING
@ LANES_MERGING
ad::map::landmark::TrafficSignType::REQUIRED_STRAIGHT
@ REQUIRED_STRAIGHT
ad::map::landmark::TrafficSignType::PRIORITY_WAY
@ PRIORITY_WAY
ad::map::landmark::TrafficSignType::CAUTION_ANIMALS
@ CAUTION_ANIMALS
ad::map::landmark::TrafficSignType::SUPPLEMENT_RESIDENTS_ALLOWED
@ SUPPLEMENT_RESIDENTS_ALLOWED