ad_rss
SituationValidInputRange.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>
26 #include "spdlog/fmt/ostr.h"
27 #include "spdlog/spdlog.h"
28 
39 inline bool withinValidInputRange(::ad::rss::situation::Situation const &input, bool const logErrors = true)
40 {
41  // check for generic member input ranges
42  bool inValidInputRange = true;
43  inValidInputRange = withinValidInputRange(input.situationType, logErrors)
44  && withinValidInputRange(input.egoVehicleState, logErrors)
45  && withinValidInputRange(input.otherVehicleState, logErrors)
46  && withinValidInputRange(input.relativePosition, logErrors);
47  if (!inValidInputRange && logErrors)
48  {
49  spdlog::error("withinValidInputRange(::ad::rss::situation::Situation)>> {} has invalid member",
50  input); // LCOV_EXCL_BR_LINE
51  }
52 
53  return inValidInputRange;
54 }
Situation.hpp
ad::rss::situation::Situation
DataType Situation.
Definition: Situation.hpp:53
VehicleStateValidInputRange.hpp
ad::rss::situation::Situation::egoVehicleState
::ad::rss::situation::VehicleState egoVehicleState
Definition: Situation.hpp:150
ad::rss::situation::Situation::otherVehicleState
::ad::rss::situation::VehicleState otherVehicleState
Definition: Situation.hpp:155
RelativePositionValidInputRange.hpp
withinValidInputRange
bool withinValidInputRange(::ad::rss::situation::Situation const &input, bool const logErrors=true)
check if the given Situation is within valid input range
Definition: SituationValidInputRange.hpp:39
ad::rss::situation::Situation::relativePosition
::ad::rss::situation::RelativePosition relativePosition
Definition: Situation.hpp:160
SituationTypeValidInputRange.hpp
ad::rss::situation::Situation::situationType
::ad::rss::situation::SituationType situationType
Definition: Situation.hpp:145