ad_rss
RelativeConstellationValidInputRange.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>
26 #include "spdlog/fmt/ostr.h"
27 #include "spdlog/spdlog.h"
28 
39 inline bool withinValidInputRange(::ad::rss::core::RelativeConstellation const &input, bool const logErrors = true)
40 {
41  // check for generic member input ranges
42  bool inValidInputRange = true;
43  inValidInputRange = withinValidInputRange(input.constellation_type, logErrors)
44  && withinValidInputRange(input.ego_state, logErrors) && withinValidInputRange(input.other_state, logErrors)
45  && withinValidInputRange(input.relative_position, logErrors);
46  if (!inValidInputRange && logErrors)
47  {
48  spdlog::error("withinValidInputRange(::ad::rss::core::RelativeConstellation)>> {} has invalid member",
49  input); // LCOV_EXCL_BR_LINE
50  }
51 
52  return inValidInputRange;
53 }
bool withinValidInputRange(::ad::rss::core::RelativeConstellation const &input, bool const logErrors=true)
check if the given RelativeConstellation is within valid input range
Definition: RelativeConstellationValidInputRange.hpp:39
DataType RelativeConstellation.
Definition: RelativeConstellation.hpp:56
::ad::rss::core::RelativeObjectState other_state
Definition: RelativeConstellation.hpp:162
::ad::rss::world::ConstellationType constellation_type
Definition: RelativeConstellation.hpp:152
::ad::rss::core::RelativeObjectState ego_state
Definition: RelativeConstellation.hpp:157
::ad::rss::core::RelativePosition relative_position
Definition: RelativeConstellation.hpp:168