ad_rss
RssStateValidInputRange.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>
27 #include "spdlog/fmt/ostr.h"
28 #include "spdlog/spdlog.h"
29 
40 inline bool withinValidInputRange(::ad::rss::state::RssState const &input, bool const logErrors = true)
41 {
42  // check for generic member input ranges
43  bool inValidInputRange = true;
44  inValidInputRange = withinValidInputRange(input.longitudinal_state, logErrors)
45  && withinValidInputRange(input.lateral_state_right, logErrors)
46  && withinValidInputRange(input.lateral_state_left, logErrors)
48  && withinValidInputRange(input.constellation_type, logErrors);
49  if (!inValidInputRange && logErrors)
50  {
51  spdlog::error("withinValidInputRange(::ad::rss::state::RssState)>> {} has invalid member",
52  input); // LCOV_EXCL_BR_LINE
53  }
54 
55  return inValidInputRange;
56 }
bool withinValidInputRange(::ad::rss::state::RssState const &input, bool const logErrors=true)
check if the given RssState is within valid input range
Definition: RssStateValidInputRange.hpp:40
DataType RssState.
Definition: RssState.hpp:49
::ad::rss::state::LateralRssState lateral_state_left
Definition: RssState.hpp:158
::ad::rss::state::UnstructuredConstellationRssState unstructured_constellation_state
Definition: RssState.hpp:163
::ad::rss::state::LateralRssState lateral_state_right
Definition: RssState.hpp:153
::ad::rss::world::ConstellationType constellation_type
Definition: RssState.hpp:168
::ad::rss::state::LongitudinalRssState longitudinal_state
Definition: RssState.hpp:148