LCOV - code coverage report
Current view: top level - include/ad/rss/map - RssObjectInstance.hpp (source / functions) Hit Total Coverage
Test: ad_rss_map_integration Lines: 8 8 100.0 %
Date: 2025-07-22 06:56:19 Functions: 3 3 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // ----------------- BEGIN LICENSE BLOCK ---------------------------------
       2                 :            : //
       3                 :            : // Copyright (C) 2019-2021 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/world/ObjectType.hpp>
      15                 :            : 
      16                 :            : /*!
      17                 :            :  * @brief namespace rss
      18                 :            :  */
      19                 :            : namespace ad {
      20                 :            : /*!
      21                 :            :  * @brief namespace rss
      22                 :            :  */
      23                 :            : namespace rss {
      24                 :            : /*!
      25                 :            :  * @brief namespace map
      26                 :            :  */
      27                 :            : namespace map {
      28                 :            : 
      29                 :            : /*! @brief forward declaration of RssRouteCheckerControl class */
      30                 :            : template <class OBJECT_INSTANCE_TYPE> class RssRouteCheckerControl;
      31                 :            : 
      32                 :            : /*! @brief base type of an object instance
      33                 :            :  */
      34                 :            : template <class OBJECT_INSTANCE_TYPE> class RssObjectInstance
      35                 :            : {
      36                 :            : public:
      37                 :            :   /*!
      38                 :            :    * \brief Smart pointer on RssObjectAdapter
      39                 :            :    */
      40                 :            :   typedef std::shared_ptr<RssObjectInstance> Ptr;
      41                 :            : 
      42                 :            :   /*!
      43                 :            :    * \brief Smart pointer on constant RssObjectAdapter
      44                 :            :    */
      45                 :            :   typedef std::shared_ptr<RssObjectInstance const> ConstPtr;
      46                 :            : 
      47                 :            :   using RssRouteCheckerControlPtr = std::shared_ptr<RssRouteCheckerControl<OBJECT_INSTANCE_TYPE>>;
      48                 :            : 
      49                 :        441 :   RssObjectInstance(OBJECT_INSTANCE_TYPE const &objectInstanceType, RssRouteCheckerControlPtr checkerControl)
      50                 :        441 :     : mObjectInstanceType(objectInstanceType)
      51                 :        441 :     , mCheckerControl(checkerControl)
      52                 :            :   {
      53                 :        441 :   }
      54                 :            : 
      55                 :            :   /*! @returns the object type of this.
      56                 :            :    *
      57                 :            :    * Pure virtual function the object instance has to reimplement.
      58                 :            :    */
      59                 :            :   virtual ::ad::rss::world::ObjectType getObjectType() const = 0;
      60                 :            : 
      61                 :            :   /*! @brief get the underlying vehicle instance */
      62                 :        547 :   OBJECT_INSTANCE_TYPE &getObjectInstanceType()
      63                 :            :   {
      64                 :        547 :     return mObjectInstanceType;
      65                 :            :   }
      66                 :            : 
      67                 :            :   /*! @brief get the underlying vehicle instance */
      68                 :            :   OBJECT_INSTANCE_TYPE const &getObjectInstanceType() const
      69                 :            :   {
      70                 :            :     return mObjectInstanceType;
      71                 :            :   }
      72                 :            : 
      73                 :       1510 :   RssRouteCheckerControlPtr getCheckerControl() const
      74                 :            :   {
      75                 :       1510 :     return mCheckerControl;
      76                 :            :   }
      77                 :            : 
      78                 :            : protected:
      79                 :            :   OBJECT_INSTANCE_TYPE mObjectInstanceType;
      80                 :            :   RssRouteCheckerControlPtr mCheckerControl;
      81                 :            : };
      82                 :            : 
      83                 :            : } // namespace map
      84                 :            : } // namespace rss
      85                 :            : } // namespace ad

Generated by: LCOV version 1.14