Branch data Line data Source code
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 : : 11 : : /** 12 : : * Generated file 13 : : * @file 14 : : * 15 : : * Generator Version : 11.0.0-2046 16 : : */ 17 : : 18 : : #pragma once 19 : : 20 : : #include <cmath> 21 : : #include <limits> 22 : : #include "ad/rss/core/RelativeConstellationValidInputRange.hpp" 23 : : #include "ad/rss/core/RelativeConstellationVector.hpp" 24 : : #include "spdlog/fmt/ostr.h" 25 : : #include "spdlog/spdlog.h" 26 : : 27 : : /*! 28 : : * \brief check if the given RelativeConstellationVector is within valid input range 29 : : * 30 : : * \param[in] input the RelativeConstellationVector as an input value 31 : : * \param[in] logErrors enables error logging 32 : : * 33 : : * \returns \c true if RelativeConstellationVector is considered to be within the specified input range 34 : : * 35 : : * \note the specified input range is defined by 36 : : * 0 <= \c input.size() <= 1000 37 : : * and the ranges of all vector elements 38 : : */ 39 : 3993 : inline bool withinValidInputRange(::ad::rss::core::RelativeConstellationVector const &input, 40 : : bool const logErrors = true) 41 : : { 42 : 3993 : bool inValidInputRange = (input.size() <= std::size_t(1000)); 43 [ + + + - ]: 3993 : if (!inValidInputRange && logErrors) 44 : : { 45 [ + - ]: 2 : spdlog::error("withinValidInputRange(::ad::rss::core::RelativeConstellationVector)>> {}, invalid input range", 46 : : input); // LCOV_EXCL_BR_LINE 47 : : } 48 : : 49 [ + + ]: 3993 : if (inValidInputRange) 50 : : { 51 [ + + ]: 61048 : for (auto const &member : input) 52 : : { 53 [ + - ]: 57057 : bool memberInValidInputRange = withinValidInputRange(member, logErrors); 54 [ + + + + ]: 57057 : inValidInputRange = inValidInputRange && memberInValidInputRange; 55 [ + + + - ]: 57057 : if (!memberInValidInputRange && logErrors) 56 : : { 57 [ + - ]: 1000 : spdlog::error("withinValidInputRange(::ad::rss::core::RelativeConstellationVector)>> {}, invalid member {}", 58 : : input, 59 : : member); // LCOV_EXCL_BR_LINE 60 : : } 61 : : } 62 : : } 63 : 3993 : return inValidInputRange; 64 : : }