/
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/serialization.hpp
(8834B)
#ifndef OSRM_EXTRACTOR_IO_HPP #define OSRM_EXTRACTOR_IO_HPP #include "extractor/conditional_turn_penalty.hpp" #include "extractor/datasources.hpp" #include "extractor/intersection_bearings_container.hpp" #include "extractor/maneuver_override.hpp" #include "extractor/name_table.hpp" #include "extractor/nbg_to_ebg.hpp" #include "extractor/node_data_container.hpp" #include "extractor/profile_properties.hpp" #include "extractor/restriction.hpp" #include "extractor/segment_data_container.hpp" #include "storage/io.hpp" #include "storage/serialization.hpp" #include <boost/assert.hpp> namespace osrm::extractor::serialization { // read/write for bearing data template <storage::Ownership Ownership> inline void read(storage::tar::FileReader &reader, const std::string &name, detail::IntersectionBearingsContainer<Ownership> &intersection_bearings) { storage::serialization::read(reader, name + "/bearing_values", intersection_bearings.values_); storage::serialization::read( reader, name + "/node_to_class_id", intersection_bearings.node_to_class_id_); util::serialization::read( reader, name + "/class_id_to_ranges", intersection_bearings.class_id_to_ranges_table_); } template <storage::Ownership Ownership> inline void write(storage::tar::FileWriter &writer, const std::string &name, const detail::IntersectionBearingsContainer<Ownership> &intersection_bearings) { storage::serialization::write(writer, name + "/bearing_values", intersection_bearings.values_); storage::serialization::write( writer, name + "/node_to_class_id", intersection_bearings.node_to_class_id_); util::serialization::write( writer, name + "/class_id_to_ranges", intersection_bearings.class_id_to_ranges_table_); } // read/write for properties file inline void read(storage::tar::FileReader &reader, const std::string &name, ProfileProperties &properties) { reader.ReadInto(name, properties); } inline void write(storage::tar::FileWriter &writer, const std::string &name, const ProfileProperties &properties) { writer.WriteElementCount64(name, 1); writer.WriteFrom(name, properties); } // read/write for datasources file inline void read(storage::tar::FileReader &reader, const std::string &name, Datasources &sources) { reader.ReadInto(name, sources); } inline void write(storage::tar::FileWriter &writer, const std::string &name, Datasources &sources) { writer.WriteElementCount64(name, 1); writer.WriteFrom(name, sources); } // read/write for segment data file template <storage::Ownership Ownership> inline void read(storage::tar::FileReader &reader, const std::string &name, detail::SegmentDataContainerImpl<Ownership> &segment_data) { storage::serialization::read(reader, name + "/index", segment_data.index); storage::serialization::read(reader, name + "/nodes", segment_data.nodes); util::serialization::read(reader, name + "/forward_weights", segment_data.fwd_weights); util::serialization::read(reader, name + "/reverse_weights", segment_data.rev_weights); util::serialization::read(reader, name + "/forward_durations", segment_data.fwd_durations); util::serialization::read(reader, name + "/reverse_durations", segment_data.rev_durations); storage::serialization::read( reader, name + "/forward_data_sources", segment_data.fwd_datasources); storage::serialization::read( reader, name + "/reverse_data_sources", segment_data.rev_datasources); } template <storage::Ownership Ownership> inline void write(storage::tar::FileWriter &writer, const std::string &name, const detail::SegmentDataContainerImpl<Ownership> &segment_data) { storage::serialization::write(writer, name + "/index", segment_data.index); storage::serialization::write(writer, name + "/nodes", segment_data.nodes); util::serialization::write(writer, name + "/forward_weights", segment_data.fwd_weights); util::serialization::write(writer, name + "/reverse_weights", segment_data.rev_weights); util::serialization::write(writer, name + "/forward_durations", segment_data.fwd_durations); util::serialization::write(writer, name + "/reverse_durations", segment_data.rev_durations); storage::serialization::write( writer, name + "/forward_data_sources", segment_data.fwd_datasources); storage::serialization::write( writer, name + "/reverse_data_sources", segment_data.rev_datasources); } template <storage::Ownership Ownership> inline void read(storage::tar::FileReader &reader, const std::string &name, detail::EdgeBasedNodeDataContainerImpl<Ownership> &node_data_container) { // read actual data storage::serialization::read(reader, name + "/nodes", node_data_container.nodes); storage::serialization::read( reader, name + "/annotations", node_data_container.annotation_data); } template <storage::Ownership Ownership> inline void write(storage::tar::FileWriter &writer, const std::string &name, const detail::EdgeBasedNodeDataContainerImpl<Ownership> &node_data_container) { storage::serialization::write(writer, name + "/nodes", node_data_container.nodes); storage::serialization::write( writer, name + "/annotations", node_data_container.annotation_data); } inline void read(storage::io::BufferReader &reader, ConditionalTurnPenalty &turn_penalty) { reader.ReadInto(turn_penalty.turn_offset); reader.ReadInto(turn_penalty.location.lat); reader.ReadInto(turn_penalty.location.lon); auto const num_conditions = reader.ReadElementCount64(); turn_penalty.conditions.resize(num_conditions); for (auto &condition : turn_penalty.conditions) { reader.ReadInto(condition.modifier); storage::serialization::read(reader, condition.times); storage::serialization::read(reader, condition.weekdays); storage::serialization::read(reader, condition.monthdays); } } inline void write(storage::io::BufferWriter &writer, const ConditionalTurnPenalty &turn_penalty) { writer.WriteFrom(turn_penalty.turn_offset); writer.WriteFrom(static_cast<util::FixedLatitude::value_type>(turn_penalty.location.lat)); writer.WriteFrom(static_cast<util::FixedLongitude::value_type>(turn_penalty.location.lon)); writer.WriteElementCount64(turn_penalty.conditions.size()); for (const auto &c : turn_penalty.conditions) { writer.WriteFrom(c.modifier); storage::serialization::write(writer, c.times); storage::serialization::write(writer, c.weekdays); storage::serialization::write(writer, c.monthdays); } } inline void write(storage::io::BufferWriter &writer, const std::vector<ConditionalTurnPenalty> &conditional_penalties) { writer.WriteElementCount64(conditional_penalties.size()); for (const auto &penalty : conditional_penalties) { write(writer, penalty); } } inline void read(storage::io::BufferReader &reader, std::vector<ConditionalTurnPenalty> &conditional_penalties) { auto num_elements = reader.ReadElementCount64(); conditional_penalties.resize(num_elements); for (auto &penalty : conditional_penalties) { read(reader, penalty); } } inline void write(storage::tar::FileWriter &writer, const std::string &name, const std::vector<ConditionalTurnPenalty> &conditional_penalties) { storage::io::BufferWriter buffer_writer; write(buffer_writer, conditional_penalties); storage::serialization::write(writer, name, buffer_writer.GetBuffer()); } inline void read(storage::tar::FileReader &reader, const std::string &name, std::vector<ConditionalTurnPenalty> &conditional_penalties) { std::string buffer; storage::serialization::read(reader, name, buffer); storage::io::BufferReader buffer_reader{buffer}; read(buffer_reader, conditional_penalties); } template <storage::Ownership Ownership> inline void write(storage::tar::FileWriter &writer, const std::string &name, const detail::NameTableImpl<Ownership> &name_table) { storage::io::BufferWriter buffer_writer; util::serialization::write(writer, name, name_table.indexed_data); } template <storage::Ownership Ownership> inline void read(storage::tar::FileReader &reader, const std::string &name, detail::NameTableImpl<Ownership> &name_table) { std::string buffer; util::serialization::read(reader, name, name_table.indexed_data); } } // namespace osrm::extractor::serialization #endif
Save
cmd:
run