/
srv
/
osrm
/
osrm-backend
/
include
/
extractor
/
/srv/osrm/osrm-backend/include/extractor
mkdir
upload
Name
Size
Mode
Actions
intersection/
-
0755
rm
class_data.hpp
981
0644
edit
dl
rm
compressed_edge_container.hpp
3336
0644
edit
dl
rm
compressed_node_based_graph_edge.hpp
418
0644
edit
dl
rm
conditional_turn_penalty.hpp
589
0644
edit
dl
rm
datasources.hpp
1207
0644
edit
dl
rm
edge_based_edge.hpp
3467
0644
edit
dl
rm
edge_based_graph_factory.hpp
7787
0644
edit
dl
rm
edge_based_node.hpp
383
0644
edit
dl
rm
edge_based_node_segment.hpp
2050
0644
edit
dl
rm
extraction_containers.hpp
3679
0644
edit
dl
rm
extraction_helper_functions.hpp
4827
0644
edit
dl
rm
extraction_node.hpp
459
0644
edit
dl
rm
extraction_relation.hpp
5949
0644
edit
dl
rm
extraction_segment.hpp
715
0644
edit
dl
rm
extraction_turn.hpp
4983
0644
edit
dl
rm
extraction_way.hpp
4268
0644
edit
dl
rm
extractor.hpp
5267
0644
edit
dl
rm
extractor_callbacks.hpp
3249
0644
edit
dl
rm
extractor_config.hpp
3040
0644
edit
dl
rm
files.hpp
24372
0644
edit
dl
rm
graph_compressor.hpp
1271
0644
edit
dl
rm
internal_extractor_edge.hpp
2642
0644
edit
dl
rm
intersection_bearings_container.hpp
4487
0644
edit
dl
rm
location_dependent_data.hpp
1797
0644
edit
dl
rm
maneuver_override.hpp
5456
0644
edit
dl
rm
maneuver_override_relation_parser.hpp
1785
0644
edit
dl
rm
name_table.hpp
3596
0644
edit
dl
rm
nbg_to_ebg.hpp
450
0644
edit
dl
rm
nodes_of_way.hpp
1411
0644
edit
dl
rm
node_based_edge.hpp
8024
0644
edit
dl
rm
node_based_graph_factory.hpp
5155
0644
edit
dl
rm
node_data_container.hpp
4558
0644
edit
dl
rm
node_restriction_map.hpp
2292
0644
edit
dl
rm
packed_osm_ids.hpp
520
0644
edit
dl
rm
profile_properties.hpp
5029
0644
edit
dl
rm
query_node.hpp
1411
0644
edit
dl
rm
raster_source.hpp
5002
0644
edit
dl
rm
restriction.hpp
1750
0644
edit
dl
rm
restriction_graph.hpp
4500
0644
edit
dl
rm
restriction_parser.hpp
1768
0644
edit
dl
rm
road_classification.hpp
8390
0644
edit
dl
rm
scripting_environment.hpp
2426
0644
edit
dl
rm
scripting_environment_lua.hpp
4253
0644
edit
dl
rm
segment_data_container.hpp
8032
0644
edit
dl
rm
serialization.hpp
8834
0644
edit
dl
rm
suffix_table.hpp
1407
0644
edit
dl
rm
traffic_lights.hpp
514
0644
edit
dl
rm
traffic_signals.hpp
656
0644
edit
dl
rm
travel_mode.hpp
3666
0644
edit
dl
rm
turn_lane_types.hpp
3754
0644
edit
dl
rm
turn_path.hpp
7483
0644
edit
dl
rm
turn_path_compressor.hpp
2220
0644
edit
dl
rm
turn_path_filter.hpp
669
0644
edit
dl
rm
way_restriction_map.hpp
3114
0644
edit
dl
rm
Edit:
/srv/osrm/osrm-backend/include/extractor/segment_data_container.hpp
(8032B)
#ifndef OSRM_EXTRACTOR_SEGMENT_DATA_CONTAINER_HPP_ #define OSRM_EXTRACTOR_SEGMENT_DATA_CONTAINER_HPP_ #include "util/packed_vector.hpp" #include "util/typedefs.hpp" #include "util/vector_view.hpp" #include "storage/shared_memory_ownership.hpp" #include "storage/tar_fwd.hpp" #include <boost/filesystem/path.hpp> #include <boost/range/adaptor/reversed.hpp> #include <boost/range/iterator_range.hpp> #include <unordered_map> #include <string> #include <vector> namespace osrm::extractor { class CompressedEdgeContainer; namespace detail { template <storage::Ownership Ownership> class SegmentDataContainerImpl; } // namespace detail namespace serialization { template <storage::Ownership Ownership> inline void read(storage::tar::FileReader &reader, const std::string &name, detail::SegmentDataContainerImpl<Ownership> &segment_data); template <storage::Ownership Ownership> inline void write(storage::tar::FileWriter &writer, const std::string &name, const detail::SegmentDataContainerImpl<Ownership> &segment_data); } // namespace serialization namespace detail { template <storage::Ownership Ownership> class SegmentDataContainerImpl { template <typename T> using Vector = util::ViewOrVector<T, Ownership>; template <typename T, std::size_t Bits> using PackedVector = util::detail::PackedVector<T, Bits, Ownership>; friend CompressedEdgeContainer; public: // FIXME We should change the indexing to Edge-Based-Node id using DirectionalGeometryID = std::uint32_t; using SegmentOffset = std::uint32_t; using SegmentNodeVector = Vector<NodeID>; using SegmentWeightVector = PackedVector<SegmentWeight, SEGMENT_WEIGHT_BITS>; using SegmentDurationVector = PackedVector<SegmentDuration, SEGMENT_DURATION_BITS>; using SegmentDatasourceVector = Vector<DatasourceID>; SegmentDataContainerImpl() = default; SegmentDataContainerImpl(Vector<std::uint32_t> index_, SegmentNodeVector nodes_, SegmentWeightVector fwd_weights_, SegmentWeightVector rev_weights_, SegmentDurationVector fwd_durations_, SegmentDurationVector rev_durations_, SegmentDatasourceVector fwd_datasources_, SegmentDatasourceVector rev_datasources_) : index(std::move(index_)), nodes(std::move(nodes_)), fwd_weights(std::move(fwd_weights_)), rev_weights(std::move(rev_weights_)), fwd_durations(std::move(fwd_durations_)), rev_durations(std::move(rev_durations_)), fwd_datasources(std::move(fwd_datasources_)), rev_datasources(std::move(rev_datasources_)) { } auto GetForwardGeometry(const DirectionalGeometryID id) { const auto begin = nodes.begin() + index[id]; const auto end = nodes.begin() + index[id + 1]; return boost::make_iterator_range(begin, end); } auto GetReverseGeometry(const DirectionalGeometryID id) { return boost::adaptors::reverse(GetForwardGeometry(id)); } auto GetForwardDurations(const DirectionalGeometryID id) { const auto begin = fwd_durations.begin() + index[id] + 1; const auto end = fwd_durations.begin() + index[id + 1]; return boost::make_iterator_range(begin, end); } auto GetReverseDurations(const DirectionalGeometryID id) { const auto begin = rev_durations.begin() + index[id]; const auto end = rev_durations.begin() + index[id + 1] - 1; return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); } auto GetForwardWeights(const DirectionalGeometryID id) { const auto begin = fwd_weights.begin() + index[id] + 1; const auto end = fwd_weights.begin() + index[id + 1]; return boost::make_iterator_range(begin, end); } auto GetReverseWeights(const DirectionalGeometryID id) { const auto begin = rev_weights.begin() + index[id]; const auto end = rev_weights.begin() + index[id + 1] - 1; return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); } auto GetForwardDatasources(const DirectionalGeometryID id) { const auto begin = fwd_datasources.begin() + index[id] + 1; const auto end = fwd_datasources.begin() + index[id + 1]; return boost::make_iterator_range(begin, end); } auto GetReverseDatasources(const DirectionalGeometryID id) { const auto begin = rev_datasources.begin() + index[id]; const auto end = rev_datasources.begin() + index[id + 1] - 1; return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); } auto GetForwardGeometry(const DirectionalGeometryID id) const { const auto begin = nodes.cbegin() + index[id]; const auto end = nodes.cbegin() + index[id + 1]; return boost::make_iterator_range(begin, end); } auto GetReverseGeometry(const DirectionalGeometryID id) const { return boost::adaptors::reverse(GetForwardGeometry(id)); } auto GetForwardDurations(const DirectionalGeometryID id) const { const auto begin = fwd_durations.cbegin() + index[id] + 1; const auto end = fwd_durations.cbegin() + index[id + 1]; return boost::make_iterator_range(begin, end); } auto GetReverseDurations(const DirectionalGeometryID id) const { const auto begin = rev_durations.cbegin() + index[id]; const auto end = rev_durations.cbegin() + index[id + 1] - 1; return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); } auto GetForwardWeights(const DirectionalGeometryID id) const { const auto begin = fwd_weights.cbegin() + index[id] + 1; const auto end = fwd_weights.cbegin() + index[id + 1]; return boost::make_iterator_range(begin, end); } auto GetReverseWeights(const DirectionalGeometryID id) const { const auto begin = rev_weights.cbegin() + index[id]; const auto end = rev_weights.cbegin() + index[id + 1] - 1; return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); } auto GetForwardDatasources(const DirectionalGeometryID id) const { const auto begin = fwd_datasources.cbegin() + index[id] + 1; const auto end = fwd_datasources.cbegin() + index[id + 1]; return boost::make_iterator_range(begin, end); } auto GetReverseDatasources(const DirectionalGeometryID id) const { const auto begin = rev_datasources.cbegin() + index[id]; const auto end = rev_datasources.cbegin() + index[id + 1] - 1; return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); } auto GetNumberOfGeometries() const { return index.size() - 1; } auto GetNumberOfSegments() const { return fwd_weights.size(); } friend void serialization::read<Ownership>(storage::tar::FileReader &reader, const std::string &name, detail::SegmentDataContainerImpl<Ownership> &segment_data); friend void serialization::write<Ownership>( storage::tar::FileWriter &writer, const std::string &name, const detail::SegmentDataContainerImpl<Ownership> &segment_data); private: Vector<std::uint32_t> index; SegmentNodeVector nodes; SegmentWeightVector fwd_weights; SegmentWeightVector rev_weights; SegmentDurationVector fwd_durations; SegmentDurationVector rev_durations; SegmentDatasourceVector fwd_datasources; SegmentDatasourceVector rev_datasources; }; } // namespace detail using SegmentDataView = detail::SegmentDataContainerImpl<storage::Ownership::View>; using SegmentDataContainer = detail::SegmentDataContainerImpl<storage::Ownership::Container>; } // namespace osrm::extractor #endif
Save
cmd:
run