ad_rss
LongitudinalResponse.hpp
Go to the documentation of this file.
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 
18 #pragma once
19 
20 #include <iostream>
21 #include <memory>
22 #include <string>
23 #include "spdlog/fmt/ostr.h"
24 #include "spdlog/spdlog.h"
28 namespace ad {
32 namespace rss {
36 namespace state {
37 
45 enum class LongitudinalResponse : int32_t
46 {
50  None = 0,
51 
55  BrakeMinCorrect = 1,
56 
60  BrakeMin = 2
61 };
62 
63 } // namespace state
64 } // namespace rss
65 } // namespace ad
70 
89 template <typename EnumType> EnumType fromString(std::string const &str);
90 
110 
114 #ifndef GEN_GUARD_AD_RSS_STATE_LONGITUDINALRESPONSE
115 #define GEN_GUARD_AD_RSS_STATE_LONGITUDINALRESPONSE
119 namespace ad {
123 namespace rss {
127 namespace state {
128 
138 inline std::ostream &operator<<(std::ostream &os, LongitudinalResponse const &value)
139 {
140  return os << toString(value);
141 }
142 
143 } // namespace state
144 } // namespace rss
145 } // namespace ad
146 
147 namespace std {
151 inline std::string to_string(::ad::rss::state::LongitudinalResponse const &value)
152 {
153  return ::toString(value);
154 }
155 } // namespace std
156 
160 template <> struct fmt::formatter<::ad::rss::state::LongitudinalResponse> : formatter<string_view>
161 {
162  template <typename FormatContext> auto format(::ad::rss::state::LongitudinalResponse const &value, FormatContext &ctx)
163  {
164  return formatter<string_view>::format(std::to_string(value), ctx);
165  }
166 };
167 
168 #endif // GEN_GUARD_AD_RSS_STATE_LONGITUDINALRESPONSE
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
EnumType fromString(std::string const &str)
Conversion from std::string to enum type T helper.
std::string toString(::ad::rss::state::LongitudinalResponse const e)
Conversion of ad::rss::state::LongitudinalResponse to std::string helper.
LongitudinalResponse
DataType LongitudinalResponse.
Definition: LongitudinalResponse.hpp:46
std::ostream & operator<<(std::ostream &os, AccelerationRestriction const &_value)
standard ostream operator
Definition: AccelerationRestriction.hpp:164
namespace ad
Definition: LateralRelativePosition.hpp:28