ad_map_access
LaneIdSet.hpp
Go to the documentation of this file.
1 // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 //
3 // Copyright (C) 2018-2021 Intel Corporation
4 //
5 // SPDX-License-Identifier: MIT
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
12 #pragma once
13 
14 #include <functional>
15 #include <set>
16 #include <sstream>
17 #include <string>
18 #include "ad/map/lane/LaneId.hpp"
19 
21 namespace ad {
23 namespace map {
25 namespace lane {
26 
27 typedef std::set<LaneId> LaneIdSet;
28 
29 } // namespace lane
30 } // namespace map
31 } // namespace ad
32 
33 namespace std {
34 
35 inline std::ostream &operator<<(std::ostream &os, ::ad::map::lane::LaneIdSet const &laneIdSet)
36 {
37  os << "[ ";
38  for (auto it = laneIdSet.begin(); it != laneIdSet.end(); ++it)
39  {
40  if (it != laneIdSet.begin())
41  {
42  os << ", ";
43  }
44  os << *it;
45  }
46  os << "]";
47  return os;
48 }
49 
50 static inline std::string to_string(::ad::map::lane::LaneIdSet const &laneIdSet)
51 {
52  stringstream sstream;
53  sstream << laneIdSet;
54  return sstream.str();
55 }
56 } // namespace std
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
std::to_string
std::string to_string(::ad::map::access::GeometryStoreItem const &value)
overload of the std::to_string for GeometryStoreItem
Definition: GeometryStoreItem.hpp:183
LaneId.hpp
ad::map::access::operator<<
std::ostream & operator<<(std::ostream &os, GeometryStoreItem const &_value)
standard ostream operator
Definition: GeometryStoreItem.hpp:157