LCOV - code coverage report
Current view: top level - generated/include/ad/map/route - ConnectingRoute.hpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 25 25 100.0 %
Date: 2022-10-04 09:48:07 Functions: 10 10 100.0 %
Branches: 10 14 71.4 %

           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 <iostream>
      21                 :            : #include <memory>
      22                 :            : #include <sstream>
      23                 :            : #include "ad/map/route/ConnectingRouteType.hpp"
      24                 :            : #include "ad/map/route/FullRoute.hpp"
      25                 :            : /*!
      26                 :            :  * @brief namespace ad
      27                 :            :  */
      28                 :            : namespace ad {
      29                 :            : /*!
      30                 :            :  * @brief namespace map
      31                 :            :  */
      32                 :            : namespace map {
      33                 :            : /*!
      34                 :            :  * @brief namespace route
      35                 :            :  *
      36                 :            :  * Handling of routes
      37                 :            :  */
      38                 :            : namespace route {
      39                 :            : 
      40                 :            : /*!
      41                 :            :  * \brief DataType ConnectingRoute
      42                 :            :  *
      43                 :            :  * A special route connecting two objects, A and B, in the map. The connection route
      44                 :            :  * consists of two routes.
      45                 :            :  * routeA is non empty, if the shorted path between A and B can be traveled by A in
      46                 :            :  * forward direction.
      47                 :            :  * routeB is non empty, if the shorted path between A and B can be traveled by B in
      48                 :            :  * forward direction.
      49                 :            :  * We have the following possibilities:
      50                 :            :  * 1: There exists no connecting route (according to the search length/distance restrictions
      51                 :            :  * ): both routeA and routeB are empty
      52                 :            :  * 2: A and B are driving in same direction: one is able to reach the other with driving
      53                 :            :  * forward, but not vice versa
      54                 :            :  * 2.1: If A is in front of B: routeA is empty, routeB contains the route part from
      55                 :            :  * B towards A
      56                 :            :  * 2.2: If B is in front of A: routeB is empty, routeA contains the route part from
      57                 :            :  * A towards B
      58                 :            :  * 3. A and B driving in opposite direction: both are able to reach each other by driving
      59                 :            :  * forward:
      60                 :            :  * routeA contains the route part from A towards B and routeB the inverted route part
      61                 :            :  * from B towards A.
      62                 :            :  * 4. A and B can reach each other directly, but their routes merge at some point:
      63                 :            :  * routeA contains the route part from A towards the merge point
      64                 :            :  * routeB contains the route part from B towards the merge point
      65                 :            :  */
      66                 :         17 : struct ConnectingRoute
      67                 :            : {
      68                 :            :   /*!
      69                 :            :    * \brief Smart pointer on ConnectingRoute
      70                 :            :    */
      71                 :            :   typedef std::shared_ptr<ConnectingRoute> Ptr;
      72                 :            : 
      73                 :            :   /*!
      74                 :            :    * \brief Smart pointer on constant ConnectingRoute
      75                 :            :    */
      76                 :            :   typedef std::shared_ptr<ConnectingRoute const> ConstPtr;
      77                 :            : 
      78                 :            :   /*!
      79                 :            :    * \brief standard constructor
      80                 :            :    */
      81                 :         43 :   ConnectingRoute() = default;
      82                 :            : 
      83                 :            :   /*!
      84                 :            :    * \brief standard destructor
      85                 :            :    */
      86                 :         72 :   ~ConnectingRoute() = default;
      87                 :            : 
      88                 :            :   /*!
      89                 :            :    * \brief standard copy constructor
      90                 :            :    */
      91         [ +  - ]:         14 :   ConnectingRoute(const ConnectingRoute &other) = default;
      92                 :            : 
      93                 :            :   /*!
      94                 :            :    * \brief standard move constructor
      95                 :            :    */
      96                 :         15 :   ConnectingRoute(ConnectingRoute &&other) = default;
      97                 :            : 
      98                 :            :   /**
      99                 :            :    * \brief standard assignment operator
     100                 :            :    *
     101                 :            :    * \param[in] other Other ConnectingRoute
     102                 :            :    *
     103                 :            :    * \returns Reference to this ConnectingRoute.
     104                 :            :    */
     105                 :            :   ConnectingRoute &operator=(const ConnectingRoute &other) = default;
     106                 :            : 
     107                 :            :   /**
     108                 :            :    * \brief standard move operator
     109                 :            :    *
     110                 :            :    * \param[in] other Other ConnectingRoute
     111                 :            :    *
     112                 :            :    * \returns Reference to this ConnectingRoute.
     113                 :            :    */
     114                 :            :   ConnectingRoute &operator=(ConnectingRoute &&other) = default;
     115                 :            : 
     116                 :            :   /**
     117                 :            :    * \brief standard comparison operator
     118                 :            :    *
     119                 :            :    * \param[in] other Other ConnectingRoute
     120                 :            :    *
     121                 :            :    * \returns \c true if both ConnectingRoute are equal
     122                 :            :    */
     123                 :         12 :   bool operator==(const ConnectingRoute &other) const
     124                 :            :   {
     125   [ +  +  +  +  :         12 :     return (type == other.type) && (routeA == other.routeA) && (routeB == other.routeB);
                   +  + ]
     126                 :            :   }
     127                 :            : 
     128                 :            :   /**
     129                 :            :    * \brief standard comparison operator
     130                 :            :    *
     131                 :            :    * \param[in] other Other ConnectingRoute.
     132                 :            :    *
     133                 :            :    * \returns \c true if both ConnectingRoute are different
     134                 :            :    */
     135                 :          4 :   bool operator!=(const ConnectingRoute &other) const
     136                 :            :   {
     137                 :          4 :     return !operator==(other);
     138                 :            :   }
     139                 :            : 
     140                 :            :   /*!
     141                 :            :    * The type of connecting route.
     142                 :            :    */
     143                 :            :   ::ad::map::route::ConnectingRouteType type{::ad::map::route::ConnectingRouteType::Invalid};
     144                 :            : 
     145                 :            :   /*!
     146                 :            :    * The route prefix of object A.
     147                 :            :    * This part of the connected route is only used by object A to travel towards B.
     148                 :            :    * If B is behind A, this part of the connecting route is empty.
     149                 :            :    */
     150                 :            :   ::ad::map::route::FullRoute routeA;
     151                 :            : 
     152                 :            :   /*!
     153                 :            :    * The route prefix of object B.
     154                 :            :    * This part of the connected route is only used by object B to travel towards A.
     155                 :            :    * If A is behind B, this part of the connecting route is empty.
     156                 :            :    */
     157                 :            :   ::ad::map::route::FullRoute routeB;
     158                 :            : };
     159                 :            : 
     160                 :            : } // namespace route
     161                 :            : } // namespace map
     162                 :            : } // namespace ad
     163                 :            : 
     164                 :            : /*!
     165                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     166                 :            :  */
     167                 :            : #ifndef GEN_GUARD_AD_MAP_ROUTE_CONNECTINGROUTE
     168                 :            : #define GEN_GUARD_AD_MAP_ROUTE_CONNECTINGROUTE
     169                 :            : /*!
     170                 :            :  * @brief namespace ad
     171                 :            :  */
     172                 :            : namespace ad {
     173                 :            : /*!
     174                 :            :  * @brief namespace map
     175                 :            :  */
     176                 :            : namespace map {
     177                 :            : /*!
     178                 :            :  * @brief namespace route
     179                 :            :  *
     180                 :            :  * Handling of routes
     181                 :            :  */
     182                 :            : namespace route {
     183                 :            : 
     184                 :            : /**
     185                 :            :  * \brief standard ostream operator
     186                 :            :  *
     187                 :            :  * \param[in] os The output stream to write to
     188                 :            :  * \param[in] _value ConnectingRoute value
     189                 :            :  *
     190                 :            :  * \returns The stream object.
     191                 :            :  *
     192                 :            :  */
     193                 :          8 : inline std::ostream &operator<<(std::ostream &os, ConnectingRoute const &_value)
     194                 :            : {
     195                 :          8 :   os << "ConnectingRoute(";
     196                 :          8 :   os << "type:";
     197                 :          8 :   os << _value.type;
     198                 :          8 :   os << ",";
     199                 :          8 :   os << "routeA:";
     200                 :          8 :   os << _value.routeA;
     201                 :          8 :   os << ",";
     202                 :          8 :   os << "routeB:";
     203                 :          8 :   os << _value.routeB;
     204                 :          8 :   os << ")";
     205                 :          8 :   return os;
     206                 :            : }
     207                 :            : 
     208                 :            : } // namespace route
     209                 :            : } // namespace map
     210                 :            : } // namespace ad
     211                 :            : 
     212                 :            : namespace std {
     213                 :            : /*!
     214                 :            :  * \brief overload of the std::to_string for ConnectingRoute
     215                 :            :  */
     216                 :          1 : inline std::string to_string(::ad::map::route::ConnectingRoute const &value)
     217                 :            : {
     218         [ +  - ]:          2 :   stringstream sstream;
     219         [ +  - ]:          1 :   sstream << value;
     220         [ +  - ]:          2 :   return sstream.str();
     221                 :            : }
     222                 :            : } // namespace std
     223                 :            : #endif // GEN_GUARD_AD_MAP_ROUTE_CONNECTINGROUTE

Generated by: LCOV version 1.14