ad_rss
RssStateValidInputRange.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>
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.longitudinalState, logErrors)
45  && withinValidInputRange(input.lateralStateRight, logErrors)
46  && withinValidInputRange(input.lateralStateLeft, logErrors)
48  && withinValidInputRange(input.situationType, 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 }
RssState.hpp
ad::rss::state::RssState::lateralStateRight
::ad::rss::state::LateralRssState lateralStateRight
Definition: RssState.hpp:147
ad::rss::state::RssState::situationType
::ad::rss::situation::SituationType situationType
Definition: RssState.hpp:162
ad::rss::state::RssState::unstructuredSceneState
::ad::rss::state::UnstructuredSceneRssState unstructuredSceneState
Definition: RssState.hpp:157
ad::rss::state::RssState
DataType RssState.
Definition: RssState.hpp:48
ad::rss::state::RssState::longitudinalState
::ad::rss::state::LongitudinalRssState longitudinalState
Definition: RssState.hpp:142
SituationTypeValidInputRange.hpp
UnstructuredSceneRssStateValidInputRange.hpp
withinValidInputRange
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
ad::rss::state::RssState::lateralStateLeft
::ad::rss::state::LateralRssState lateralStateLeft
Definition: RssState.hpp:152
LongitudinalRssStateValidInputRange.hpp
LateralRssStateValidInputRange.hpp