ad_rss
ConstellationValidInputRange.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::world::Constellation const &input, bool const logErrors = true)
41 {
42  // check for generic member input ranges
43  bool inValidInputRange = true;
44  inValidInputRange = withinValidInputRange(input.constellation_type, logErrors)
45  && withinValidInputRange(input.ego_vehicle, logErrors)
47  && withinValidInputRange(input.object, logErrors) && withinValidInputRange(input.object_rss_dynamics, logErrors)
48  && withinValidInputRange(input.intersecting_road, logErrors)
49  && withinValidInputRange(input.ego_vehicle_road, logErrors);
50  if (!inValidInputRange && logErrors)
51  {
52  spdlog::error("withinValidInputRange(::ad::rss::world::Constellation)>> {} has invalid member",
53  input); // LCOV_EXCL_BR_LINE
54  }
55 
56  return inValidInputRange;
57 }
bool withinValidInputRange(::ad::rss::world::Constellation const &input, bool const logErrors=true)
check if the given Constellation is within valid input range
Definition: ConstellationValidInputRange.hpp:40
DataType Constellation.
Definition: Constellation.hpp:49
::ad::rss::world::RssDynamics ego_vehicle_rss_dynamics
Definition: Constellation.hpp:140
::ad::rss::world::RssDynamics object_rss_dynamics
Definition: Constellation.hpp:151
::ad::rss::world::RoadArea ego_vehicle_road
Definition: Constellation.hpp:164
::ad::rss::world::ConstellationType constellation_type
Definition: Constellation.hpp:128
::ad::rss::world::RoadArea intersecting_road
Definition: Constellation.hpp:158
::ad::rss::world::Object object
Definition: Constellation.hpp:145
::ad::rss::world::Object ego_vehicle
Definition: Constellation.hpp:133