CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
road
LaneSectionMap.h
Go to the documentation of this file.
1
// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#pragma once
8
9
#include "
carla/NonCopyable.h
"
10
#include "
carla/road/LaneSection.h
"
11
12
#include <map>
13
#include <unordered_map>
14
15
namespace
carla
{
16
namespace
road
{
17
18
class
LaneSectionMap
19
:
private
std::multimap<double, LaneSection>,
20
private
MovableNonCopyable
{
21
using
Super
= std::multimap<double, LaneSection>;
22
public
:
23
24
LaneSection
&
Emplace
(
SectionId
id
,
double
s) {
25
LaneSection
&result = Super::emplace(s,
LaneSection
{id, s})->second;
26
_by_id
.emplace(result.
GetId
(), &result);
27
return
result;
28
}
29
30
LaneSection
&
GetById
(
SectionId
id
) {
31
return
*
_by_id
.at(
id
);
32
}
33
34
const
LaneSection
&
GetById
(
SectionId
id
)
const
{
35
return
*
_by_id
.at(
id
);
36
}
37
38
using
Super::find;
39
using
Super::upper_bound;
40
using
Super::lower_bound;
41
42
using
Super::begin;
43
using
Super::rbegin;
44
using
Super::end;
45
using
Super::rend;
46
47
private
:
48
49
std::unordered_map<SectionId, LaneSection *>
_by_id
;
50
};
51
52
}
// road
53
}
// carla
NonCopyable.h
carla::MovableNonCopyable::MovableNonCopyable
MovableNonCopyable()=default
carla::road::LaneSectionMap
Definition
LaneSectionMap.h:20
carla::road::LaneSectionMap::Super
std::multimap< double, LaneSection > Super
Definition
LaneSectionMap.h:21
carla::road::LaneSectionMap::GetById
const LaneSection & GetById(SectionId id) const
Definition
LaneSectionMap.h:34
carla::road::LaneSectionMap::_by_id
std::unordered_map< SectionId, LaneSection * > _by_id
Definition
LaneSectionMap.h:49
carla::road::LaneSectionMap::Emplace
LaneSection & Emplace(SectionId id, double s)
Definition
LaneSectionMap.h:24
carla::road::LaneSectionMap::GetById
LaneSection & GetById(SectionId id)
Definition
LaneSectionMap.h:30
carla::road::LaneSection
Definition
road/LaneSection.h:24
carla::road::LaneSection::GetId
SectionId GetId() const
Definition
road/LaneSection.cpp:27
carla::road
Definition
SignComponent.h:23
carla::road::SectionId
uint32_t SectionId
Definition
RoadTypes.h:21
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
LaneSection.h
Generated by
1.18.0