ad_rss
LaneSegmentTypeValidInputRange.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 
36 inline bool withinValidInputRange(::ad::rss::world::LaneSegmentType const &input, bool const logErrors = true)
37 {
38  bool inValidInputRange = (input == ::ad::rss::world::LaneSegmentType::Normal)
40  if (!inValidInputRange && logErrors)
41  {
42  spdlog::error("withinValidInputRange(::ad::rss::world::LaneSegmentType)>> {}, raw value: {} ",
43  input,
44  static_cast<int32_t>(input)); // LCOV_EXCL_BR_LINE
45  }
46  return inValidInputRange;
47 }
withinValidInputRange
bool withinValidInputRange(::ad::rss::world::LaneSegmentType const &input, bool const logErrors=true)
check if the given LaneSegmentType is within valid input range
Definition: LaneSegmentTypeValidInputRange.hpp:36
ad::rss::world::LaneSegmentType
LaneSegmentType
DataType LaneSegmentType.
Definition: LaneSegmentType.hpp:39
ad::rss::world::LaneSegmentType::Intersection
@ Intersection
LaneSegmentType.hpp