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/restriction/RoadUserTypeValidInputRange.hpp" 23 : : #include "ad/map/restriction/VehicleDescriptor.hpp" 24 : : #include "ad/physics/DistanceValidInputRange.hpp" 25 : : #include "ad/physics/WeightValidInputRange.hpp" 26 : : #include "spdlog/fmt/ostr.h" 27 : : #include "spdlog/spdlog.h" 28 : : 29 : : /*! 30 : : * \brief check if the given VehicleDescriptor is within valid input range 31 : : * 32 : : * \param[in] input the VehicleDescriptor as an input value 33 : : * \param[in] logErrors enables error logging 34 : : * 35 : : * \returns \c true if VehicleDescriptor is considered to be within the specified input range 36 : : * 37 : : * \note the specified input range is defined by the ranges of all members 38 : : */ 39 : 43 : inline bool withinValidInputRange(::ad::map::restriction::VehicleDescriptor const &input, bool const logErrors = true) 40 : : { 41 : : // check for generic member input ranges 42 : 43 : bool inValidInputRange = true; 43 [ + + ]: 84 : inValidInputRange = withinValidInputRange(input.type, logErrors) && withinValidInputRange(input.width, logErrors) 44 [ + + + + ]: 34 : && withinValidInputRange(input.height, logErrors) && withinValidInputRange(input.length, logErrors) 45 [ + + + + ]: 84 : && withinValidInputRange(input.weight, logErrors); 46 [ + + + - ]: 43 : if (!inValidInputRange && logErrors) 47 : : { 48 [ + - ]: 15 : spdlog::error("withinValidInputRange(::ad::map::restriction::VehicleDescriptor)>> {} has invalid member", 49 : : input); // LCOV_EXCL_BR_LINE 50 : : } 51 : : 52 : 43 : return inValidInputRange; 53 : : }