Branch data Line data Source code
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 : : 11 : : /** 12 : : * Generated file 13 : : * @file 14 : : * 15 : : * Generator Version : 11.0.0-1997 16 : : */ 17 : : 18 : : #pragma once 19 : : 20 : : #include <cmath> 21 : : #include <limits> 22 : : #include "ad/physics/AngularAcceleration.hpp" 23 : : #include "spdlog/fmt/ostr.h" 24 : : #include "spdlog/spdlog.h" 25 : : 26 : : /*! 27 : : * \brief check if the given AngularAcceleration is within valid input range 28 : : * 29 : : * \param[in] input the AngularAcceleration as an input value 30 : : * \param[in] logErrors enables error logging 31 : : * 32 : : * \returns \c true if AngularAcceleration is considered to be within the specified input range 33 : : * 34 : : * \note the specified input range is defined by 35 : : * std::numeric_limits<::ad::physics::AngularAcceleration>::lowest() <= \c input <= 36 : : * std::numeric_limits<::ad::physics::AngularAcceleration>::max() 37 : : * -1e2 <= \c input <= 1e2 38 : : */ 39 : 11 : inline bool withinValidInputRange(::ad::physics::AngularAcceleration const &input, bool const logErrors = true) 40 : : { 41 : : // check for generic numeric limits of the type 42 : 11 : bool inValidInputRange = input.isValid() 43 [ + - + - ]: 8 : && (std::numeric_limits<::ad::physics::AngularAcceleration>::lowest() <= input) 44 [ + + + - : 19 : && (input <= std::numeric_limits<::ad::physics::AngularAcceleration>::max()); + - ] 45 [ + + + - ]: 11 : if (!inValidInputRange && logErrors) 46 : : { 47 [ + - ]: 3 : spdlog::error("withinValidInputRange(::ad::physics::AngularAcceleration)>> {} out of numerical limits [{}, {}]", 48 : : input, 49 : 3 : std::numeric_limits<::ad::physics::AngularAcceleration>::lowest(), 50 : 6 : std::numeric_limits<::ad::physics::AngularAcceleration>::max()); // LCOV_EXCL_BR_LINE 51 : : } 52 : : // check for individual input range 53 [ + + ]: 11 : if (inValidInputRange) 54 : : { 55 : : inValidInputRange 56 [ + - + + : 8 : = (::ad::physics::AngularAcceleration(-1e2) <= input) && (input <= ::ad::physics::AngularAcceleration(1e2)); + - + + ] 57 [ + + + - ]: 8 : if (!inValidInputRange && logErrors) 58 : : { 59 [ + - ]: 5 : spdlog::error("withinValidInputRange(::ad::physics::AngularAcceleration)>> {} out of valid input range [{}, {}]", 60 : : input, 61 : 5 : ::ad::physics::AngularAcceleration(-1e2), 62 : 10 : ::ad::physics::AngularAcceleration(1e2)); // LCOV_EXCL_BR_LINE 63 : : } 64 : : } 65 : 11 : return inValidInputRange; 66 : : }