ad_rss
LongitudinalRelativePositionValidInputRange.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: LGPL-2.1-only
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 
37  bool const logErrors = true)
38 {
39  bool inValidInputRange = (input == ::ad::rss::situation::LongitudinalRelativePosition::InFront)
41  || (input == ::ad::rss::situation::LongitudinalRelativePosition::Overlap)
43  || (input == ::ad::rss::situation::LongitudinalRelativePosition::AtBack);
44  if (!inValidInputRange && logErrors)
45  {
46  spdlog::error("withinValidInputRange(::ad::rss::situation::LongitudinalRelativePosition)>> {}, raw value: {} ",
47  input,
48  static_cast<int32_t>(input)); // LCOV_EXCL_BR_LINE
49  }
50  return inValidInputRange;
51 }
ad::rss::situation::LongitudinalRelativePosition::OverlapFront
@ OverlapFront
ad::rss::situation::LongitudinalRelativePosition
LongitudinalRelativePosition
DataType LongitudinalRelativePosition.
Definition: LongitudinalRelativePosition.hpp:42
LongitudinalRelativePosition.hpp
ad::rss::situation::LongitudinalRelativePosition::OverlapBack
@ OverlapBack
withinValidInputRange
bool withinValidInputRange(::ad::rss::situation::LongitudinalRelativePosition const &input, bool const logErrors=true)
check if the given LongitudinalRelativePosition is within valid input range
Definition: LongitudinalRelativePositionValidInputRange.hpp:36