ad_rss
ConstellationTypeValidInputRange.hpp
Go to the documentation of this file.
1 /*
2  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3  *
4  * Copyright (C) 2018-2022 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 
36 inline bool withinValidInputRange(::ad::rss::world::ConstellationType const &input, bool const logErrors = true)
37 {
38  bool inValidInputRange = (input == ::ad::rss::world::ConstellationType::NotRelevant)
40  || (input == ::ad::rss::world::ConstellationType::OppositeDirection)
42  || (input == ::ad::rss::world::ConstellationType::IntersectionObjectHasPriority)
44  || (input == ::ad::rss::world::ConstellationType::Unstructured);
45  if (!inValidInputRange && logErrors)
46  {
47  spdlog::error("withinValidInputRange(::ad::rss::world::ConstellationType)>> {}, raw value: {} ",
48  input,
49  static_cast<int32_t>(input)); // LCOV_EXCL_BR_LINE
50  }
51  return inValidInputRange;
52 }
bool withinValidInputRange(::ad::rss::world::ConstellationType const &input, bool const logErrors=true)
check if the given ConstellationType is within valid input range
Definition: ConstellationTypeValidInputRange.hpp:36
ConstellationType
DataType ConstellationType.
Definition: ConstellationType.hpp:44