LCOV - code coverage report
Current view: top level - generated/include/ad/rss/state - LongitudinalResponse.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 state
      35                 :            :  */
      36                 :            : namespace state {
      37                 :            : 
      38                 :            : /*!
      39                 :            :  * \brief DataType LongitudinalResponse
      40                 :            :  *
      41                 :            :  * Enumeration defining the possible longitudinal responses.
      42                 :            :  * Be aware: there has to be a strict order of the enumeration values according to
      43                 :            :  * the strictness of the response.
      44                 :            :  */
      45                 :            : enum class LongitudinalResponse : int32_t
      46                 :            : {
      47                 :            :   /*!
      48                 :            :    * No action required.
      49                 :            :    */
      50                 :            :   None = 0,
      51                 :            : 
      52                 :            :   /*!
      53                 :            :    * Vehicle has to decerate at least with brake min correct longitudinally
      54                 :            :    */
      55                 :            :   BrakeMinCorrect = 1,
      56                 :            : 
      57                 :            :   /*!
      58                 :            :    * Vehicle has to decerate at least with brake min longitudinally
      59                 :            :    */
      60                 :            :   BrakeMin = 2
      61                 :            : };
      62                 :            : 
      63                 :            : } // namespace state
      64                 :            : } // namespace rss
      65                 :            : } // namespace ad
      66                 :            : /*!
      67                 :            :  * \brief Conversion of ::ad::rss::state::LongitudinalResponse to std::string helper.
      68                 :            :  */
      69                 :            : std::string toString(::ad::rss::state::LongitudinalResponse const e);
      70                 :            : 
      71                 :            : /*!
      72                 :            :  * \brief Conversion from std::string to enum type T helper.
      73                 :            :  *
      74                 :            :  * \param [in] str - a fully qualified string name of enum class type
      75                 :            :  *
      76                 :            :  * \return T enum value
      77                 :            :  *
      78                 :            :  * \throws std::out_of_range exception if the given string does not match any enum type
      79                 :            :  *
      80                 :            :  * Example usage:
      81                 :            :  * \code
      82                 :            :  *   auto value = fromString<SomeEnumType>("SomeEnumType::eValue");
      83                 :            :  *   assert(value == SomeEnumType::eValue);
      84                 :            :  *   // Or:
      85                 :            :  *   auto value = fromString<SomeEnumType>("eValue");
      86                 :            :  *   assert(value == SomeEnumType::eValue);
      87                 :            :  * \endcode
      88                 :            :  */
      89                 :            : template <typename EnumType> EnumType fromString(std::string const &str);
      90                 :            : 
      91                 :            : /*!
      92                 :            :  * \brief Conversion from std::string to enum type T helper.
      93                 :            :  *
      94                 :            :  * \param [in] str - a fully qualified string name of enum class type
      95                 :            :  *
      96                 :            :  * \return T enum value
      97                 :            :  *
      98                 :            :  * \throws std::out_of_range exception if the given string does not match any enum type
      99                 :            :  *
     100                 :            :  * Example usage:
     101                 :            :  * \code
     102                 :            :  *   auto value = fromString<SomeEnumType>("SomeEnumType::eValue");
     103                 :            :  *   assert(value == SomeEnumType::eValue);
     104                 :            :  *   // Or:
     105                 :            :  *   auto value = fromString<SomeEnumType>("eValue");
     106                 :            :  *   assert(value == SomeEnumType::eValue);
     107                 :            :  * \endcode
     108                 :            :  */
     109                 :            : template <>::ad::rss::state::LongitudinalResponse fromString(std::string const &str);
     110                 :            : 
     111                 :            : /*!
     112                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     113                 :            :  */
     114                 :            : #ifndef GEN_GUARD_AD_RSS_STATE_LONGITUDINALRESPONSE
     115                 :            : #define GEN_GUARD_AD_RSS_STATE_LONGITUDINALRESPONSE
     116                 :            : /*!
     117                 :            :  * @brief namespace ad
     118                 :            :  */
     119                 :            : namespace ad {
     120                 :            : /*!
     121                 :            :  * @brief namespace rss
     122                 :            :  */
     123                 :            : namespace rss {
     124                 :            : /*!
     125                 :            :  * @brief namespace state
     126                 :            :  */
     127                 :            : namespace state {
     128                 :            : 
     129                 :            : /**
     130                 :            :  * \brief standard ostream operator
     131                 :            :  *
     132                 :            :  * \param[in] os The output stream to write to
     133                 :            :  * \param[in] value LongitudinalResponse value
     134                 :            :  *
     135                 :            :  * \returns The stream object.
     136                 :            :  *
     137                 :            :  */
     138                 :          9 : inline std::ostream &operator<<(std::ostream &os, LongitudinalResponse const &value)
     139                 :            : {
     140         [ +  - ]:          9 :   return os << toString(value);
     141                 :            : }
     142                 :            : 
     143                 :            : } // namespace state
     144                 :            : } // namespace rss
     145                 :            : } // namespace ad
     146                 :            : 
     147                 :            : namespace std {
     148                 :            : /*!
     149                 :            :  * \brief overload of the std::to_string for LongitudinalResponse
     150                 :            :  */
     151                 :          0 : inline std::string to_string(::ad::rss::state::LongitudinalResponse const &value)
     152                 :            : {
     153                 :          0 :   return ::toString(value);
     154                 :            : }
     155                 :            : } // namespace std
     156                 :            : 
     157                 :            : /*!
     158                 :            :  * \brief overload of fmt::formatter calling std::to_string
     159                 :            :  */
     160                 :            : template <> struct fmt::formatter<::ad::rss::state::LongitudinalResponse> : formatter<string_view>
     161                 :            : {
     162                 :          0 :   template <typename FormatContext> auto format(::ad::rss::state::LongitudinalResponse const &value, FormatContext &ctx)
     163                 :            :   {
     164                 :          0 :     return formatter<string_view>::format(std::to_string(value), ctx);
     165                 :            :   }
     166                 :            : };
     167                 :            : 
     168                 :            : #endif // GEN_GUARD_AD_RSS_STATE_LONGITUDINALRESPONSE

Generated by: LCOV version 1.14