LCOV - code coverage report
Current view: top level - generated/include/ad/rss/state - ProperResponseValidInputRange.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 15 18 83.3 %
Date: 2024-05-07 10:58:10 Functions: 1 1 100.0 %
Branches: 19 28 67.9 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2020 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-1997
      16                 :            :  */
      17                 :            : 
      18                 :            : #pragma once
      19                 :            : 
      20                 :            : #include <cmath>
      21                 :            : #include <limits>
      22                 :            : #include "ad/rss/state/AccelerationRestrictionValidInputRange.hpp"
      23                 :            : #include "ad/rss/state/HeadingRangeVectorValidInputRange.hpp"
      24                 :            : #include "ad/rss/state/LateralResponseValidInputRange.hpp"
      25                 :            : #include "ad/rss/state/LongitudinalResponseValidInputRange.hpp"
      26                 :            : #include "ad/rss/state/ProperResponse.hpp"
      27                 :            : #include "ad/rss/state/UnstructuredSceneResponseValidInputRange.hpp"
      28                 :            : #include "ad/rss/world/ObjectIdVectorValidInputRange.hpp"
      29                 :            : #include "spdlog/fmt/ostr.h"
      30                 :            : #include "spdlog/spdlog.h"
      31                 :            : 
      32                 :            : /*!
      33                 :            :  * \brief check if the given ProperResponse is within valid input range
      34                 :            :  *
      35                 :            :  * \param[in] input the ProperResponse as an input value
      36                 :            :  * \param[in] logErrors enables error logging
      37                 :            :  *
      38                 :            :  * \returns \c true if ProperResponse is considered to be within the specified input range
      39                 :            :  *
      40                 :            :  * \note the specified input range is defined by the ranges of all members, plus:
      41                 :            :  *       ::ad::rss::world::TimeIndex(1) <= timeIndex
      42                 :            :  */
      43                 :         11 : inline bool withinValidInputRange(::ad::rss::state::ProperResponse const &input, bool const logErrors = true)
      44                 :            : {
      45                 :            :   // check for generic member input ranges
      46                 :         11 :   bool inValidInputRange = true;
      47                 :         11 :   inValidInputRange = withinValidInputRange(input.dangerousObjects, logErrors)
      48         [ +  + ]:         11 :     && withinValidInputRange(input.longitudinalResponse, logErrors)
      49         [ +  + ]:          9 :     && withinValidInputRange(input.lateralResponseRight, logErrors)
      50         [ +  + ]:          7 :     && withinValidInputRange(input.lateralResponseLeft, logErrors)
      51         [ +  - ]:          5 :     && withinValidInputRange(input.headingRanges, logErrors)
      52         [ +  + ]:          5 :     && withinValidInputRange(input.accelerationRestrictions, logErrors)
      53   [ +  -  +  + ]:         22 :     && withinValidInputRange(input.unstructuredSceneResponse, logErrors);
      54   [ +  +  +  - ]:         11 :   if (!inValidInputRange && logErrors)
      55                 :            :   {
      56         [ +  - ]:         10 :     spdlog::error("withinValidInputRange(::ad::rss::state::ProperResponse)>> {} has invalid member",
      57                 :            :                   input); // LCOV_EXCL_BR_LINE
      58                 :            :   }
      59                 :            : 
      60                 :            :   // check for individual input ranges
      61         [ +  + ]:         11 :   if (inValidInputRange)
      62                 :            :   {
      63                 :          1 :     inValidInputRange = (::ad::rss::world::TimeIndex(1) <= input.timeIndex);
      64   [ -  +  -  - ]:          1 :     if (!inValidInputRange && logErrors)
      65                 :            :     {
      66         [ #  # ]:          0 :       spdlog::error(
      67                 :            :         "withinValidInputRange(::ad::rss::state::ProperResponse)>> {} element {} out of valid input range [{}, {}]",
      68                 :            :         input,
      69                 :          0 :         input.timeIndex,
      70                 :          0 :         ::ad::rss::world::TimeIndex(1),
      71                 :            :         "Undefined"); // LCOV_EXCL_BR_LINE
      72                 :            :     }
      73                 :            :   }
      74                 :            : 
      75                 :         11 :   return inValidInputRange;
      76                 :            : }

Generated by: LCOV version 1.14