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/state/RssStateSnapshot.hpp" 23 : : #include "ad/rss/state/RssStateVectorValidInputRange.hpp" 24 : : #include "ad/rss/state/UnstructuredConstellationStateInformationValidInputRange.hpp" 25 : : #include "ad/rss/world/RssDynamicsValidInputRange.hpp" 26 : : #include "spdlog/fmt/ostr.h" 27 : : #include "spdlog/spdlog.h" 28 : : 29 : : /*! 30 : : * \brief check if the given RssStateSnapshot is within valid input range 31 : : * 32 : : * \param[in] input the RssStateSnapshot as an input value 33 : : * \param[in] logErrors enables error logging 34 : : * 35 : : * \returns \c true if RssStateSnapshot is considered to be within the specified input range 36 : : * 37 : : * \note the specified input range is defined by the ranges of all members, plus: 38 : : * ::ad::rss::world::TimeIndex(1) <= time_index 39 : : */ 40 : 3862 : inline bool withinValidInputRange(::ad::rss::state::RssStateSnapshot const &input, bool const logErrors = true) 41 : : { 42 : : // check for generic member input ranges 43 : 3862 : bool inValidInputRange = true; 44 : 3862 : inValidInputRange = withinValidInputRange(input.default_ego_vehicle_rss_dynamics, logErrors) 45 [ + + ]: 3860 : && withinValidInputRange(input.individual_responses, logErrors) 46 [ + + + + ]: 7722 : && withinValidInputRange(input.unstructured_constellation_ego_information, logErrors); 47 [ + + + - ]: 3862 : if (!inValidInputRange && logErrors) 48 : : { 49 [ + - ]: 5 : spdlog::error("withinValidInputRange(::ad::rss::state::RssStateSnapshot)>> {} has invalid member", 50 : : input); // LCOV_EXCL_BR_LINE 51 : : } 52 : : 53 : : // check for individual input ranges 54 [ + + ]: 3862 : if (inValidInputRange) 55 : : { 56 : 3857 : inValidInputRange = (::ad::rss::world::TimeIndex(1) <= input.time_index); 57 [ - + - - ]: 3857 : if (!inValidInputRange && logErrors) 58 : : { 59 [ # # ]: 0 : spdlog::error( 60 : : "withinValidInputRange(::ad::rss::state::RssStateSnapshot)>> {} element {} out of valid input range [{}, {}]", 61 : : input, 62 : 0 : input.time_index, 63 [ # # ]: 0 : ::ad::rss::world::TimeIndex(1), 64 : : "Undefined"); // LCOV_EXCL_BR_LINE 65 : : } 66 : : } 67 : : 68 : 3862 : return inValidInputRange; 69 : : }