ad_rss
LaneDrivingDirection.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 world {
37 
41 enum class LaneDrivingDirection : int32_t
42 {
46  Bidirectional = 0,
47 
51  Positive = 1,
52 
56  Negative = 2
57 };
58 
59 } // namespace world
60 } // namespace rss
61 } // namespace ad
66 
85 template <typename EnumType> EnumType fromString(std::string const &str);
86 
106 
110 #ifndef GEN_GUARD_AD_RSS_WORLD_LANEDRIVINGDIRECTION
111 #define GEN_GUARD_AD_RSS_WORLD_LANEDRIVINGDIRECTION
115 namespace ad {
119 namespace rss {
123 namespace world {
124 
134 inline std::ostream &operator<<(std::ostream &os, LaneDrivingDirection const &value)
135 {
136  return os << toString(value);
137 }
138 
139 } // namespace world
140 } // namespace rss
141 } // namespace ad
142 
143 namespace std {
147 inline std::string to_string(::ad::rss::world::LaneDrivingDirection const &value)
148 {
149  return ::toString(value);
150 }
151 } // namespace std
152 
156 template <> struct fmt::formatter<::ad::rss::world::LaneDrivingDirection> : formatter<string_view>
157 {
158  template <typename FormatContext> auto format(::ad::rss::world::LaneDrivingDirection const &value, FormatContext &ctx)
159  {
160  return formatter<string_view>::format(std::to_string(value), ctx);
161  }
162 };
163 
164 #endif // GEN_GUARD_AD_RSS_WORLD_LANEDRIVINGDIRECTION
EnumType fromString(std::string const &str)
Conversion from std::string to enum type T helper.
std::string toString(::ad::rss::world::LaneDrivingDirection const e)
Conversion of ad::rss::world::LaneDrivingDirection to std::string helper.
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
LaneDrivingDirection
DataType LaneDrivingDirection.
Definition: LaneDrivingDirection.hpp:42
std::ostream & operator<<(std::ostream &os, Constellation const &_value)
standard ostream operator
Definition: Constellation.hpp:198
namespace ad
Definition: LateralRelativePosition.hpp:28