ad_rss
LateralRelativePosition.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 core {
37 
44 enum class LateralRelativePosition : int32_t
45 {
49  AtLeft = 0,
50 
55  OverlapLeft = 1,
56 
60  Overlap = 2,
61 
66  OverlapRight = 3,
67 
71  AtRight = 4
72 };
73 
74 } // namespace core
75 } // namespace rss
76 } // namespace ad
81 
100 template <typename EnumType> EnumType fromString(std::string const &str);
101 
121 
125 #ifndef GEN_GUARD_AD_RSS_CORE_LATERALRELATIVEPOSITION
126 #define GEN_GUARD_AD_RSS_CORE_LATERALRELATIVEPOSITION
130 namespace ad {
134 namespace rss {
138 namespace core {
139 
149 inline std::ostream &operator<<(std::ostream &os, LateralRelativePosition const &value)
150 {
151  return os << toString(value);
152 }
153 
154 } // namespace core
155 } // namespace rss
156 } // namespace ad
157 
158 namespace std {
162 inline std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
163 {
164  return ::toString(value);
165 }
166 } // namespace std
167 
171 template <> struct fmt::formatter<::ad::rss::core::LateralRelativePosition> : formatter<string_view>
172 {
173  template <typename FormatContext>
174  auto format(::ad::rss::core::LateralRelativePosition const &value, FormatContext &ctx)
175  {
176  return formatter<string_view>::format(std::to_string(value), ctx);
177  }
178 };
179 
180 #endif // GEN_GUARD_AD_RSS_CORE_LATERALRELATIVEPOSITION
EnumType fromString(std::string const &str)
Conversion from std::string to enum type T helper.
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
std::string toString(::ad::rss::core::LateralRelativePosition const e)
Conversion of ad::rss::core::LateralRelativePosition to std::string helper.
std::ostream & operator<<(std::ostream &os, LateralRelativePosition const &value)
standard ostream operator
Definition: LateralRelativePosition.hpp:149
LateralRelativePosition
DataType LateralRelativePosition.
Definition: LateralRelativePosition.hpp:45
namespace ad
Definition: LateralRelativePosition.hpp:28