ad_physics
VelocityValidInputRange.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: MIT
7  *
8  * ----------------- END LICENSE BLOCK -----------------------------------
9  */
10 
18 #pragma once
19 
20 #include <cmath>
21 #include <limits>
23 #include "ad/physics/Velocity.hpp"
24 #include "spdlog/fmt/ostr.h"
25 #include "spdlog/spdlog.h"
26 
37 inline bool withinValidInputRange(::ad::physics::Velocity const &input, bool const logErrors = true)
38 {
39  // check for generic member input ranges
40  bool inValidInputRange = true;
41  inValidInputRange = withinValidInputRange(input.x, logErrors) && withinValidInputRange(input.y, logErrors)
42  && withinValidInputRange(input.z, logErrors);
43  if (!inValidInputRange && logErrors)
44  {
45  spdlog::error("withinValidInputRange(::ad::physics::Velocity)>> {} has invalid member", input); // LCOV_EXCL_BR_LINE
46  }
47 
48  return inValidInputRange;
49 }
Velocity.hpp
withinValidInputRange
bool withinValidInputRange(::ad::physics::Velocity const &input, bool const logErrors=true)
check if the given Velocity is within valid input range
Definition: VelocityValidInputRange.hpp:37
ad::physics::Velocity::x
::ad::physics::Speed x
Definition: Velocity.hpp:118
ad::physics::Velocity::z
::ad::physics::Speed z
Definition: Velocity.hpp:128
SpeedValidInputRange.hpp
ad::physics::Velocity::y
::ad::physics::Speed y
Definition: Velocity.hpp:123
ad::physics::Velocity
DataType Velocity.
Definition: Velocity.hpp:41