ad_rss
WorldModelIndexVector.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 <sstream>
22 #include <vector>
24 #include "spdlog/fmt/ostr.h"
25 #include "spdlog/spdlog.h"
29 namespace ad {
33 namespace rss {
37 namespace world {
38 
44 typedef std::vector<::ad::rss::world::WorldModelIndex> WorldModelIndexVector;
45 
46 } // namespace world
47 } // namespace rss
48 } // namespace ad
49 
53 #ifndef GEN_GUARD_VECTOR_UINT64_T
54 #define GEN_GUARD_VECTOR_UINT64_T
55 namespace std {
65 inline std::ostream &operator<<(std::ostream &os, vector<::ad::rss::world::WorldModelIndex> const &_value)
66 {
67  os << "[";
68  for (auto it = _value.begin(); it != _value.end(); it++)
69  {
70  if (it != _value.begin())
71  {
72  os << ",";
73  }
74  os << *it;
75  }
76  os << "]";
77  return os;
78 }
79 } // namespace std
80 
81 namespace std {
85 inline std::string to_string(::ad::rss::world::WorldModelIndexVector const &value)
86 {
87  stringstream sstream;
88  sstream << value;
89  return sstream.str();
90 }
91 } // namespace std
92 
96 template <> struct fmt::formatter<::ad::rss::world::WorldModelIndexVector> : formatter<string_view>
97 {
98  template <typename FormatContext>
99  auto format(::ad::rss::world::WorldModelIndexVector const &value, FormatContext &ctx)
100  {
101  return formatter<string_view>::format(std::to_string(value), ctx);
102  }
103 };
104 
105 #endif // GEN_GUARD_VECTOR_UINT64_T
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
std::ostream & operator<<(std::ostream &os, LateralRelativePosition const &value)
standard ostream operator
Definition: LateralRelativePosition.hpp:149
std::vector<::ad::rss::world::WorldModelIndex > WorldModelIndexVector
DataType WorldModelIndexVector.
Definition: WorldModelIndexVector.hpp:44
namespace ad
Definition: LateralRelativePosition.hpp:28