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/map/match/ENUObjectPositionList.hpp" 23 : : #include "ad/map/match/ENUObjectPositionValidInputRange.hpp" 24 : : #include "spdlog/fmt/ostr.h" 25 : : #include "spdlog/spdlog.h" 26 : : 27 : : /*! 28 : : * \brief check if the given ENUObjectPositionList is within valid input range 29 : : * 30 : : * \param[in] input the ENUObjectPositionList as an input value 31 : : * \param[in] logErrors enables error logging 32 : : * 33 : : * \returns \c true if ENUObjectPositionList is considered to be within the specified input range 34 : : * 35 : : * \note the specified input range is defined by 36 : : * 1 <= \c input.size() <= 0 37 : : * and the ranges of all vector elements 38 : : */ 39 : 5 : inline bool withinValidInputRange(::ad::map::match::ENUObjectPositionList const &input, bool const logErrors = true) 40 : : { 41 : 5 : bool inValidInputRange = ((std::size_t(1)) <= input.size()); 42 [ + + + - ]: 5 : if (!inValidInputRange && logErrors) 43 : : { 44 [ + - ]: 1 : spdlog::error("withinValidInputRange(::ad::map::match::ENUObjectPositionList)>> {}, invalid input range", 45 : : input); // LCOV_EXCL_BR_LINE 46 : : } 47 : : 48 [ + + ]: 5 : if (inValidInputRange) 49 : : { 50 [ + + ]: 8 : for (auto const &member : input) 51 : : { 52 [ + - ]: 4 : bool memberInValidInputRange = withinValidInputRange(member, logErrors); 53 [ + - + + ]: 4 : inValidInputRange = inValidInputRange && memberInValidInputRange; 54 [ + + + - ]: 4 : if (!memberInValidInputRange && logErrors) 55 : : { 56 [ + - ]: 2 : spdlog::error("withinValidInputRange(::ad::map::match::ENUObjectPositionList)>> {}, invalid member {}", 57 : : input, 58 : : member); // LCOV_EXCL_BR_LINE 59 : : } 60 : : } 61 : : } 62 : 5 : return inValidInputRange; 63 : : }