LCOV - code coverage report
Current view: top level - generated/include/ad/map/lane - LaneType.hpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 2 2 100.0 %
Date: 2022-10-04 09:48:07 Functions: 1 1 100.0 %
Branches: 1 2 50.0 %

           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 <string>
      23                 :            : /*!
      24                 :            :  * @brief namespace ad
      25                 :            :  */
      26                 :            : namespace ad {
      27                 :            : /*!
      28                 :            :  * @brief namespace map
      29                 :            :  */
      30                 :            : namespace map {
      31                 :            : /*!
      32                 :            :  * @brief namespace lane
      33                 :            :  *
      34                 :            :  * Handling of lanes
      35                 :            :  */
      36                 :            : namespace lane {
      37                 :            : 
      38                 :            : /*!
      39                 :            :  * \brief DataType LaneType
      40                 :            :  *
      41                 :            :  * Type of lane
      42                 :            :  */
      43                 :            : enum class LaneType : int32_t
      44                 :            : {
      45                 :            :   /*!
      46                 :            :    INVALID
      47                 :            :    */
      48                 :            :   INVALID = 0,
      49                 :            :   /*!
      50                 :            :    UNKNOWN
      51                 :            :    */
      52                 :            :   UNKNOWN = 1,
      53                 :            :   /*!
      54                 :            :    NORMAL
      55                 :            :    */
      56                 :            :   NORMAL = 2,
      57                 :            :   /*!
      58                 :            :    INTERSECTION
      59                 :            :    */
      60                 :            :   INTERSECTION = 3,
      61                 :            :   /*!
      62                 :            :    SHOULDER
      63                 :            :    */
      64                 :            :   SHOULDER = 4,
      65                 :            :   /*!
      66                 :            :    EMERGENCY
      67                 :            :    */
      68                 :            :   EMERGENCY = 5,
      69                 :            :   /*!
      70                 :            :    MULTI
      71                 :            :    */
      72                 :            :   MULTI = 6,
      73                 :            :   /*!
      74                 :            :    PEDESTRIAN
      75                 :            :    */
      76                 :            :   PEDESTRIAN = 7,
      77                 :            :   /*!
      78                 :            :    OVERTAKING
      79                 :            :    */
      80                 :            :   OVERTAKING = 8,
      81                 :            :   /*!
      82                 :            :    TURN
      83                 :            :    */
      84                 :            :   TURN = 9,
      85                 :            :   /*!
      86                 :            :    BIKE
      87                 :            :    */
      88                 :            :   BIKE = 10
      89                 :            : };
      90                 :            : 
      91                 :            : } // namespace lane
      92                 :            : } // namespace map
      93                 :            : } // namespace ad
      94                 :            : /*!
      95                 :            :  * \brief Conversion of ::ad::map::lane::LaneType to std::string helper.
      96                 :            :  */
      97                 :            : std::string toString(::ad::map::lane::LaneType const e);
      98                 :            : 
      99                 :            : /*!
     100                 :            :  * \brief Conversion from std::string to enum type T helper.
     101                 :            :  *
     102                 :            :  * \param [in] str - a fully qualified string name of enum class type
     103                 :            :  *
     104                 :            :  * \return T enum value
     105                 :            :  *
     106                 :            :  * \throws std::out_of_range exception if the given string does not match any enum type
     107                 :            :  *
     108                 :            :  * Example usage:
     109                 :            :  * \code
     110                 :            :  *   auto value = fromString<SomeEnumType>("SomeEnumType::eValue");
     111                 :            :  *   assert(value == SomeEnumType::eValue);
     112                 :            :  *   // Or:
     113                 :            :  *   auto value = fromString<SomeEnumType>("eValue");
     114                 :            :  *   assert(value == SomeEnumType::eValue);
     115                 :            :  * \endcode
     116                 :            :  */
     117                 :            : template <typename EnumType> EnumType fromString(std::string const &str);
     118                 :            : 
     119                 :            : /*!
     120                 :            :  * \brief Conversion from std::string to enum type T helper.
     121                 :            :  *
     122                 :            :  * \param [in] str - a fully qualified string name of enum class type
     123                 :            :  *
     124                 :            :  * \return T enum value
     125                 :            :  *
     126                 :            :  * \throws std::out_of_range exception if the given string does not match any enum type
     127                 :            :  *
     128                 :            :  * Example usage:
     129                 :            :  * \code
     130                 :            :  *   auto value = fromString<SomeEnumType>("SomeEnumType::eValue");
     131                 :            :  *   assert(value == SomeEnumType::eValue);
     132                 :            :  *   // Or:
     133                 :            :  *   auto value = fromString<SomeEnumType>("eValue");
     134                 :            :  *   assert(value == SomeEnumType::eValue);
     135                 :            :  * \endcode
     136                 :            :  */
     137                 :            : template <>::ad::map::lane::LaneType fromString(std::string const &str);
     138                 :            : 
     139                 :            : /*!
     140                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     141                 :            :  */
     142                 :            : #ifndef GEN_GUARD_AD_MAP_LANE_LANETYPE
     143                 :            : #define GEN_GUARD_AD_MAP_LANE_LANETYPE
     144                 :            : /*!
     145                 :            :  * @brief namespace ad
     146                 :            :  */
     147                 :            : namespace ad {
     148                 :            : /*!
     149                 :            :  * @brief namespace map
     150                 :            :  */
     151                 :            : namespace map {
     152                 :            : /*!
     153                 :            :  * @brief namespace lane
     154                 :            :  *
     155                 :            :  * Handling of lanes
     156                 :            :  */
     157                 :            : namespace lane {
     158                 :            : 
     159                 :            : /**
     160                 :            :  * \brief standard ostream operator
     161                 :            :  *
     162                 :            :  * \param[in] os The output stream to write to
     163                 :            :  * \param[in] value LaneType value
     164                 :            :  *
     165                 :            :  * \returns The stream object.
     166                 :            :  *
     167                 :            :  */
     168                 :         26 : inline std::ostream &operator<<(std::ostream &os, LaneType const &value)
     169                 :            : {
     170         [ +  - ]:         26 :   return os << toString(value);
     171                 :            : }
     172                 :            : 
     173                 :            : } // namespace lane
     174                 :            : } // namespace map
     175                 :            : } // namespace ad
     176                 :            : 
     177                 :            : namespace std {
     178                 :            : /*!
     179                 :            :  * \brief overload of the std::to_string for LaneType
     180                 :            :  */
     181                 :            : inline std::string to_string(::ad::map::lane::LaneType const &value)
     182                 :            : {
     183                 :            :   return ::toString(value);
     184                 :            : }
     185                 :            : } // namespace std
     186                 :            : #endif // GEN_GUARD_AD_MAP_LANE_LANETYPE

Generated by: LCOV version 1.14