LCOV - code coverage report
Current view: top level - include/ad/rss/core - RssSituationChecking.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 5 5 100.0 %
Date: 2025-07-22 06:53:46 Functions: 3 3 100.0 %
Branches: 2 4 50.0 %

           Branch data     Line data    Source code
       1                 :            : // ----------------- BEGIN LICENSE BLOCK ---------------------------------
       2                 :            : //
       3                 :            : // Copyright (C) 2018-2022 Intel Corporation
       4                 :            : //
       5                 :            : // SPDX-License-Identifier: LGPL-2.1-only
       6                 :            : //
       7                 :            : // ----------------- END LICENSE BLOCK -----------------------------------
       8                 :            : /**
       9                 :            :  * @file
      10                 :            :  */
      11                 :            : 
      12                 :            : #pragma once
      13                 :            : 
      14                 :            : #include "ad/rss/core/RssSituationSnapshot.hpp"
      15                 :            : #include "ad/rss/state/RssStateSnapshot.hpp"
      16                 :            : #include "ad/rss/structured/RssIntersectionConstellationChecker.hpp"
      17                 :            : #include "ad/rss/structured/RssNonIntersectionConstellationChecker.hpp"
      18                 :            : #include "ad/rss/unstructured/RssUnstructuredConstellationChecker.hpp"
      19                 :            : 
      20                 :            : /*!
      21                 :            :  * @brief namespace ad
      22                 :            :  */
      23                 :            : namespace ad {
      24                 :            : /*!
      25                 :            :  * @brief namespace rss
      26                 :            :  */
      27                 :            : namespace rss {
      28                 :            : /*!
      29                 :            :  * @brief namespace core
      30                 :            :  */
      31                 :            : namespace core {
      32                 :            : 
      33                 :            : /*!
      34                 :            :  * @brief class RssSituationChecking
      35                 :            :  *
      36                 :            :  * class providing functions required for the RSS checks of the RSS situation snapshot
      37                 :            :  */
      38                 :            : class RssSituationChecking
      39                 :            : {
      40                 :            : public:
      41                 :            :   /*!
      42                 :            :    * \brief Smart pointer on RssSituationChecking
      43                 :            :    */
      44                 :            :   typedef std::shared_ptr<RssSituationChecking> Ptr;
      45                 :            : 
      46                 :            :   /*!
      47                 :            :    * \brief Smart pointer on constant RssSituationChecking
      48                 :            :    */
      49                 :            :   typedef std::shared_ptr<RssSituationChecking const> ConstPtr;
      50                 :            : 
      51                 :            :   /*!
      52                 :            :    * @brief constructor
      53                 :            :    */
      54         [ +  - ]:        768 :   RssSituationChecking() = default;
      55                 :            : 
      56                 :            :   /*!
      57                 :            :    * @brief destructor
      58                 :            :    */
      59                 :        768 :   ~RssSituationChecking() = default;
      60                 :            : 
      61                 :            :   /*!
      62                 :            :    * @brief Checks if the current situation is safe.
      63                 :            :    *
      64                 :            :    * @param [in] situationSnapshot the situation snapshot in time that should be analyzed
      65                 :            :    * @param[out] rssStateSnapshot the RSS state snapshot of this situation
      66                 :            :    *
      67                 :            :    * @return true if the situation could be analyzed, false if an error occurred during evaluation.
      68                 :            :    */
      69                 :            :   bool checkSituation(RssSituationSnapshot const &situationSnapshot, state::RssStateSnapshot &rssStateSnapshot);
      70                 :            : 
      71                 :            :   /*!
      72                 :            :    * @brief Register a callback for unstructured trajectory set calculation
      73                 :            :    *
      74                 :            :    * @param[in] objectType The object type this trajectory set calculation should be applied
      75                 :            :    * @param[in] calculateTrajectorySetsCallback The actual callback function to perform the trajectory set calculation
      76                 :            :    */
      77                 :         28 :   void registerCalculateTrajectorySetsCallback(
      78                 :            :     world::ObjectType objectType,
      79                 :            :     unstructured::RssUnstructuredConstellationChecker::CalculateTrajectorySetsCallbackFunctionType
      80                 :            :       calculateTrajectorySetsCallback)
      81                 :            :   {
      82         [ +  - ]:         28 :     mUnstructuredConstellationChecker.registerCalculateTrajectorySetsCallback(objectType,
      83                 :            :                                                                               calculateTrajectorySetsCallback);
      84                 :         28 :   }
      85                 :            : 
      86                 :            : private:
      87                 :            :   /*!
      88                 :            :    * @brief Check if the current relative constellation is safe.
      89                 :            :    *
      90                 :            :    * @param[in] constellation      the relative constellation that should be analyzed
      91                 :            :    * @param[out] rssStateSnapshot the rss state snapshot the current state has to be appended
      92                 :            :    *
      93                 :            :    * @return true if the constellation could be analyzed, false if there was an error during evaluation
      94                 :            :    */
      95                 :            :   bool checkConstellationInputRangeChecked(RelativeConstellation const &constellation,
      96                 :            :                                            state::RssStateSnapshot &rssStateSnapshot);
      97                 :            : 
      98                 :            :   /*!
      99                 :            :    * @brief check to ensure time index is consistent
     100                 :            :    *
     101                 :            :    * @param[in] nextTimeIndex   the new time index
     102                 :            :    *
     103                 :            :    * @return true if the time is constantly increasing
     104                 :            :    */
     105                 :            :   bool checkTimeIncreasingConsistently(world::TimeIndex const &nextTimeIndex);
     106                 :            : 
     107                 :            :   structured::RssIntersectionConstellationChecker mIntersectionChecker;
     108                 :            :   structured::RssNonIntersectionConstellationChecker mNonIntersectionChecker;
     109                 :            :   unstructured::RssUnstructuredConstellationChecker mUnstructuredConstellationChecker;
     110                 :            :   world::TimeIndex mCurrentTimeIndex{0u};
     111                 :            : };
     112                 :            : } // namespace core
     113                 :            : } // namespace rss
     114                 :            : } // namespace ad

Generated by: LCOV version 1.14