ad_rss
HeadingRangeVectorValidInputRange.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>
24 #include "spdlog/fmt/ostr.h"
25 #include "spdlog/spdlog.h"
26 
39 inline bool withinValidInputRange(::ad::rss::state::HeadingRangeVector const &input, bool const logErrors = true)
40 {
41  bool inValidInputRange = true;
42 
43  if (inValidInputRange)
44  {
45  for (auto const &member : input)
46  {
47  bool memberInValidInputRange = withinValidInputRange(member, logErrors);
48  inValidInputRange = inValidInputRange && memberInValidInputRange;
49  if (!memberInValidInputRange && logErrors)
50  {
51  spdlog::error("withinValidInputRange(::ad::rss::state::HeadingRangeVector)>> {}, invalid member {}",
52  input,
53  member); // LCOV_EXCL_BR_LINE
54  }
55  }
56  }
57  return inValidInputRange;
58 }
ad::rss::state::HeadingRangeVector
std::vector<::ad::rss::state::HeadingRange > HeadingRangeVector
DataType HeadingRangeVector.
Definition: HeadingRangeVector.hpp:42
withinValidInputRange
bool withinValidInputRange(::ad::rss::state::HeadingRangeVector const &input, bool const logErrors=true)
check if the given HeadingRangeVector is within valid input range
Definition: HeadingRangeVectorValidInputRange.hpp:39
HeadingRangeValidInputRange.hpp
HeadingRangeVector.hpp