LCOV - code coverage report
Current view: top level - generated/include/ad/rss/situation - SituationSnapshotValidInputRange.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 10 13 76.9 %
Date: 2024-04-23 14:35:54 Functions: 1 1 100.0 %
Branches: 11 18 61.1 %

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

Generated by: LCOV version 1.14