ad_map_access
TurnDirectionValidInputRange.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::TurnDirection const &input, bool const logErrors = true)
37 {
38  bool inValidInputRange = (input == ::ad::map::intersection::TurnDirection::Unknown)
40  || (input == ::ad::map::intersection::TurnDirection::Straight)
42  || (input == ::ad::map::intersection::TurnDirection::UTurn);
43  if (!inValidInputRange && logErrors)
44  {
45  spdlog::error("withinValidInputRange(::ad::map::intersection::TurnDirection)>> {}, raw value: {} ",
46  input,
47  static_cast<int32_t>(input)); // LCOV_EXCL_BR_LINE
48  }
49  return inValidInputRange;
50 }
ad::map::intersection::TurnDirection::Right
@ Right
TurnDirection.hpp
withinValidInputRange
bool withinValidInputRange(::ad::map::intersection::TurnDirection const &input, bool const logErrors=true)
check if the given TurnDirection is within valid input range
Definition: TurnDirectionValidInputRange.hpp:36
ad::map::intersection::TurnDirection::Left
@ Left
ad::map::intersection::TurnDirection
TurnDirection
DataType TurnDirection.
Definition: TurnDirection.hpp:43