ad_rss
ObjectType.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 
43 enum class ObjectType : int32_t
44 {
48  Invalid = 0,
49 
53  EgoVehicle = 1,
54 
58  OtherVehicle = 2,
59 
63  Pedestrian = 3,
64 
68  ArtificialObject = 4,
69 
74 
82  Bicycle = 7,
83 
87  OtherObject = 8
88 };
89 
90 } // namespace world
91 } // namespace rss
92 } // namespace ad
96 std::string toString(::ad::rss::world::ObjectType const e);
97 
116 template <typename EnumType> EnumType fromString(std::string const &str);
117 
137 
141 #ifndef GEN_GUARD_AD_RSS_WORLD_OBJECTTYPE
142 #define GEN_GUARD_AD_RSS_WORLD_OBJECTTYPE
146 namespace ad {
150 namespace rss {
154 namespace world {
155 
165 inline std::ostream &operator<<(std::ostream &os, ObjectType const &value)
166 {
167  return os << toString(value);
168 }
169 
170 } // namespace world
171 } // namespace rss
172 } // namespace ad
173 
174 namespace std {
178 inline std::string to_string(::ad::rss::world::ObjectType const &value)
179 {
180  return ::toString(value);
181 }
182 } // namespace std
183 
187 template <> struct fmt::formatter<::ad::rss::world::ObjectType> : formatter<string_view>
188 {
189  template <typename FormatContext> auto format(::ad::rss::world::ObjectType const &value, FormatContext &ctx)
190  {
191  return formatter<string_view>::format(std::to_string(value), ctx);
192  }
193 };
194 
195 #endif // GEN_GUARD_AD_RSS_WORLD_OBJECTTYPE
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::ObjectType const e)
Conversion of ad::rss::world::ObjectType to std::string helper.
ObjectType
DataType ObjectType.
Definition: ObjectType.hpp:44
std::ostream & operator<<(std::ostream &os, Constellation const &_value)
standard ostream operator
Definition: Constellation.hpp:198
namespace ad
Definition: LateralRelativePosition.hpp:28