ad_rss
RssStateInformationValidInputRange.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>
22 #include "ad/physics/DistanceValidInputRange.hpp"
25 #include "spdlog/fmt/ostr.h"
26 #include "spdlog/spdlog.h"
27 
38 inline bool withinValidInputRange(::ad::rss::state::RssStateInformation const &input, bool const logErrors = true)
39 {
40  // check for generic member input ranges
41  bool inValidInputRange = true;
42  inValidInputRange = withinValidInputRange(input.safeDistance, logErrors)
43  && withinValidInputRange(input.currentDistance, logErrors) && withinValidInputRange(input.evaluator, logErrors);
44  if (!inValidInputRange && logErrors)
45  {
46  spdlog::error("withinValidInputRange(::ad::rss::state::RssStateInformation)>> {} has invalid member",
47  input); // LCOV_EXCL_BR_LINE
48  }
49 
50  return inValidInputRange;
51 }
ad::rss::state::RssStateInformation::safeDistance
::ad::physics::Distance safeDistance
Definition: RssStateInformation.hpp:122
RssStateInformation.hpp
withinValidInputRange
bool withinValidInputRange(::ad::rss::state::RssStateInformation const &input, bool const logErrors=true)
check if the given RssStateInformation is within valid input range
Definition: RssStateInformationValidInputRange.hpp:38
RssStateEvaluatorValidInputRange.hpp
ad::rss::state::RssStateInformation::evaluator
::ad::rss::state::RssStateEvaluator evaluator
Definition: RssStateInformation.hpp:133
ad::rss::state::RssStateInformation::currentDistance
::ad::physics::Distance currentDistance
Definition: RssStateInformation.hpp:127
ad::rss::state::RssStateInformation
DataType RssStateInformation.
Definition: RssStateInformation.hpp:44