// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma // de Barcelona (UAB). // // This work is licensed under the terms of the MIT license. // For a copy, see . #pragma once #include "carla/geom/GeoLocation.h" #include "carla/Iterator.h" #include "carla/ListView.h" #include "carla/NonCopyable.h" #include "carla/road/Controller.h" #include "carla/road/element/RoadInfo.h" #include "carla/road/Junction.h" #include "carla/road/Road.h" #include "carla/road/RoadTypes.h" #include "carla/road/Signal.h" #include #include namespace carla { namespace road { class Lane; class MapData : private MovableNonCopyable { public: const geom::GeoLocation &GetGeoReference() const { return _geo_reference; } std::unordered_map &GetRoads(); const std::unordered_map &GetRoads() const { return _roads; } std::unordered_map &GetJunctions(); const std::unordered_map &GetJunctions() const { return _junctions; } bool ContainsRoad(RoadId id) const { return (_roads.find(id) != _roads.end()); } Road &GetRoad(const RoadId id); const Road &GetRoad(const RoadId id) const; Junction *GetJunction(JuncId id); const Junction *GetJunction(JuncId id) const; template auto GetRoadInfo(const RoadId id, const double s) { return GetRoad(id).template GetInfo(s); } template auto GetLaneInfo( const RoadId road_id, const SectionId section_id, const LaneId lane_id, const double s) { return GetRoad(road_id).GetLaneById(section_id, lane_id).template GetInfo(s); } size_t GetRoadCount() const { return _roads.size(); } const std::unordered_map> &GetSignals() const { return _signals; } const std::unordered_map>& GetControllers() const { return _controllers; } private: friend class MapBuilder; MapData() = default; geom::GeoLocation _geo_reference; std::unordered_map _roads; std::unordered_map _junctions; std::unordered_map> _signals; std::unordered_map> _controllers; }; } // namespace road } // namespace carla