ad_rss
RoadSegmentType.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 RoadSegmentType : int32_t
42 {
46  Normal = 0,
47 
51  Intersection = 1
52 };
53 
54 } // namespace world
55 } // namespace rss
56 } // namespace ad
61 
80 template <typename EnumType> EnumType fromString(std::string const &str);
81 
101 
105 #ifndef GEN_GUARD_AD_RSS_WORLD_ROADSEGMENTTYPE
106 #define GEN_GUARD_AD_RSS_WORLD_ROADSEGMENTTYPE
110 namespace ad {
114 namespace rss {
118 namespace world {
119 
129 inline std::ostream &operator<<(std::ostream &os, RoadSegmentType const &value)
130 {
131  return os << toString(value);
132 }
133 
134 } // namespace world
135 } // namespace rss
136 } // namespace ad
137 
138 namespace std {
142 inline std::string to_string(::ad::rss::world::RoadSegmentType const &value)
143 {
144  return ::toString(value);
145 }
146 } // namespace std
147 
151 template <> struct fmt::formatter<::ad::rss::world::RoadSegmentType> : formatter<string_view>
152 {
153  template <typename FormatContext> auto format(::ad::rss::world::RoadSegmentType const &value, FormatContext &ctx)
154  {
155  return formatter<string_view>::format(std::to_string(value), ctx);
156  }
157 };
158 
159 #endif // GEN_GUARD_AD_RSS_WORLD_ROADSEGMENTTYPE
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::world::RoadSegmentType const e)
Conversion of ad::rss::world::RoadSegmentType to std::string helper.
std::ostream & operator<<(std::ostream &os, Constellation const &_value)
standard ostream operator
Definition: Constellation.hpp:198
RoadSegmentType
DataType RoadSegmentType.
Definition: RoadSegmentType.hpp:42
namespace ad
Definition: LateralRelativePosition.hpp:28