ad_rss
RelativeObjectStateValidInputRange.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::core::RelativeObjectState const &input, bool const logErrors = true)
41 {
42  // check for generic member input ranges
43  bool inValidInputRange = true;
44  inValidInputRange = withinValidInputRange(input.object_type, logErrors)
45  && withinValidInputRange(input.dynamics, logErrors)
48  if (!inValidInputRange && logErrors)
49  {
50  spdlog::error("withinValidInputRange(::ad::rss::core::RelativeObjectState)>> {} has invalid member",
51  input); // LCOV_EXCL_BR_LINE
52  }
53 
54  return inValidInputRange;
55 }
bool withinValidInputRange(::ad::rss::core::RelativeObjectState const &input, bool const logErrors=true)
check if the given RelativeObjectState is within valid input range
Definition: RelativeObjectStateValidInputRange.hpp:40
DataType RelativeObjectState.
Definition: RelativeObjectState.hpp:48
::ad::rss::core::StructuredObjectState structured_object_state
Definition: RelativeObjectState.hpp:141
::ad::rss::world::ObjectState unstructured_object_state
Definition: RelativeObjectState.hpp:136
::ad::rss::world::RssDynamics dynamics
Definition: RelativeObjectState.hpp:131
::ad::rss::world::ObjectType object_type
Definition: RelativeObjectState.hpp:126