LCOV - code coverage report
Current view: top level - generated/include/ad/rss/world - RoadSegmentType.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 2 6 33.3 %
Date: 2025-07-22 06:53:46 Functions: 1 3 33.3 %
Branches: 1 2 50.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2022 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-2046
      16                 :            :  */
      17                 :            : 
      18                 :            : #pragma once
      19                 :            : 
      20                 :            : #include <iostream>
      21                 :            : #include <memory>
      22                 :            : #include <string>
      23                 :            : #include "spdlog/fmt/ostr.h"
      24                 :            : #include "spdlog/spdlog.h"
      25                 :            : /*!
      26                 :            :  * @brief namespace ad
      27                 :            :  */
      28                 :            : namespace ad {
      29                 :            : /*!
      30                 :            :  * @brief namespace rss
      31                 :            :  */
      32                 :            : namespace rss {
      33                 :            : /*!
      34                 :            :  * @brief namespace world
      35                 :            :  */
      36                 :            : namespace world {
      37                 :            : 
      38                 :            : /*!
      39                 :            :  * \brief DataType RoadSegmentType
      40                 :            :  */
      41                 :            : enum class RoadSegmentType : int32_t
      42                 :            : {
      43                 :            :   /*!
      44                 :            :    * Normal lane segement. Nothing special to consider.
      45                 :            :    */
      46                 :            :   Normal = 0,
      47                 :            : 
      48                 :            :   /*!
      49                 :            :    * Lane segment is intersecting with another lane segment of the intersecting road.
      50                 :            :    */
      51                 :            :   Intersection = 1
      52                 :            : };
      53                 :            : 
      54                 :            : } // namespace world
      55                 :            : } // namespace rss
      56                 :            : } // namespace ad
      57                 :            : /*!
      58                 :            :  * \brief Conversion of ::ad::rss::world::RoadSegmentType to std::string helper.
      59                 :            :  */
      60                 :            : std::string toString(::ad::rss::world::RoadSegmentType const e);
      61                 :            : 
      62                 :            : /*!
      63                 :            :  * \brief Conversion from std::string to enum type T helper.
      64                 :            :  *
      65                 :            :  * \param [in] str - a fully qualified string name of enum class type
      66                 :            :  *
      67                 :            :  * \return T enum value
      68                 :            :  *
      69                 :            :  * \throws std::out_of_range exception if the given string does not match any enum type
      70                 :            :  *
      71                 :            :  * Example usage:
      72                 :            :  * \code
      73                 :            :  *   auto value = fromString<SomeEnumType>("SomeEnumType::eValue");
      74                 :            :  *   assert(value == SomeEnumType::eValue);
      75                 :            :  *   // Or:
      76                 :            :  *   auto value = fromString<SomeEnumType>("eValue");
      77                 :            :  *   assert(value == SomeEnumType::eValue);
      78                 :            :  * \endcode
      79                 :            :  */
      80                 :            : template <typename EnumType> EnumType fromString(std::string const &str);
      81                 :            : 
      82                 :            : /*!
      83                 :            :  * \brief Conversion from std::string to enum type T helper.
      84                 :            :  *
      85                 :            :  * \param [in] str - a fully qualified string name of enum class type
      86                 :            :  *
      87                 :            :  * \return T enum value
      88                 :            :  *
      89                 :            :  * \throws std::out_of_range exception if the given string does not match any enum type
      90                 :            :  *
      91                 :            :  * Example usage:
      92                 :            :  * \code
      93                 :            :  *   auto value = fromString<SomeEnumType>("SomeEnumType::eValue");
      94                 :            :  *   assert(value == SomeEnumType::eValue);
      95                 :            :  *   // Or:
      96                 :            :  *   auto value = fromString<SomeEnumType>("eValue");
      97                 :            :  *   assert(value == SomeEnumType::eValue);
      98                 :            :  * \endcode
      99                 :            :  */
     100                 :            : template <>::ad::rss::world::RoadSegmentType fromString(std::string const &str);
     101                 :            : 
     102                 :            : /*!
     103                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     104                 :            :  */
     105                 :            : #ifndef GEN_GUARD_AD_RSS_WORLD_ROADSEGMENTTYPE
     106                 :            : #define GEN_GUARD_AD_RSS_WORLD_ROADSEGMENTTYPE
     107                 :            : /*!
     108                 :            :  * @brief namespace ad
     109                 :            :  */
     110                 :            : namespace ad {
     111                 :            : /*!
     112                 :            :  * @brief namespace rss
     113                 :            :  */
     114                 :            : namespace rss {
     115                 :            : /*!
     116                 :            :  * @brief namespace world
     117                 :            :  */
     118                 :            : namespace world {
     119                 :            : 
     120                 :            : /**
     121                 :            :  * \brief standard ostream operator
     122                 :            :  *
     123                 :            :  * \param[in] os The output stream to write to
     124                 :            :  * \param[in] value RoadSegmentType value
     125                 :            :  *
     126                 :            :  * \returns The stream object.
     127                 :            :  *
     128                 :            :  */
     129                 :         11 : inline std::ostream &operator<<(std::ostream &os, RoadSegmentType const &value)
     130                 :            : {
     131         [ +  - ]:         11 :   return os << toString(value);
     132                 :            : }
     133                 :            : 
     134                 :            : } // namespace world
     135                 :            : } // namespace rss
     136                 :            : } // namespace ad
     137                 :            : 
     138                 :            : namespace std {
     139                 :            : /*!
     140                 :            :  * \brief overload of the std::to_string for RoadSegmentType
     141                 :            :  */
     142                 :          0 : inline std::string to_string(::ad::rss::world::RoadSegmentType const &value)
     143                 :            : {
     144                 :          0 :   return ::toString(value);
     145                 :            : }
     146                 :            : } // namespace std
     147                 :            : 
     148                 :            : /*!
     149                 :            :  * \brief overload of fmt::formatter calling std::to_string
     150                 :            :  */
     151                 :            : template <> struct fmt::formatter<::ad::rss::world::RoadSegmentType> : formatter<string_view>
     152                 :            : {
     153                 :          0 :   template <typename FormatContext> auto format(::ad::rss::world::RoadSegmentType const &value, FormatContext &ctx)
     154                 :            :   {
     155                 :          0 :     return formatter<string_view>::format(std::to_string(value), ctx);
     156                 :            :   }
     157                 :            : };
     158                 :            : 
     159                 :            : #endif // GEN_GUARD_AD_RSS_WORLD_ROADSEGMENTTYPE

Generated by: LCOV version 1.14