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