ad_map_access
IntersectionTypeValidInputRange.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::intersection::IntersectionType const &input, bool const logErrors = true)
37 {
38  bool inValidInputRange = (input == ::ad::map::intersection::IntersectionType::Unknown)
40  || (input == ::ad::map::intersection::IntersectionType::Stop)
42  || (input == ::ad::map::intersection::IntersectionType::HasWay)
44  || (input == ::ad::map::intersection::IntersectionType::PriorityToRight)
46  || (input == ::ad::map::intersection::IntersectionType::TrafficLight);
47  if (!inValidInputRange && logErrors)
48  {
49  spdlog::error("withinValidInputRange(::ad::map::intersection::IntersectionType)>> {}, raw value: {} ",
50  input,
51  static_cast<int32_t>(input)); // LCOV_EXCL_BR_LINE
52  }
53  return inValidInputRange;
54 }
ad::map::intersection::IntersectionType::AllWayStop
@ AllWayStop
withinValidInputRange
bool withinValidInputRange(::ad::map::intersection::IntersectionType const &input, bool const logErrors=true)
check if the given IntersectionType is within valid input range
Definition: IntersectionTypeValidInputRange.hpp:36
ad::map::intersection::IntersectionType::Yield
@ Yield
ad::map::intersection::IntersectionType::Crosswalk
@ Crosswalk
ad::map::intersection::IntersectionType::PriorityToRightAndStraight
@ PriorityToRightAndStraight
ad::map::intersection::IntersectionType
IntersectionType
DataType IntersectionType.
Definition: IntersectionType.hpp:43
IntersectionType.hpp