ad_physics
RatioValueListValidInputRange.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: MIT
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::physics::RatioValueList const &input, bool const logErrors = true)
40 {
41  (void)input;
42  (void)logErrors;
43  bool inValidInputRange = true;
44 
45  if (inValidInputRange)
46  {
47  for (auto const &member : input)
48  {
49  bool memberInValidInputRange = withinValidInputRange(member, logErrors);
50  inValidInputRange = inValidInputRange && memberInValidInputRange;
51  if (!memberInValidInputRange && logErrors)
52  {
53  spdlog::error("withinValidInputRange(::ad::physics::RatioValueList)>> {}, invalid member {}",
54  input,
55  member); // LCOV_EXCL_BR_LINE
56  }
57  }
58  }
59  return inValidInputRange;
60 }
ad::physics::RatioValueList
std::vector<::ad::physics::RatioValue > RatioValueList
DataType RatioValueList.
Definition: RatioValueList.hpp:38
withinValidInputRange
bool withinValidInputRange(::ad::physics::RatioValueList const &input, bool const logErrors=true)
check if the given RatioValueList is within valid input range
Definition: RatioValueListValidInputRange.hpp:39
RatioValueList.hpp
RatioValueValidInputRange.hpp