24 std::vector<const road::LaneSection *> sections;
26 sections.emplace_back(§ion);
28 std::sort(sections.begin(), sections.end(),
30 return lhs->GetDistance() < rhs->GetDistance();
54 std::vector<SharedPtr<Lane>> result;
57 for (
const auto &pair : section.
GetLanes()) {
60 if (lane.
GetId() == 0) {
63 if ((
static_cast<int32_t
>(lane.
GetType()) &
static_cast<int32_t
>(type)) == 0) {
83 for (
size_t i = 0u; i < sections.size(); ++i) {
85 if (i + 1u < sections.size()) {
97 for (
size_t i = 0u; i < sections.size(); ++i) {
std::map< std::string, unsigned int > road
double GetDistance() const
The s coordinate, along the road, at which this section begins.
bool ContainsLane(road::LaneId lane_id) const
SharedPtr< Road > GetRoad() const
road::SectionId _section_id
road::SectionId GetId() const
SharedPtr< LaneSection > GetNextSection() const
The next section along the road, or nullptr at the end.
std::vector< SharedPtr< Lane > > GetLanes(road::Lane::LaneType type=road::Lane::LaneType::Driving) const
Every lane in this section of the given type.
SharedPtr< const Map > _parent
SharedPtr< Lane > GetLane(road::LaneId lane_id) const
The lane with this id, or nullptr when the section has no such lane.
SharedPtr< LaneSection > GetPreviousSection() const
The previous section along the road, or nullptr at the start.
uint64_t GetUniqueId() const
Unique id of this section within its map, for use as a dictionary key.
double GetLength() const
Length of the section, in metres.
bool ContainsLane(LaneId id) const
std::map< LaneId, Lane > & GetLanes()
LaneType
Can be used as flags.
LaneSection & GetLaneSectionById(SectionId id)
static std::vector< const road::LaneSection * > SectionsByDistance(const road::Road &road)
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< T > SharedPtr